资源描述:
《iir数字滤波器设计及软件实现[1]》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、.实验四functionst=mstgN=800;Fs=10000;T=1/Fs;Tp=N*T;t=0:T:(N-1)*T;k=0:N-1;f=k/Tp;fc1=Fs/10;fm1=fc1/10;fc2=Fs/20;fm2=fc2/10;fc3=Fs/40;fm3=fc3/10;xt1=cos(2*pi*fm1*t).*cos(2*pi*fc1*t);xt2=cos(2*pi*fm2*t).*cos(2*pi*fc2*t);xt3=cos(2*pi*fm3*t).*cos(2*pi*fc3*t);st=xt1+xt2+xt3;fxt=fft(st,N);su
2、bplot(2,1,1);plot(t,st);grid;xlabel('t(s)');ylabel('s(t)');axis([0Tp/4min(st)max(st)]);title('(a)s(t)的波形');subplot(2,1,2);stem(f,abs(fxt)/max(abs(fxt)),'.');grid;title('(b)s(t)的频谱');axis([0Fs/501.2]);xlabel('f(Hz)');ylabel('幅度');...functionst=mstg1N=800;Fs=10000;T=1/Fs;Tp=N*T;t=0:T
3、:(N-1)*T;k=0:N-1;f=k/Tp;fc1=Fs/10;fo1=fc1/10;fc2=Fs/20;fo2=fc2/10;fc3=Fs/40;fo3=fc3/10;xt1=(2+cos(2*pi*fo1*t)).*cos(2*pi*fc1*t);xt2=(2+cos(2*pi*fo2*t)).*cos(2*pi*fc2*t);xt3=(2+cos(2*pi*fo3*t)).*cos(2*pi*fc3*t);st=xt1+xt2+xt3;fxt=fft(st,N);...subplot(2,1,1);plot(t,st);grid;xlabel('t
4、(s)');ylabel('s(t)');axis([0Tp/4min(st)max(st)]);title('(a)s(t)的波形');subplot(2,1,2);stem(f,abs(fxt)/max(abs(fxt)),'.');grid;title('(b)s(t)的频谱');axis([0Fs/501.2]);xlabel('f(Hz)');ylabel('幅度');...Fa=10000;T=1/Fs;st=mstg;fp=280;fs=450;wp=2*fp/Fs;ws=2*fs/Fs;Rp=0.1;As=60;[N,wpo]=ellipor
5、d(wp,ws,Rp,As);[B,A]=ellip(N,Rp,As,wpo);y1t=filter(B,A,st);figure(2)subplot(2,1,1);[H,W]=freqz(B,A,1000);k=abs(H);plot(W/pi,20*log10(k/max(k)));gridon;xlabel('w/pi');ylabel('幅度(dB)');axis([01-805]);title('损耗函数曲线');subplot(2,1,2);n=0:length(y1t)-1;t=n*T;plot(t,y1t);xlabel('t(s)');yl
6、abel('y1(t)');title('低通滤波器分离出的信号y1(t)');axis([00.08-1.51.5]);fpl=440;fpu=560;fsl=275;fsu=900;wp=[2*fpl/Fs,2*fpu/Fs];ws=[2*fsl/Fs,2*fsu/Fs];Rp=0.1;As=60;[N,wpo]=ellipord(wp,ws,Rp,As);[B,A]=ellip(N,Rp,As,wpo);y2t=filter(B,A,st);figure(3)subplot(2,1,1);[H,W]=freqz(B,A,1000);k=abs(H);p
7、lot(W/pi,20*log10(k/max(k)));gridon;xlabel('w/pi');ylabel('幅度(dB)');axis([01-805]);title('损耗函数曲线');subplot(2,1,2);n=0:length(y2t)-1;t=n*T;plot(t,y2t);xlabel('t(s)');ylabel('y2(t)');title('带通滤波器分离出的信号y2(t)');axis([00.08-1.51.5]);...fp=890;fs=600;wp=2*fp/Fs;ws=2*fs/Fs;Rp=0.1;As=60;[N
8、,wpo]=ellipord(wp,ws,Rp,As