[y,fs]=wavread( wangwei.wav');
sound(y,fs)
n=length(y)
y_ p=fft(y,n);
f=fs*(0:n/2-1)/n;
figure(1)
subplot(2,1,1); .
plot(y);
title(|原始語音信號采樣后的時域波形);
xlabel(點數)
ylabe|('幅值A')
subplot(2,1,2); .
plot(f,abs(y_ p(1:/));
title("原始語音信號采樣后的頻譜圖);
xlabel(點數);
ylabel('頻率幅值);
L=length(y)
noise=0.1*randn(L,2);
y_ z=y+noise;
sound(y_ z,fs)
n=length(y); .
y_ zp=ft(y z,n);
f=fs*(0:n/2-1)/n; .
figure(2)
subplot(2,1,1); .
plot(y_ _z);
title("加噪語音信號時域波形);
xlabel(點數)
ylabel('幅值A')
subplot(2,1,2);
plot(f,abs(y_ zp(1:n/));
title("加噪語音信號頻譜圖);
xlabel(' 點數');
ylabel('頻率幅值);
fp=600;fs=800;Fs=44100;
rp=1;rs=10;
wp=2*pi*fp/Fs;
ws=2*pit*fs/Fs;
Fs1=1;
wap=2*tan(wp/2);
was=2*tan(ws/2);
[N,wc]=buttord(wap,was,rp,rs);
[B,A]=butter(N,wc);[Bz,Az]=bilinear(B,A.,Fs1);
figure(3);
[h,w]=freqz(Bz,Az,512,Fs1*44100);
plot(w,abs(h));
title(巴特沃斯低通濾波器");
xlabel(頻率(HZ) );ylabel(耗損 (dB) );grid on;
yd=filter(Bz,Az,y_ z);
ydd=fft(yd,n);
f=fs*(0:n/2-1)/n;
figure(4);
subplot(2,1,1 );plot(yd);
title("濾波后信號時域波形);
xlabel(點數')
ylabel("幅值A')
subplot(2,1,2); .
plot(f,abs(ydd(1:n/));
title(濾波后信號頻譜' );
xlabel("點數');
ylabel(' 頻率幅值);
sound(yd,Fs);
想請教一下哪里出了問題
,濾出的波形好像不對

轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/81368.html
標籤:疑難問題
上一篇:關于c的檔案用法
下一篇:急!!求大神
