fig5_13.m
来自「数字信号处理Matlab演示文件,其中各个文件加放置了不同的matlab子文件」· M 代码 · 共 41 行
M
41 行
echo on
% Example on 2nd order Butterworth LPF (digital & analogue)
% (phase plot)
% cut-off freq, wd = 628 rad/s
% sampling freq, ws = 5024 rad/s
echo off
% Ms Oh
% Revised BM July 98
clear
clf
colordef(1,'white')
wn=628/2512; % normalised to half ws as in
% Matlab requirement
order = 2; % filter order
% digital filter
[b,a] = butter(order,wn);
[h,w] = freqz(b,a,128); % 128 pts for curve
ph = angle(h)*180/pi;
f = 5024*w/2/pi; % normalise f scale
% analogue filter
[z,p,k]=buttap(order);
[num,den]=zp2tf(z,p,k);
[numt,dent]=lp2lp(num,den,628); % normalise to 628 rad/s
f2=0:2500/128:2500;
h2=freqs(numt,dent,f2);
ph2=angle(h2)*180/pi;
plot(f,ph,f2,ph2,':');
%axis( [ 0 2500 -180 0 ] );
xlabel('frequency (rad/s)')
ylabel('phase (degrees)')
%gtext('analogue');
%gtext('bilinear');
%print a:fig5-12.eps -deps
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?