欢迎来到天天文库
浏览记录
ID:20547548
大小:199.73 KB
页数:4页
时间:2018-10-13
《北邮matlab实验三-数字滤波器设计》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、实验3基于MATLAB的数字滤波器设计XXXXXXXXXXX班XX号大学霸实验内容:釆用FIR数字滤波器类型,利用MATLAB编程设计一个数字带通滤波器,指标要求如下:通带边缘频率:wpl=0.45ir,wp2=0.65ir通带峰值起伏:ap2、0.75/2;Rp=l;Rs=40;»Wp=[wplwp2];Ws=[wslws2];»[N,Wn]=cheblord(Wp,Ws,Rp,Rs);»[b,a]=chebyl(N,Rp,Wn);»[H,W]=freqz(b,a);»subplot(2,l,l);»plot(W./pi.*2,20*logl0(abs(H)));titlef幅频响应');grid;axis([0.20.8-505]};»subplot(2,l,2);»plot(W./pi.*2,angle(H));title('相频响应');grid;axis([0.20.8-44]);3、FIR数字滤波器:Freqz函数定义:function[db,mag,pha,grd,w]=freqz_m(b,a);[H,w]=freqz(b,a,1000,'whole');H=(H(l:l:501))';w=(w(l:l:501))';mag=abs(H);db=20*logl0((mag+eps)/max(mag));pha=angle(H);grd=grpdelay(b,a,w);»%Bandpassfilterdesign■Blackmanwindow»wsl=0.3*pi;wpl=0.45*pi;»wp2=0.65*pi;ws2=0.74、5*pi;»Ap=l;As=40;»tr_width=min((wpl-wsl),(ws2-wp2));»N=ceil(ll*pi/tr_width)+l»n=[O:l:N];»wcl=(wsl+wpl)/2;wc2=(wp2+ws2)/2;»wn=[wcl/pi,wc2/pi];»h=firl(N,wn,blackman(N+l));»[db,mag,pha,grd,w]=freqz_m(h,[l]);»delta一w=2*pi/1000;»Rp=-min(db(wpl/delta_w+l:l:wp2/delta_w))»As=-round(max5、(db(ws2/delta_w+l:l:501)))»freqz(h,1,256);N=111Rp=0.0027As=752020{apopnlcai{seseseseud
2、0.75/2;Rp=l;Rs=40;»Wp=[wplwp2];Ws=[wslws2];»[N,Wn]=cheblord(Wp,Ws,Rp,Rs);»[b,a]=chebyl(N,Rp,Wn);»[H,W]=freqz(b,a);»subplot(2,l,l);»plot(W./pi.*2,20*logl0(abs(H)));titlef幅频响应');grid;axis([0.20.8-505]};»subplot(2,l,2);»plot(W./pi.*2,angle(H));title('相频响应');grid;axis([0.20.8-44]);
3、FIR数字滤波器:Freqz函数定义:function[db,mag,pha,grd,w]=freqz_m(b,a);[H,w]=freqz(b,a,1000,'whole');H=(H(l:l:501))';w=(w(l:l:501))';mag=abs(H);db=20*logl0((mag+eps)/max(mag));pha=angle(H);grd=grpdelay(b,a,w);»%Bandpassfilterdesign■Blackmanwindow»wsl=0.3*pi;wpl=0.45*pi;»wp2=0.65*pi;ws2=0.7
4、5*pi;»Ap=l;As=40;»tr_width=min((wpl-wsl),(ws2-wp2));»N=ceil(ll*pi/tr_width)+l»n=[O:l:N];»wcl=(wsl+wpl)/2;wc2=(wp2+ws2)/2;»wn=[wcl/pi,wc2/pi];»h=firl(N,wn,blackman(N+l));»[db,mag,pha,grd,w]=freqz_m(h,[l]);»delta一w=2*pi/1000;»Rp=-min(db(wpl/delta_w+l:l:wp2/delta_w))»As=-round(max
5、(db(ws2/delta_w+l:l:501)))»freqz(h,1,256);N=111Rp=0.0027As=752020{apopnlcai{seseseseud
此文档下载收益归作者所有