資源描述:
《頻率采樣法設(shè)計(jì)帶通濾波器matlab》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在行業(yè)資料-天天文庫(kù)。
1、以MATLAB用頻率采樣法設(shè)計(jì)一帶通數(shù)字濾波器。低通帶邊緣:w1p=0.2*pi,低阻帶邊緣:w1s=0.35*pi,高通帶邊緣w2p=0.65*pi,高阻帶邊緣w2s=0.8*pi;設(shè)計(jì)過渡帶中的頻率樣本值為T1=0.109021,T2=0.59417456%wp1=0.45*pi;wp2=0.65*pi;ws1=0.3*pi;ws2=0.75*pi;Rp=1;Rs=40%=============雙線型變換法=========================================wp1=0.45*pi;wp2=0.65*pi;ws1=0.3*pi;ws2=0.
2、75*pi;Rp=1;Rs=40;Wp1=tan(wp1/2);Wp2=tan(wp2/2);Ws1=tan(ws1/2);Ws2=tan(ws2/2);BW=Wp2-Wp1;W0=Wp1*Wp2;W00=sqrt(W0);WP=1;WS=WP*(W0^2-Ws1^2)/(Ws1*BW);[N,Wn]=cheb1ord(WP,WS,Rp,Rs,'s');[B,A]=cheby1(N,Rp,Wn,'s');[BT,AT]=lp2bp(B,A,W00,BW);[num,den]=bilinear(BT,AT,0.5);[h,omega]=freqz(num,den,64);su
3、bplot(2,2,1);stem(omega/pi,abs(h));xlabel('omega/pi');ylabel('
4、H(z)
5、');subplot(2,2,2);stem(omega/pi,20*log10(abs(h)));xlabel('omega/pi');ylabel('增益.dB');%=============直接法=================================wp1=0.45*pi;wp2=0.65*pi;ws1=0.3*pi;ws2=0.75*pi;Rp=1;Rs=40;Wp=[wp1/pi,wp2/pi];Ws=[ws
6、1/pi,ws2/pi];[N,Wn]=cheb1ord(Wp,Ws,Rp,Rs);[B,A]=cheby1(N,Rp,Wn);[h,omega]=freqz(B,A,64);subplot(2,2,3);stem(omega/pi,abs(h));xlabel('omega/pi');ylabel('
7、H(z)
8、');subplot(2,2,4);stem(omega/pi,20*log10(abs(h)));xlabel('omega/pi');ylabel('增益.dB');%cheby2%%wp1=0.45*pi;wp2=0.65*pi;ws1=0.3*pi
9、;ws2=0.75*pi;Rp=1;Rs=40%=============雙線型變換法=========================================wp1=0.45*pi;wp2=0.65*pi;ws1=0.3*pi;ws2=0.75*pi;Rp=1;Rs=40;Wp1=tan(wp1/2);Wp2=tan(wp2/2);Ws1=tan(ws1/2);Ws2=tan(ws2/2);BW=Wp2-Wp1;W0=Wp1*Wp2;W00=sqrt(W0);WP=1;WS=WP*(W0^2-Ws1^2)/(Ws1*BW);[N,Wn]=cheb2ord(WP,W
10、S,Rp,Rs,'s');[B,A]=cheby2(N,Rs,Wn,'s');[BT,AT]=lp2bp(B,A,W00,BW);[num,den]=bilinear(BT,AT,0.5);[h,omega]=freqz(num,den,64);subplot(2,2,1);stem(omega/pi,abs(h));xlabel('omega/pi');ylabel('
11、H(z)
12、');subplot(2,2,2);stem(omega/pi,20*log10(abs(h)));axis([01-1000]);xlabel('omega/pi');ylabel('
13、增益.dB');%=============直接法=================================wp1=0.45*pi;wp2=0.65*pi;ws1=0.3*pi;ws2=0.75*pi;Rp=1;Rs=40;Wp=[wp1/pi,wp2/pi];Ws=[ws1/pi,ws2/pi];[N,Wn]=cheb2ord(Wp,Ws,Rp,Rs);[B,A]=cheby2(N,Rs,Wn);[h,omega]=freqz(B,A,64);subplot(2,2,3);stem(omega/pi,ab