📄 lp_cheby_digital.m
字号:
% Name:lp_cheby_digital
%====================================================================
% This program is used to
% design a type 1 chebyshev 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]=cheb1ord(wp/pi,ws/pi,ap,as);
[b,a]=cheby1(N,ap,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,-60,0])
ylabel('Magnitude in dB')
xlabel('Frequency (pi)')
[k,bi,ai]=dir2par(b,a);
%=================================================================
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -