I also try to use phaseNoiseMeasure function to find dBc/Hz from the time domain data. But I got error messages. Here is my code for this exercise:
% Specify the parameters of a signal with a sampling frequency of 1 kHz and a signal duration of 1.5 seconds.
Fs = 20000; % Sampling frequency
T = 1/Fs; % Sampling period
L = 4000; % Length of signal samping points
t = (0:L-1)/Fs; % Time vector
%% LFM Signal -- A signal cotians two signals: f1, f2
fc=5000; % Hz
ffm=fc+800*t; % Hz
theta=1; % important factor for umop
s1 = diag((1+0.5*cos(2*pi*fam*t))'*cos(2*pi*(ffm.*t)+phs*rand()/theta));
H = hilbert(s1');
% Plot the noisy signal in the time domain. It is difficult to identify the frequency components by looking at the signal X(t).
Y = fft(H); % compute FFT
% 1. Compute the two-sided spectrum P2.
% 2. Then compute the single-sided spectrum P1 based on P2
% 3. and the even-valued signal length L.
P2 = abs(Y/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1);
% Define the frequency domain f and plot the single-sided amplitude spectrum P1.
% The amplitudes are not exactly at 0.7 and 1, as expected, because of the added noise.
% On average, longer signals produce better frequency approximations.
f = Fs*(0:(L/2))/L; % The max frequency that can be measured, based on Nyquist
title('Single-Sided Amplitude Spectrum of s1(t)-LFM1')
rbw = 1e3;
FrOffset = [1e3 2e3 4e3 4e3];
PNTarget = [-56 -106 -132 -143];
PNMeasure = phaseNoiseMeasure(f1,p1,rbw,FrOffset,'on','Phase noise', PNTarget)
Any help is appreciated.