长安大学 数字信号处理课设(4)

2019-04-21 17:52

clear;close all

[z1,fs,bits]=wavread('F:\\wqk.wav') y1=z1(1:8192); Y1=fft(y1);

fs=8000;f=[2800,3000]; m=[0,1]; rp=1;rs=100;

dat1=(10^(rp/20)-1)/(10^(rp/20)+1);dat2=10^(-rs/20); rip=[dat2,dat1];

[M,fo,mo,w]=remezord(f,m,rip,fs); hn=remez(M,fo,mo,w); figure(1); freqz(hn);

x=filter(hn,1,y1); X=fft(x,8192); figure(2);

subplot(2,2,1);plot(abs(Y1));axis([0,4000,0,1.0]); title('滤波前信号频谱');

subplot(2,2,2);plot(abs(X));axis([0,4000,0,0.03]); title('滤波后信号频谱'); subplot(2,2,3);plot(z1); title('滤波前信号波形'); subplot(2,2,4);plot(x); title('滤波后信号波形'); sound(x,fs,bits); 图形:

(3)带通滤波器 程序:

clear;close all

[z1,fs,bits]=wavread('F:\\wqk.wav')

y1=z1(1:8192);

Y1=fft(y1);

fs=8000;f=[1000,1200,3000,3200]; m=[0,1,0]; rp=1;rs=100;

dat1=(10^(rp/20)-1)/(10^(rp/20)+1);dat2=10^(-rs/20); rip=[dat2,dat1,dat2];

[M,fo,mo,w]=remezord(f,m,rip,fs); hn=remez(M,fo,mo,w); figure(1); freqz(hn);

x=filter(hn,1,y1); X=fft(x,8192); figure(2);

subplot(2,2,1);plot(abs(Y1));axis([0,4000,0,1.0]); title('滤波前信号频谱');

subplot(2,2,2);plot(abs(X));axis([0,4000,0,0.03]); title('滤波后信号频谱'); subplot(2,2,3);plot(z1); title('滤波前信号波形'); subplot(2,2,4);plot(x); title('滤波后信号波形'); sound(x,fs,bits); 图形:

(4)双线性变换法设计低通滤波器 选用butter 程序设计如下: clear;close all

[z1,fs,bits]=wavread('F:\\wqk.wav') y1=z1(1:8192); Y1=fft(y1);

fp=1000;fc=1200;As=100;Ap=1;Fs=8000; wc=2*fc/Fs; wp=2*fp/Fs; [N,ws]=buttord(wc,wp,Ap,As); [b,a]=butter(N,ws); figure(1);

freqz(b,a,512,Fs); x=filter(b,a,z1); X=fft(x,8192); figure(2);

subplot(2,2,1);plot(abs(Y1));axis([0,4000,0,1.0]); title('滤波前信号频谱');

subplot(2,2,2);plot(abs(X));axis([0,4000,0,1.0]); title('滤波后信号频谱'); subplot(2,2,3);plot(z1); title('滤波前信号波形'); subplot(2,2,4);plot(x); title('滤波后信号波形'); sound(x,fs,bits); 图如下:


长安大学 数字信号处理课设(4).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:饲料鉴定完整版

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: