c6_pllpre.m

来自「该程序是二阶琐相环的防震实例 仿真结果给出了二阶琐相环的相平面」· M 代码 · 共 27 行

M
27
字号
 clear all 
 disp('')
 fdel=input('Enter the size of the frequency step in Hertz > ');
 fn=input('Enter the loop natural frequency in Hertz > ');
 lambda=input('Enter lambda, the relative pole offset> ');
 disp('')
 disp('Accept default values:')
 disp('zeta=1/sqrt(2),')
 disp('fs=200*fn, and')
 disp('tstop=1')
 dtype=input('Enter y for yes or n for no > ','s');
 if dtype == 'y'
    zeta = 1/sqrt(2);
    fs = 200*fn;
    tstop=1;
 else 
     zeta = input('Enter zeta, the loop damping factor > ');
     fs = input('Enter the sampling frequency in Hertz > ');
     tstop=input('Enter tstop, the simulation runtime > ');
 end
 npts=fs*tstop+1;
 t = (0:(npts-1))/fs;
 nsettle=fix(npts/10);
 tsettle=nsettle/fs;
 fin=[zeros(1,nsettle),fdel*ones(1,npts-nsettle)];
 phin=[zeros(1,nsettle),2*pi*fdel*t(1:(npts-nsettle))];
 disp('')

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?