IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 人工智能 -> 根据PLL相噪测试曲线计算jitter的Matlab程序 -> 正文阅读

[人工智能]根据PLL相噪测试曲线计算jitter的Matlab程序

最近在测试,没有相噪仪,频谱仪只能测出相噪数据,无法得到jitter数据,所以就自己写了一个Matlab程序计算。
计算方法是按照ADI工程师Walt Kester的Converting Oscillator Phase Noise to Time Jitter写的。(pdf我放在超链接里啦,有需要自取)

下面是我写的简单粗暴版的Matlab程序:

[SSPLL_8G_pn] = xlsread('D:\Matlab\Phasenoise.xlsx');     % measured phase noise data
SSPLL_PN = SSPLL_8G_pn(:,2);
freq = SSPLL_8G_pn(:,1);

% f=1e8;
fc=8e9;
n = length(SSPLL_PN);
SSPLL_PN_value = zeros(1,n);
rms_jitter = zeros(1,n);
A = zeros(1,n);

SSPLL_PN_value = 10.^(SSPLL_PN./20);

for i = 1:n-1;
    A(i) = (freq(i+1)- freq(i))*(SSPLL_PN_value(i+1)+SSPLL_PN_value(i))/2;
end

A_all = 10*log10(sum (A(:)));

rms_jitter=sqrt(2*10^(A_all/10))/(2*pi*fc);

然后在网上找资料的过程中,看到Matlab网站上也有一个Phase noise转jitter的Matlab功能函数,需要使用的时候调用一下就可以了很方便。也搬运过来,放到下面,大家可以自己选择用哪个:

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.320ps
%        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"
%        http://fordahl.com/images/phasenoise.pdf
%         As of 11 May 2007 it also appears here:
%          http://www.metatech.com.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 2008
%
%  [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
%       Comparing 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 restricted to f(min) = 10Hz;
%                  therefore it cannot be 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 note{$} calculations at fc = 100MHz
%        Pn2Jitter.m: 0.064346ps
%        MT-008:      0.064ps
%        JitterTime:  0.065ps
%
% Note:
%   f and Lf must be the same length, lest you get an error and this
%         Improbable Result:  Jitter = 42 + 42i.
%
%  (A spreadsheet, noise.xls, is available from Wenzel Associates, Inc. at 
%   http://www.wenzel.com, "Allan Variance from 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 be imported directly from an Aeroflex PN9000 ASCII
%         file, after removing extraneous text.  How to do it:
%        (1) In Excel, import the PN9000 data file as Tab-delimited data,
%        (2) Remove superfluous columns 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
%             is to be removed, and there are only two columns.
%             I may take advantage of this in an updated version of this
%              program,thereby eliminating the need to edit the data),
%        (3) Save As -> Text (MS-DOS) (*.txt), e.g., a:\Stuff.txt, 
%        (4) At the MATLAB Command Window prompt:
%             >> load 'a:\Stuff.txt' -ascii
%            Now Stuff is a MATLAB workspace variable with the
%             phase noise data, 
%        (5) >> Pn2Jitter(Stuff(:,1), Stuff(:,2), fc);
%              (assuming fc has been defined)
%       One 10MHz carrier data set resulted in the following:
%        Pn2Jitter.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 13 May 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 code 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 be 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 of realmin (2.2251e-308)
%  and realmax (1.7977e+308); no demonstrable effect on jitter calculation
% AB 18May2005 Fix /0 bug 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
%%  It's almost nine o'clock.  We've got to go to 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 are unequal.  Where''s the data?')
    Jitter = sqrt(sqrt(-12446784));
end % if L
toc
  人工智能 最新文章
2022吴恩达机器学习课程——第二课(神经网
第十五章 规则学习
FixMatch: Simplifying Semi-Supervised Le
数据挖掘Java——Kmeans算法的实现
大脑皮层的分割方法
【翻译】GPT-3是如何工作的
论文笔记:TEACHTEXT: CrossModal Generaliz
python从零学(六)
详解Python 3.x 导入(import)
【答读者问27】backtrader不支持最新版本的
上一篇文章      下一篇文章      查看所有文章
加:2021-10-25 12:32:33  更:2021-10-25 12:34:50 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年11日历 -2024/11/27 8:39:21-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码