FFT spectral subtraction - noise removal

28 views (last 30 days)
Wojciech
Wojciech on 30 Sep 2014
Answered: Elif Ezgi GÜLER on 19 Nov 2021
Hello,
I have a problem with basic of FFT subtraction. I have signal 80 seconds of recording with microphone - I have signal with birds singing and noise coming from forest. First 10 seconds of my recording is only noise - what I am trying to do is to eliminate it from whole signal. What I am doing now is:
1) Creating mean Noise_FFT from 8 seconds (I receive 8 spectra without overlapping, and then I average them)
FFT_noise(1:8,:)= fft(x()); % creating 8 times different fft from noise
2) I obtain FFT_mean_noise – fft mask that I would like to eliminate from my signal
for i=1:length(FFT_noise(:,1))
FFT_mean_noise(i,1)=mean(FFT_noise(i,1:8));
end
% below I am subtracting FFT_mean_noise from fft(signal) - second by second
for i = Indeks
index = index+1;
FFT_signal = fft(x((i:i+window_length-1),1)); % compute Fourier transform from original signal
FFT_denoise = FFT_signal- FFT_mean_noise; % spectra substration
Signal_without_noise((i:i+window_length-1),1) = real(ifft(FFT_denoise)); %going into time domain
end
% at the and I am creating FFT from one second of signal with and without noise – there is rather no difference.
FFT_signal_without_noise=abs(fft(Signal_without_noise(one second),NFFT)/L) ;
FFT_dB_ signal_without_noise =20*log10(FFT_signal_without_noise /0.00002);
FFT_orginal_signal=abs(fft(x((one second),1),NFFT)/L);
FFT_dB_ orginal_signal =20*log10(FFT_orginal_signal /0.00002);
figure(1)
plot(f, FFT_dB_ signal_without_,'b', 'Linewidth',1)
hold on;
plot(f, FFT_dB_ orginal_signal,'green', 'Linewidth',1)
What am I doing in wrong way during subtracting? I found Boll method on File Exchange and it works very well, but I would like to create something like that on my way.
  1 Comment
Image Analyst
Image Analyst on 30 Sep 2014
Why does the 1:8 change from the first index in step 1 to the second index in step 2? Plus, FFT_mean_noise(i,1) = FFT_mean_noise(i). And what is Indeks? And what is the purpose of index=index+1? You never use index. And length(FFT_noise(:,1)) is the same as size(FFT_noise, 1). Other stuff is wrong too. Why don't you attach your data and m-file so people can try to fix it?

Sign in to comment.

Answers (1)

Elif Ezgi GÜLER
Elif Ezgi GÜLER on 19 Nov 2021
Here in this problem, what is the Fs(sampling freq.)?
Each sample does not correspond to each second.

Community Treasure Hunt

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

Start Hunting!

Translated by