在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 6205|回复: 12

[讨论] PLL相位噪声拟合问题

[复制链接]
发表于 2018-6-27 14:43:20 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
现在有拟合程序,而且各部分的相位噪声数据也得到了,我得到的是.CSV形式的文件。我遇到的问题是怎么通过这个程序把相位噪声拟合起来,在MATLAB中怎样把这三个部分的数据加进来啊,对MATLAB不是很懂,求大神帮忙了。
Matlab Code for the phase Noise:
% Matlab code for estimating total PLL phase noise
function Phase_Noise(PN_pcl, PN_vco)
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)
clear;
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 also need to change F, the loop filter transfer function
% to match that of your chosen loopfilter. The current loop filter
% configuration is the simply (R + 1/sC1) || 1/sC2
%
N=244;
% nominal division ratio
Kvco=2*pi*221E6; % VCO gain
Icp=100E-6; % charge pump current = 100 uA
Kpd=Icp/(2*pi); % phase detector gain
R=45E3; % resistor value
C=70E-12; % capacitor value
C2=5E-12;
F1 = R + 1./(j*w*C);
% Simple RC loop filter transfer function
F2= (1./((R+1./C./(j*w)).^-1+C2.*(j*w)) ); % RC with C2 in parallel.
F3=F2.*F1; % Combination of F2 cascaded with F1.
F=F2; % You should try designing and trying different LPFs F1, F2 and F3 and

see how it affects %the loop response.
%%%% Calculate the Loop Transfer Functions
A = Kpd*F*Kvco./(j*w); % forward gain
B = 1/N; % feedback gain
G=A.*B; % loop-gain TF
H = A./(1+A*B); % closed-loop TF
E = H.*j.*w./(Kpd*Kvco*F); % error TF
%Plot the transfer functions
figure;
semilogx(f,20*log10(abs(G)));
% plot loop-gain

title('Loop-Gain Transfer Function');
grid
ON;
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 will be neglected.
%% 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_pcl/10)+10.^(PN_out_vco/10));
figure;
grid
ON;
semilogx(f,PN_out_ref, 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(1000))]);
%

positioning on these.
axis([min(f),max(f),min(PN_out),max(PN_out)]);
axis
'auto y';
legend(
'PN_o_u_t_r_e_f','PN_o_u_t_p_c_l','PN_o_u_t_v_c_o','PN_o_u_t');
 楼主| 发表于 2018-6-27 14:45:46 | 显示全部楼层
那个复制的代码可能乱码了,文件在这里

eetop.cn_PLL PN Matlab code.pdf

307.88 KB, 下载次数: 237 , 下载积分: 资产 -2 信元, 下载支出 2 信元

发表于 2018-6-28 16:53:21 | 显示全部楼层
回复 2# 梦随心行


    使用Matlab 2018版本,可以看到 命令行窗口 上面有个  导入数据 ......
试试,应该可以的
发表于 2022-6-25 18:33:25 | 显示全部楼层
谢谢分享
发表于 2022-6-25 21:55:28 | 显示全部楼层
mark
发表于 2022-7-20 10:57:52 | 显示全部楼层
谢谢分享
发表于 2022-7-20 11:30:59 | 显示全部楼层
我记得好像是有一个csvread。你去matlab官网就可以搜到这些function。还是比较容易上手的。
发表于 2022-7-20 11:33:20 | 显示全部楼层
M = csvread(filename)。把csv文件转换成matrix。然后你通过matrix再进行处理。而且注意dB和watts的转换。
发表于 2022-7-28 16:02:10 | 显示全部楼层
请问你这个问题解决了没有?是如何仿真 PFD+CP+LF的phase noise,是如何加到整体的PLL中去的。谢谢
发表于 2022-7-30 16:03:44 | 显示全部楼层


梦随心行 发表于 2018-6-27 14:45
那个复制的代码可能乱码了,文件在这里


请问这个问题解决了吗?在cadence里怎么仿真各个模块的phase noise,然后导出什么文件,如何调入matlab里呢
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /1 下一条

X

小黑屋| 手机版| 关于我们| 联系我们| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2025-5-24 04:59 , Processed in 0.031417 second(s), 8 queries , Gzip On, MemCached On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表