【发布时间】:2018-12-31 22:52:48
【问题描述】:
我在下面的链接中有一个 mp3 文件,其中有一个男人的人声和背景中的一些嗡嗡声。我想消除嗡嗡声。有谁可以告诉我如何在MATLAB中做到这一点? https://www.dropbox.com/s/h95y1oelbzvcgkc/allthatbass.mp3?dl=0
%% Read in the file
clearvars;
close all;
[f,fs] = audioread('allthatbass.mp3');
%% Play original file
pOrig = audioplayer(f,fs);
N = size(f,1);
%% Plot the spectrum
df = fs / N;
w = (-(N/2):(N/2)-1)*df;
y = fft(f(:,1), N) / N; % For normalizing, but not needed for our analysis
y2 = fftshift(y);
figure;
plot(w,abs(y2));
%% Design a bandpass filter that filters out between 700 to 12000 Hz
n = 7;
beginFreq = 700 / (fs/2);
endFreq = 12000 / (fs/2);
[b,a] = butter(n, [beginFreq, endFreq], 'bandpass');
%% Filter the signal
fOut = filter(b, a, f);
%% Construct audioplayer object and play
p = audioplayer(fOut, fs);
p.play;
我希望消除嗡嗡声,但输出的声音就像原始声音一样。
【问题讨论】:
标签: matlab audio noise-reduction