?? phasetrack.asv
字號:
%This program validates the tracking character of pll by%phase step signal, frequency step signal and frequency damp signal%by PLL phase modeclear all;clc;close all;fo=10000;thetao=0;fi=10000;thetai=0;dtheta=pi/2;t1=[0:0.001:2];theta=2*pi*t1;Thetai=zeros(1,length(t1));Thetao=zeros(1,length(t1));Thetai(500:1200)=Thetai(500:1200)+dtheta;%parameter of the loopT=0.001;zeta=0.7;omiga=2*pi*10;delThe(1)=0;uf(1)=0;for i=2:length(t1)-1 delThe(i)=Thetai(i)-Thetao(i); uf(i)=uf(i-1)+(2*zeta/omiga+T/2)*delThe(i)-(2*zeta/omiga-T/2)*delThe(i-1); Thetao(i+1)=Thetao(i)+omiga^2*T/2*(uf(i)+uf(i-1));endfigure;plot(t1,sin(theta+Thetai),'r-',t1,sin(theta+Thetao),'b:');legend('輸入信號','輸出信號');figure;plot(uf);title('');
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -