The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Aug 17th, 2024, 4:19am
Pages: 1
Send Topic Print
Matlab script periods to Sphi (Read 3615 times)
seho
New Member
*
Offline



Posts: 4

Matlab script periods to Sphi
Feb 05th, 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

Back to top
 
 
View Profile   IP Logged
abs
New Member
*
Offline



Posts: 4

Re: Matlab script periods to Sphi
Reply #1 - 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.
Back to top
 
 
View Profile   IP Logged
seho
New Member
*
Offline



Posts: 4

Re: Matlab script periods to Sphi
Reply #2 - 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
Back to top
 
 
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.