?? elliptic_an.m
字號:
% Name: ellip_design_an
% This program is used to design the elliptic lowpass filter
% The specifications of the filter are:
% Rp: The maximal passband attenuation in dB
% Rs: The minimum stopband attenuation in dB
% wp: The passband cutoff frequency
% ws: The stopband cutoff frequency
% N: The order of the lowpass filter
clear,close all,
format short
Rp=0.3;%input('Type in the data ap=:');
Rs=25;%input('Type in the data as=:');
Wp=500*2*pi;
Ws=600*2*pi;
%==========================================================================
%===========================================================================
wn=Wp/(2*pi);
[N, Wn] = ELLIPORD(Wp, Ws, Rp, Rs, 's')
N
[z,p,k] = ELLIPAP(N,Rp,Rs);
[b,a]=zp2tf(z,p,k);
%==========================================================================
ba=b;aa=a;
for m=1:N;
aa(m+1)=a(m+1)*Wp^(m);
ba(m+1)=b(m+1)*Wp^(m);
end
ba;
aa;
%==========================================================================
[h,w]=freqs(ba,aa);
subplot(211)
plot(w/(2*pi),abs(h))
axis([0,2000,0,1.2])
grid on,title('The frequency response of 5-th order Elliptic lowpass filter')
xlabel('Frequency f in Hz')
subplot(223)
impulse(ba,aa)
subplot(224)
step(ba,aa)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -