Removing Noise from sound wave using fft
Show older comments
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.
I get even more noise after applying ifft. 2 Comments
Christopher McCausland
on 21 May 2021
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
on 22 May 2021
Answers (1)
Sulaymon Eshkabilov
on 22 May 2021
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 Comments
Sulaymon Eshkabilov
on 22 May 2021
Programming is a math that does not like "likely". It has to be or not.
Lim Hong Wei
on 22 May 2021
Edited: Lim Hong Wei
on 22 May 2021
Sulaymon Eshkabilov
on 22 May 2021
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
on 23 May 2021
nadeem akram
on 8 Jan 2023
dt ??
Sulaymon Eshkabilov
on 8 Jan 2023
dt is a time step.
Categories
Find more on Spectral Measurements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!