IIR数字滤波器设计及软件实现1.docx

上传人:b****8 文档编号:8942855 上传时间:2023-05-16 格式:DOCX 页数:19 大小:191.67KB
下载 相关 举报
IIR数字滤波器设计及软件实现1.docx_第1页
第1页 / 共19页
IIR数字滤波器设计及软件实现1.docx_第2页
第2页 / 共19页
IIR数字滤波器设计及软件实现1.docx_第3页
第3页 / 共19页
IIR数字滤波器设计及软件实现1.docx_第4页
第4页 / 共19页
IIR数字滤波器设计及软件实现1.docx_第5页
第5页 / 共19页
IIR数字滤波器设计及软件实现1.docx_第6页
第6页 / 共19页
IIR数字滤波器设计及软件实现1.docx_第7页
第7页 / 共19页
IIR数字滤波器设计及软件实现1.docx_第8页
第8页 / 共19页
IIR数字滤波器设计及软件实现1.docx_第9页
第9页 / 共19页
IIR数字滤波器设计及软件实现1.docx_第10页
第10页 / 共19页
IIR数字滤波器设计及软件实现1.docx_第11页
第11页 / 共19页
IIR数字滤波器设计及软件实现1.docx_第12页
第12页 / 共19页
IIR数字滤波器设计及软件实现1.docx_第13页
第13页 / 共19页
IIR数字滤波器设计及软件实现1.docx_第14页
第14页 / 共19页
IIR数字滤波器设计及软件实现1.docx_第15页
第15页 / 共19页
IIR数字滤波器设计及软件实现1.docx_第16页
第16页 / 共19页
IIR数字滤波器设计及软件实现1.docx_第17页
第17页 / 共19页
IIR数字滤波器设计及软件实现1.docx_第18页
第18页 / 共19页
IIR数字滤波器设计及软件实现1.docx_第19页
第19页 / 共19页
亲,该文档总共19页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

IIR数字滤波器设计及软件实现1.docx

《IIR数字滤波器设计及软件实现1.docx》由会员分享,可在线阅读,更多相关《IIR数字滤波器设计及软件实现1.docx(19页珍藏版)》请在冰点文库上搜索。

IIR数字滤波器设计及软件实现1.docx

IIR数字滤波器设计及软件实现1

实验四

functionst=mstg

N=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);

subplot(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=mstg1

N=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;

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(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]=ellipord(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)');ylabel('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);

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(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,wpo]=ellipord(wp,ws,Rp,As);

[B,A]=ellip(N,Rp,As,wpo,'high');

y3t=filter(B,A,st);

figure(4)

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(y3t)-1;t=n*T;

plot(t,y3t);

xlabel('t(s)');ylabel('y3(t)');

title('高通滤波器分离出的信号y3(t)');

axis([00.08-1.51.5]);

Fs=10000;T=1/Fs;

st=mstg1;

fp=280;fs=450;

wp=2*fp/Fs;ws=2*fs/Fs;Rp=0.1;As=60;

[N,wpo]=ellipord(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)');ylabel('y1(t)');

title('低通滤波器分离出的信号y1(t)');

axis([00.08-33]);

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);

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(y2t)-1;t=n*T;

plot(t,y2t);

xlabel('t(s)');ylabel('y2(t)');

title('带通滤波器分离出的信号y2(t)');

axis([00.08-33]);

fp=890;fs=600;

wp=2*fp/Fs;ws=2*fs/Fs;Rp=0.1;As=60;

[N,wpo]=ellipord(wp,ws,Rp,As);

[B,A]=ellip(N,Rp,As,wpo,'high');

y3t=filter(B,A,st);

figure(4)

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(y3t)-1;t=n*T;

plot(t,y3t);

xlabel('t(s)');ylabel('y3(t)');

title('高通滤波器分离出的信号y3(t)');

axis([00.08-33]);

 

 

改的

Fs=10000;T=1/Fs;

st=mstg1;

fp=280;fs=450;

wp=2*fp/Fs;ws=2*fs/Fs;Rp=0.1;As=60;

[N,wpo]=ellipord(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)');ylabel('y1(t)');

title('低通滤波器分离出的信号y1(t)');

axis([00.08-55]);

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);

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(y2t)-1;t=n*T;

plot(t,y2t);

xlabel('t(s)');ylabel('y2(t)');

title('带通滤波器分离出的信号y2(t)');

axis([00.08-55]);

fp=890;fs=600;

wp=2*fp/Fs;ws=2*fs/Fs;Rp=0.1;As=60;

[N,wpo]=ellipord(wp,ws,Rp,As);

[B,A]=ellip(N,Rp,As,wpo,'high');

y3t=filter(B,A,st);

figure(4)

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(y3t)-1;t=n*T;

plot(t,y3t);

xlabel('t(s)');ylabel('y3(t)');

title('高通滤波器分离出的信号y3(t)');

axis([00.08-55]);

 

functionst=mstg1

N=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;

fo1=fc1/10;

fc2=Fs/20;

fo2=fc2/10;

fc3=Fs/40;

fo3=fc3/10;

xt1=(3+2*cos(2*pi*fo1*t)).*cos(2*pi*fc1*t);

xt2=(3+2*cos(2*pi*fo2*t)).*cos(2*pi*fc2*t);

xt3=(3+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(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('幅度');

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 经管营销 > 经济市场

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2