The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Measurements >> Phase Noise and Jitter Measurements >> Matlab script periods to Sphi
https://designers-guide.org/forum/YaBB.pl?num=1170678430

Message started by seho on Feb 5th, 2007, 4:27am

Title: Matlab script periods to Sphi
Post by seho on Feb 5th, 2007, 4:27am

I have a question concerning the matlab code from Ken's Paper "Predicting the phase noise and jitter of PLL-based frequency synthesizers" that computes the phase noise PSD from periods data. During my simulations and analysis I found a difference of 3dB in the phase noise spectrum (Sphi) from the matlab output and the expected value. I used the parameters from the example in Ken's paper on page 44.

VCO: L(100kHz)=-48dBc/Hz and thus  Sphi(100kHz) =-45db/Hz
    fc=2GHz      
using the equation

     J2=Sphi/2*(100kHz)2/(2GHz)3

this leads to a period jitter of 4.45ps.

I generated periods with accumulating jitter with the matlab skript:


Code:
%% Generation of accumulated jitter data
T=0.5e-9;
Jvar=4.45e-12;
t=0;        %absolute time of rising edge
tprev=0;    %previous time of rising edge
imax=100000;
i=1;
periods=zeros(imax,1);
for i = 1:imax
    t=tprev+T+Jvar*randn(1);    %accumulating jitter
    periods(i,1)=t-tprev;       %periods
    tprev=t;
end
save acc_jitter.dat periods -ASCII;


and calculated the phase noise PSD Sphi with the skript:


Code:
%%Calculate Sphi
nfft=2^12;   %number of fft points
winLength=nfft;
overlap=nfft/2;
winNBW=1.5;
load acc_jitter.dat;
periods=acc_jitter;
peri_lenght = length(periods);
% output estimates of period and jitter
T=mean(periods);
J=std(periods);
maxdT = max(abs(periods-T))/T;
fprintf('T = %.3gs, F = %.3gHz\n',T, 1/T);
fprintf('Jabs = %.3gs, Jrel = %.2g%%\n', J, 100*J/T);
fprintf('max dT = %.2g%%\n', 100*maxdT);
fprintf('periods = %d, nfft = %d\n', length(periods), nfft);

% compute the cumulative phase of each transition
phases=2*pi*cumsum(periods)/T;

% compute power spectral density of phase
[Sphi,f]=psd(phases,nfft,1/T,winLength,overlap,'linear');
% correct for scaling in PSD due to FFT and window
Sphi=winNBW*Sphi/nfft;

% plot the results (except at DC)
K = length(f);
rbw = winNBW/(T*nfft);

%norm to resolution bandwidth
Sphi_norm=Sphi/rbw;

figure;
semilogx(f(2:K),10*log10(Sphi_norm(2:K)));
title('Normalized Power Spectral Density of Phase');
xlabel('Frequency (Hz)');
ylabel('S phi (dB/Hz)');
RBW=sprintf('Resolution Bandwidth = %.0f Hz (%.0f dB)',rbw, 10*log10(rbw));
imtext(0.5,0.07, RBW);
grid on;


The output gives a period jitter of 4.45 ps (same as input), but a Sphi of

-68 dB/Hz @ 10^6Hz
-48 dB/Hz @ 10^5Hz
and so on.

Oviously there is a difference of 3dB (factor 2) in the PSD compared to the analytical equation.

Maybe this is due to the normalization to resolution bandwidth which is not correct.

Does anybody have an idea where the 3db (factor 2) are missing?


Thank you very much


Title: Re: Matlab script periods to Sphi
Post by abs on Feb 8th, 2007, 1:35am

The psd or pwelch gives single single-sided psd if you give real signal. It thinks  all energy distrubuted in 0~1/2T. However, we The Sphi equation has already count single-sided L(f). So, you should divide the Sphi by 2.

Title: Re: Matlab script periods to Sphi
Post by seho on Feb 9th, 2007, 12:34am

Thanks for your answer,

I'm a little bit confused now. To my opinion in the given formulas single sideband noise spectra are used to compute the jitter variance. The psd() function also gives single sideband PSD for real input signals. So why is the PSD from the formula (for a given jitter variance) not the same that matlab computes (for the same jitter variance)?

In my case the matlab output is 3dB below the calculated value. So I should multiply the Sphi from matlab with two. But why?

Kind regards

Sebastian

The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.