📄 c6_pllpre.m
字号:
% File : c6_PLLpre.m
clear all % be safe
disp(' ') % insert blank line
fdel = input('Enter the size of the frequency step in Hertz > ');
fn = input('Enter the loop natrual 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; % number of simulation points
t = (0:(npts-1))/fs; % default tiem vector
nsettle = fix(npts/10); % set nsettle time as 0.1*npts
tsettle = nsettle/fs; % set tsettle
% The next two lines establish the loop input frequency and phase
% diviations.
fin = [zeros(1,nsettle),fdel*ones(1,npts-nsettle)];
phin = [zeros(1,nsettle),2*pi*fdel*t(1:(npts-nsettle))];
disp(' ') % insert blank line
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -