這是Chebyshev-I型濾波器設計方法,你可以在此基礎上進行修改。fp=[300400];fs=[200500];rp=3;rs=18;Fs=2000;%模擬技術指標wp=fp*2*pi/Fs;ws=fs*2*pi/Fs;%數字技術指標%模擬低通原型濾波器設計wap=2*Fs*tan(wp./2);was=2*Fs*tan(ws./2);%預畸變[n,wn]=cheb1ord(wap,was,rp,rs,"s");[z,p,k]=cheb1ap(n,rp);[bp,ap]=zp2tf(z,p,k);[h1,w1]=freqs(bp,ap);Subplot(411);plot(w1,abs(h1));grid;title("lowpassG(p)")%模擬低通原型->模擬帶通濾波器bw=wap(2)-wap(1);w0=sqrt(wap(1)*wap(2));[bs,as]=lp2bp(bp,ap,w0,bw);w2=0:pi:4000*pi;h2=freqs(bs,as,w2);Subplot(412);plot(w2/2/pi,20*log10(abs(h2)));grid;title("bandpassH(p)")%雙線性變換法設計數字濾波器%Note:s=(2/T)(z-1)/(z+1);T=1,thatis2Fs=1,Fs=0.5;[bz1,az1]=bilinear(bs,as,Fs);[h3,w3]=freqz(bz1,az1,1024,Fs);Subplot(413);plot(w3,20*log10(abs(h3)));grid;title("bandpassDFH1(z)");%DirectlytodesignH(z)bybutter.m[n,wn]=cheb1ord(wp/pi,ws/pi,rp,rs);[bz2,az2]=cheby1(n,rp,wp/pi,"bandpass");[h4,w4]=freqz(bz2,az2,1024,Fs);Subplot(414);plot(w4,20*log10(abs(h4)));grid;title("BandpassDFH2(z)");
這是Chebyshev-I型濾波器設計方法,你可以在此基礎上進行修改。fp=[300400];fs=[200500];rp=3;rs=18;Fs=2000;%模擬技術指標wp=fp*2*pi/Fs;ws=fs*2*pi/Fs;%數字技術指標%模擬低通原型濾波器設計wap=2*Fs*tan(wp./2);was=2*Fs*tan(ws./2);%預畸變[n,wn]=cheb1ord(wap,was,rp,rs,"s");[z,p,k]=cheb1ap(n,rp);[bp,ap]=zp2tf(z,p,k);[h1,w1]=freqs(bp,ap);Subplot(411);plot(w1,abs(h1));grid;title("lowpassG(p)")%模擬低通原型->模擬帶通濾波器bw=wap(2)-wap(1);w0=sqrt(wap(1)*wap(2));[bs,as]=lp2bp(bp,ap,w0,bw);w2=0:pi:4000*pi;h2=freqs(bs,as,w2);Subplot(412);plot(w2/2/pi,20*log10(abs(h2)));grid;title("bandpassH(p)")%雙線性變換法設計數字濾波器%Note:s=(2/T)(z-1)/(z+1);T=1,thatis2Fs=1,Fs=0.5;[bz1,az1]=bilinear(bs,as,Fs);[h3,w3]=freqz(bz1,az1,1024,Fs);Subplot(413);plot(w3,20*log10(abs(h3)));grid;title("bandpassDFH1(z)");%DirectlytodesignH(z)bybutter.m[n,wn]=cheb1ord(wp/pi,ws/pi,rp,rs);[bz2,az2]=cheby1(n,rp,wp/pi,"bandpass");[h4,w4]=freqz(bz2,az2,1024,Fs);Subplot(414);plot(w4,20*log10(abs(h4)));grid;title("BandpassDFH2(z)");