您好,欢迎访问三七文档
当前位置:首页 > 行业资料 > 其它行业文档 > matlab声音信号频谱分析的课程设计
原语音信号[y,fs,bits]=wavread('C:\Users\Administrator\Desktop\111.wav');sound(y,fs,bits);n=length(y)n=92611Y=fft(y,n);subplot(2,1,1);plot(y);subplot(2,1,2);plot(abs(Y));加噪声[y,fs,bits]=wavread('C:\Users\Administrator\Desktop\111.wav');sound(y,fs,bits);n=length(y)n=92611Noise=0.2*randn(n,2);s=y+Noise;sound(s)subplot(2,1,1);plot(s)S=fft(s);subplot(2,1,2);plot(abs(S))title('加噪语音信号的频谱波形')FIR低通滤波器fp=1000;fc=1200;As=100;Ap=1;fs=30000;wc=2*fc/fs;wp=2*fp/fs;N=ceil((As-7.95)/(14.36*(wc-wp)/2))+1;beta=0.1102*(As-8.7);Win=Kaiser(N+1,beta);b=fir1(N,wc,Win);freqz(b,1,512,fs);s_low=filter(b,1,s);plot(s_low);title('信号经过低通滤波器的时域图')S_low=fft(s_low,n);plot(abs(S_low));title('信号经过低通滤波的频谱')sound(s_low,fs,bits)IIR低通滤波fp=1000;fc=1200;As=100;Ap=1;fs=30000;wc=2*fc/fs;wp=2*fp/fs;[n,wn]=ellipord(wp,wc,Ap,As);[b,a]=ellip(n,Ap,As,wn);freqz(b,a,512,fs);t=filter(b,a,y);T=fft(t,n);subplot(2,1,1);plot(t)subplot(2,1,2);plot(abs(T));title('滤波后的频谱')sound(t,fs,bits)
本文标题:matlab声音信号频谱分析的课程设计
链接地址:https://www.777doc.com/doc-3175638 .html