Source: http://www.mathworks.cn/matlabcentral/fileexchange/22038-phase-noise-to-jitter/content/Pn2Jitter.m
function jitter = Pn2jitter (f, Lf, FC)% Summary:jitter (RMS) calculation from phase noise vs. frequency data.
% calculates RMS jitter by integrating phase noise power data.
% Phase noise data can be derived from graphical information or an% actual measurement data file. % Usage:% jitter = Pn2jitter (f, Lf, FC)% Inputs:% f:frequency vector (phase noise break points), in Hz, row or
Column.
% lf:phase noise vector, in dbc/hz, same dimensions, size (), as F.% Fc:carrier frequency, in Hz, a scalar.
% Output:% jitter:rms jitter, in seconds. % Examples:% [1] >> f = [10^0 10^1 10^3 10^4 10^6];
Lf = [ -39-73-122-131-149]; % >> jitter = Pn2jitter (f, Lf, 70e6)% jitter = 2.3320e-011 comparing Fordahl application Note an-02-3{*} and jittertime.com{+}% calculations at FC = 70MHz pn2jitter.m:23.32 0ps an-02-3 (Graphical method): 21.135ps% an-02-3 (numerical method): 24.11ps aeroflex PN9000 computation:24.56ps% jittertime.com calculation:23.32ps% {*} Fordahl Application Note an-02-3:% "Phase noise to jitter conversion"% HT Tp://fordahl.com/images/phasenoise.pdf% as of one also it appears here:% http://www.metatech.co M.hk/appnote/fordahl/pdf/e_an-02-3.pdf% http://www.metatech.com.tw/doc/appnote-fordahl/e-AN-02-3.pdf% {+} Jittertime Consulting LLC web Calculator% http://www.jittertime.com/resources/pncalc.shtml% as of 5 May 2
008% [2] >> f = [10^2 10^3 10^4 10^5 10^6 10^7 4.6*10^9]; % >> Lf = [ -82-80-77-112-134-146-146]; Format long >> jitter = Pn2jitter (f, Lf, 2.25e9)% jitter = 1.566598599875678e-012 Comp aring ADI Application note{$} calculations at FC = 2.25GHz Pn2jitter.m:1.56659859987568ps% MT-008: 1.57ps% Raltron {&}: 1.56659857673259ps% jittertime:1.529ps--excluding The (4.6GHz, -146) data point,% As 1GHz is the maximum allowed% {$} Analog Devices, Inc. (ADI) Application Note MT-008:% "Converting oscillator Phase Noise to time jitter"% http://www.analog.com/en/content/0,2886 , 760%255f%255f91502,00.html% {&} Raltron Web RMS Phase jitter Calculator:% "Convert SSB phase noise to jitter"% http://www.raltron.com/cust/tools/osc.asp% Note:raltron is restr
Icted to f (min) = 10Hz;
% therefore it cannot is used in this example [1]. %% [3] >> f = [10^2 10^3 10^4 200*10^6];
Lf = [ -125-150-174-174]; % >> jitter = Pn2jitter (f, Lf, 100e6)% jitter = 6.4346e-014 comparing ADI Application No te{$} calculations at FC = 100MHz% PN2JITTER.M:0.064346PS% mt-008:0.064ps
% JITTERTIME:0.065PS% Note:% F and Lf must is the same length, lest you get a error and this% Im
Probable result:jitter = 42i. % (A spreadsheet, Noise.xls, is available from Wenzel Associates, Inc. at% http://www.wenzel.com, "Allan Variance F Rom Phase Noise. "% It requires as input tangents to the plotted measured Phase Noise data,% with slopes of 1/(f^n)-- Not the actual data itself--for the% calculation. The app. Note from Fordahl discusses this method, in% addition to numerical, to calculate jitter.
This graphical straight-% line approximation integration technique tends to underestimate total% RMS jitter.) % [4] Data can also is imported directly from a Aeroflex PN9000 ASCII% file, after removing extraneous text . How to does it:% (1) in Excel, import the PN9000 data file as tab-delimited data,% (2) Remove superfluous Co Lumns and first 3 rows, leaving 2 columns% with frequency (Hz) anD Lf (dbc/hz) data only. % (with the new PN9000 as of April 2006, only the first row% was to be removed, and there was only
The columns. % I may take advantage of a updated version of this program,thereby eliminating the NE Ed to edit the data),% (3) Save as-Text (MS-DOS) (*.txt), e.g., A:\Stuff.txt,% (4) at the MATLAB Co Mmand Window prompt:% >> load ' a:\Stuff.txt '-ascii% now Stuff is a MATLAB workspace Variab
Le with the% phase noise data,% (5) >> Pn2jitter (Stuff (:, 1), Stuff (:, 2), FC); % (assuming FC have been defined)% one 10MHz carrier data set resulted in the following:% Pn2ji
Tter.m:368.33fs% PN9000 calculation:375fs% Runs at least as far back as MATLAB version 5.3 (R11.1). % Copyright (c) 2005 by Arne Buck, Axolotol Design, Inc. Friday 2005% Arne (d 0 T) Buck [A +] Alum{d O +} mit (d 0 +} e D u% $Revision: 1.2 $ $Date: 2005/05/13 23:42:42 $% License to use and modify this cod E is granted freely, without warranty,% to all as long as the original author is referenced and attributed% as such. The original author maintains the right to being solely% associated with this work.
So there. % Bug fixes to resolve problematic data resulting in division by 0, or% excessive exponents beyond MATLAB ' s capability o F realmin (2.2251e-308)% and Realmax (1.7977e+308); No demonstrable effect on jitter calculation% AB 18may2005 fix/0 bugs for *exactly* -10.000db difference in adjacent Lf% AB 24may2005 Fix Large and small exponents resulting from PN9000 data% AB 11may2007 Improve documentation, update URLs% AB 5may2008 Verify and update URLs tic percent It ' s almost nine o ' clock.
We ' ve got to go into work.
L = Length (Lf);
if L = = Length (f)% Fix ill-conditioned data. I=find (diff (Lf) = =-10); LF (i) = LF (i) + i/10^6;
% Diddle adjacent Lf with % a diff=-10.00db, avoid ai:/0% Just say "No" to for loops. LP = L-1; LFM = Lf (1:LP); LfM = Lf (2:l); % m~car+, M=CDR fm = f (1:LP); FM = f (2:l);
ai = (LFM-LFM)./(LOG10 (FM)-LOG10 (FM));
% cull out problematic fine-sieve data from the PN9000. Iinf = Find ((fm.^ (-AI/10) = = inf) | fm.^ (-AI/10) <10^ (-300)); % FIND INF FM (iinf) = []; FM (Iinf-1) = []; LFM (Iinf) = [];
LfM (Iinf-1) = []; AI (Iinf) = []; F (iinf) = [];
Lf (Iinf) = [];
% Where ' s the beef?
Jitter = ... 1/(2*PI*FC) *sqrt (2*sum (10.^ (LFM/10)). * (fm.^ (-AI/10))./(Ai/10+1) ....
* (fm.^ (ai/10+1)-fm.^ (ai/10+1)));
Else disp (' > > oops! '); Disp (' > > > The f&lf vector lengths is unequal.
Where ' s the data? ')
jitter = sqrt (sqrt (-12446784));
End% if L TOC