📄 filterpll_1.m
字号:
%Fri 27 May 2005
%pll filter design and linear analysis
%run it before pll simulink run but make sure af and bf are what's needed.
%the simulink file is NoClockpll
ko=50; f0=120;
[bf,af]=butter(2,2*pi*20,'s');
if 1 > 2
w1=2*pi*30; w2=2*pi*40;
wn=2*pi*10; zeta=0.99;
af=conv(af,conv([1/w1 1],[1/w2 1]));
bf=conv(bf,[1/wn^2 2*zeta/wn 1]);
end
clsys=tf(ko*bf,[[af 0] + ko*[0 bf]]);
[ystep,tstep]=step(clsys);
figure(1);plot(tstep,ystep); grid on;
xlabel('Time (s)'); ylabel('Voltage (V)');
title('VCO Input Voltage (Linear Simulation)');
figure(2);rlocus(bf,[af 0])
figure(4);bode(clsys);
%code to plot the output from NoClockpll
if 1 > 2
%figure(3);plot(Vout.time,Vout.signals.values);grid;
figure(3);plot(Vout.time(1:1:end),Vout.signals.values(1:1:end));grid;
xlabel('Time (s)'); ylabel('Voltage (V)');
title('VCO Input Voltage - (Nonlinear Simulation)');
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -