在Matlab和simulink中删除音频文件中的背景噪音

时间:2015-02-25 00:57:10

标签: matlab audio simulink

我的任务是要求将音频信号与噪声信号相结合,并使用数字滤波器使原始音频信号不失真。

问题是我无法获得原始音频,因为我无法估计频域中的噪声内容。我用了10阶的巴特沃斯低通滤波器的试验,试图猜测截止频率,但总是产生的文件仍然很嘈杂。

任何帮助?

以下是我的步骤:

%% Load the original audio file to matlab Workspace
test_audio ='J:\test_read.wav'; 

 %% Load the noise audio file to Matlab workspace

noise ='J:\crowd_noise.wav';
%% read the original audio file for a finite length of time

[y,Fs] = audioread(test_audio,[1 262144]);


%%read the noise audio file for a finite length of time

[x,fs]=audioread(noise,[1 262144]); 

[p,q]=rat(Fs/fs);

 %% resample the noise file with the original file's sampling rate

m=resample(x,p,q);

m=m(:,1); %% take only one channel

Y=y(1:length(m),1); %% make the 2 streams of equal lengths

u=m+Y; %% the resultant noisy signal

%% DFT of the resultant signal

N=length(u);

df = Fs / N;


w = (-(N/2):(N/2)-1).*df;

U= fft(u,N) / N; %For normalizing, but not needed for our analysis


U = fftshift(U);

figure;

plot(w,abs(U);

spectrogram(u,256,[],[],Fs);colorbar


%% DFT of the original signal

df = Fs / N;

 w = (-(N/2):(N/2)-1).*df;


k= fft(y,N) / N; %For normalizing, but not needed for our analysis

K= fftshift(k);

figure;

plot(w,abs(K);

spectrogram(y,256,[],[],Fs);colorbar


[psdy,Fyy] = periodogram(y,rectwin(length(y)),length(y),Fs);

plot(Fyy,10*log10(psdy));

grid on;

以下链接包含FFT图表和音频文件:

http://1drv.ms/1FVtpC7

提前致谢。

0 个答案:

没有答案