?? cheby_digital.m
字號:
% Name:cheby_digital.m
%====================================================================
% 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.4*pi;
ap=1;
as=30;
%=====================================================================
% Design the digital filter and plot the frequency response curves
[N,wn]=cheb1ord(wp/pi,ws/pi,ap,as);
fprintf('\n***The coefficient vector of IIR digital filter in direct form are %2.0f\n');
[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)')
fprintf('\n***The coefficient vector of IIR digital filter in parallel form are %2.0f\n');
[k,bi,ai]=dir2par(b,a)
%=================================================================
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -