Removing Noise from sound wave using fft

I am trying to remove background noise from an audio. I have applyed fft and zeroed the low amplitude frequency. Anyone has any idea about this? Attached are signal before and after denoised. I get even more noise after applying ifft.

2 commentaires

Hello,
I am stuggling to understand the resoning behind this. An FFT will provide an outline of where the frequency manifests, this allows underirable frequencies to be identified. Once these undesired frequencies have been identified, filters must be designed to remove the undesired frequencies.
You should also note that the FFT function uses the first 'N' number of samples therefore ensure you are using an approperate number of samples for 'N'.
  • What filters have you applied?
  • What does the FFT look like pre and post filtering
Once we know this we should be able to offer more insight as to whats going on.
If you have applied filters another common mistake is to increase the filter order as much as possiable, while this produces a steeper cut off response it also adds ringing into the signal as a form of distortion which could be the problem.
Kind regards,
Christopher
Lim Hong Wei
Lim Hong Wei le 22 Mai 2021
Hi and thank you Christopher, the filter I applied is zeroing the frequencies when the amplitude of fft signal is lower than a value. Attached pictures are FFT function before and after filtering.

Connectez-vous pour commenter.

Réponses (1)

Hi,
Did you perform the followings:
...
n = length(t); % Time
Fhat = fft(F, n); % FFT of F signal
PSD = Fhat.*conj(Fhat)/n; % PSD of FFTed signal
freq = 1/(dt*n)*(0:n); % Frequency values
L = 1:floor(n/2); % Length o signal
Indices = PSD>100; % Find all freqs with large power
Fhat =Indices.*Fhat; % Zeroing all small Fourier coeff.'s
FFilt = ifft(Fhat); % Inverse of FFT for filtered time signal
...

6 commentaires

Programming is a math that does not like "likely". It has to be or not.
Lim Hong Wei
Lim Hong Wei le 22 Mai 2021
Modifié(e) : Lim Hong Wei le 22 Mai 2021
I did perform like the way you did.
Did you choose the right range of PSD to diminish the noise content frequencies? Note that as an example I am using here PSD>100. A different PSD limit value should work in your case. This is the very crucial point to filter the noise components of the signal.
Lim Hong Wei
Lim Hong Wei le 23 Mai 2021
Yes, I did. But my problem right now is I have no idea why my filtered audio consists of additional noise which does not exist in my original audio.
nadeem akram
nadeem akram le 8 Jan 2023
dt ??
dt is a time step.

Connectez-vous pour commenter.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by