?? lp_butt_digital.m
字號:
% Name:lp_butt_digital
% This program is used to design a butterworth lowpass digital filter
% The specifications are:
% wp:The passband cutoff frequency in radians/second
% ws:The stopband cutoff frequency in radians/second
% ap:The passband attenuation in dB
% as:The stopband attenuation in dB
%=====================================================================
% The specifications
wp=0.2*pi;
ws=0.3*pi;
ap=1;
as=15;
%=====================================================================
% Design the digital filter and plot the frequency response curves
[N,wn]=buttord(wp/pi,ws/pi,ap,as);
[b,a]=butter(N,wn);
[H,w]=freqz(b,a);
subplot(211)
plot(w/pi,abs(H));axis([0,1,0,1.1])
grid on,title('The magnitude response of digital lowpass filter')
ylabel('Magnitude')
subplot(212)
plot(w/pi,20*log(abs(H)))
grid on
axis([0,1,-40,0])
ylabel('Magnitude in dB')
xlabel('Frequency (pi)')
[k,bi,ai]=dir2par(b,a)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -