資源簡介
音頻信號濾除噪聲,恢復原信號。。。。。。。。。。。。。。。。。。。
代碼片段和文件信息
clc;
clear;
%?------------讀入音頻-------------
[bach0fs]=audioread(‘D:\信號實習\bach.mp3‘);
bach=bach0(:1);%采集第一通道
figure(1)
subplot(321)
plot(bach)
title(‘音頻時域圖‘)
%?-----------------頻域分析---------------
N=length(bach);
t=(0:1:N-1)/fs;
f=(-N/2:1:N/2-1)*fs/N;
BACH=fft(bach)/fs;
o=fftshift(BACH);
subplot(322)
plot(fabs(o));
title(‘音頻頻譜‘)
%-------------加噪聲----------------------
noise=0.1*sin(2*pi*5000*t)‘;
subplot(323)
plot(noise);
Bach=bach+noise;
subplot(324)
plot(Bach);
title(‘加噪聲音頻時域圖‘)
%?--------------------------------
BACH1=fft(Bach)/fs;
o1=fftshift(BACH1);
subplot(325)
plot(fabs(o1));
title(‘加噪聲音頻頻譜‘)
%?--------------------------------
%?------------------------
lfp=4500;lfs=5000;
wp=2*pi*lfp/fs;ws=2*pi*lfs/fs;
評論
共有 條評論