wp=0.2*pi;ws=0.6*pi;rp=3;rs=40;
Omgp=tan(wp/2)
Omgs=tan(ws/2)
Fs=0.5;
[N,wo]=cheb1ord(Omgp,Omgs,rp,rs,'s')
[b,a]=cheby1(N,rp,wo,'s')
[Ha,Omg]=freqs(b,a);
dbHa=20*log((abs(Ha)+eps)/max(abs(Ha)));
[bd,ad]=bilinear(b,a,0.5);
[H,w]=freqz(bd,ad);
dbH=20*log10(abs(H)/max(abs(H)));
subplot(3,2,1),plot(Omg*Omgp/2/pi,dbHa),grid
title('a 模拟幅度响应(dB)');ylabel('幅度/dB');xlabel('f/Hz');
subplot(3,2,2),plot(w/pi,abs(H))
title('b 幅度响应');axis([0,1,0,1]);
subplot(3,2,3),plot(w/pi,dbH),grid
title('c 幅度响应(dB)');axis([0,1,-300,100]);
subplot(3,2,4),plot(w/pi,dbH),grid
title('d 幅度响应(dB)');axis([0,0.7,-60,5]);
subplot(3,2,5),plot(w/pi,angle(H)/pi)
title('e 相位响应');axis([0,1,-1,1]);
subplot(3,2,6),zplane(bd,ad)
title('f 零极图');axis([-1.1,1.1,-1.1,1.1]);
Omgp =
0.3249
Omgs =
1.3764
N =
3
wo =
0.3249
b =
0 0 0 0.0086
a =
1.0000 0.1941 0.0980 0.0086