Problem removing the noise of a song

1 次查看(过去 30 天)
Hello everybody I've trying to remove the noise of a song. Fisrt I use FFT to know in which frequency I have to desing my filter. I designed a notch filter to remove the noise but I can't remove it. I read that most of the time this type of noise is at 60 Hz but also didn't work. Here is the song I've trying filtering and also here is the code:
[x,fs] = audioread('/Users/luismiguells/Desktop/Sample.m4a');
T1 = 0;
T2 = 8;
Ts = 1/fs;
N = (T2-T1)/Ts;
L = x(1:N);
n = 0:N-1;
t = n*Ts;
f = n/length(n)*fs;
Lomega = fft(L);
cc = round((N+log2(N))/2.0);
figure(1), plot(abs(fft(x)));
figure(2), plot(f, abs(Lomega));
Y4_out = conv(L, SBF(n-cc), 'same');
figure(3), plot(f, abs(fft(SBF(n-cc))));
figure(4), plot(t, Y4_out);
sound(Y4_out, fs);
figure(5), plot(f, abs(fft(Y4_out))/N);
function Y4 = SBF(n)
fc1 = 4.10e+4;
fc2 = 4.20e+4;
Y4 = 2*fc1*sinc(2*pi*fc1*n)-2*fc2*sinc(2*pi*fc2*n);
index = n == 0;
Y4(index) = 20;
end

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Audio I/O and Waveform Generation 的更多信息

产品


版本

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by