%用MATLAB对原始语音信号进行分析,画出它的时域波形和频谱fs=22050;x1=wavread('C:\DocumentsandSettings\Administrator\桌面\1.wav');sound(x1,22050);%播放语音信号y1=fft(x1,1024);%对信号做1024点FFT变换f=fs*(0:511)/1024;figure(1)plot(x1)%做原始语音信号的时域图形title('原始语音信号');xlabel('timen');ylabel('fuzhin');figure(2)freqz(x1)%绘制原始语音信号的频率响应图title('频率响应图')figure(3)subplot(2,1,1);plot(abs(y1(1:512)))%做原始语音信号的FFT频谱图title('原始语音信号FFT频谱')subplot(2,1,2);plot(f,abs(y1(1:512)));title('原始语音信号频谱')xlabel('Hz');ylabel('幅值');%给原始的语音信号加上一个高频余弦噪声,频率为(5—6Khz任选)。对加噪后的语音进行分析,并画出其信号时域和频谱图。fs=22050;x1=wavread('C:\DocumentsandSettings\Administrator\桌面\1.wav');f=fs*(0:511)/1024;t=0:1/fs:(length(x1)-1)/fs;Au=0.03;d=[Au*cos(2*pi*5000*t)]';x2=x1+d;sound(x2,22050);wavwrite(x2,8000,16,'C:\DocumentsandSettings\Administrator\桌面\2.wav');y2=fft(x2,1024);figure(4);plot(t,x2)title('加噪后的信号');xlabel('timen');ylabel('fuzhin');figure(5)subplot(2,1,1);plot(f,abs(y1(1:512)));title('原始语音信号频谱');xlabel('Hz');ylabel('fuzhi');subplot(2,1,2);plot(f,abs(y2(1:512)));title('加噪后的信号频谱');xlabel('Hz');ylabel('fuzhi');