|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
% EE 536: Phase-Locked Loops
%
% Matlab code for estimating total PLL phase noise
% Thanks to Aniruddhan Sankaran for providing the basis for this code
%
function Phase_Noise(PN_pcl, PN_vco, PN_div)
%
% PN_div - divider phase noise profile (from Cadence)
% PN_pcl - PFD/CP/LPF amplitude noise profile (from Cadence)
% PN_vco - VCO phase noise profile (from Cadence)
%
fstart=10e3; % starting at 10kHz
fstep=10e3; % freq step is 10kHz
fstop=10e6; % stop freq is 10MHz
f=fstart:fstep:fstop; % generate frequency vector
w=2*pi*f;
%%%% PLL Specification %%%%
%
% You will have to change these values to match those of your PLL
% You will need to change F, the loop filter transfer function to match
% that of your chosen loopfilter, right now it is configured with the
% "stock" loop filter values.
%
N=195; % nominal division ratio
N_pre=2; % prescaler division ratio
Kvco=2*pi*55.6e6; % VCO gain
Icp=100e-6; % charge pump current = 100 uA
Kpd=Icp/(2*pi); % phase detector gain
R=156e3; % resistor value
C=2.9e-12; % capacitor value
F = R + 1./(j*w*C); % loop filter transfer function
%%%% Calculate the Loop Transfer Functions
A = Kpd*F*Kvco./(j*w); % forward gain
B = 1/N; % feedback gain
H = A./(1+A*B); % closed-loop TF
E = H.*j.*w./(Kpd*Kvco*F); % error TF
figure;
semilogx(f,20*log10(abs(H))); % plot closed-loop TF
title('Closed-Loop Transfer Function');
grid ON;
figure;
semilogx(f,20*log10(abs(E))); % plot error TF
title('Error Transfer Function');
grid ON;
%%%% Reference phase noise
PN_ref = -150 - 3*log10(f/1000); % reference phase noise specified in dB
PN_out_ref = PN_ref + 20*log10(abs(H)); % output phase noise due to reference
%%%% Divider phase noise
PN_out_div = PN_div' + 20*log10(abs(H)); % output phase noise due to divider
%%%% PFD-CP-LPF combination phase noise
PN_out_pcl = PN_pcl' + 20*log10(abs(H./(Kpd*f))); % output phase noise due to PFD-CP-LPF
%%%% VCO phase noise
PN_out_vco = PN_vco' + 20*log10(abs(E)); % output phase noise due to VCO
%%%% Total output phase noise
PN_out = 10*log10(10.^(PN_out_ref/10)+10.^(PN_out_div/10)+10.^(PN_out_pcl/10)+10.^(PN_out_vco/10));
figure;
grid ON;
semilogx(f,PN_out_ref, f,PN_out_div, f,PN_out_pcl, f,PN_out_vco, f,PN_out);
title('Output Phase Noise');
xlabel('Freq (Hz)');
ylabel('Phase Noise (dB)');
text(1e4,-130, ['Phase noise at 10 kHz = ',num2str(PN_out(1))]); % Print phase noise totals
text(1e4,-140, ['Phase noise at 500 kHz = ',num2str(PN_out(100))]); % You may need to adjust the
text(1e4,-150, ['Phase noise at 10 MHz = ',num2str(PN_out(2000))]); % positioning on these.
axis([min(f),max(f),min(PN_out),max(PN_out)]);
axis 'auto y';
Phase_Noise.tar
(4.5 KB, 下载次数: 89 )
Simulink Demo-1.tar
(637.5 KB, 下载次数: 90 )
|
|