Question

I am trying to remove static noise from an audio recording using the frequency domain in matlab and can't get the following to produce the audio I expect:

signalsamples = [...]; % n noisey signal samples
noisesamples = [...]; % isolated noise samples

signalfft = fft(signalsamples);
noisefft = fft(noisesamples, n);

reducednoisefft = signalfft ./ (noisefft * removalfactor); % Decrease the amount of noise frequencies in the signal in the frequency domain
reducednoisesamples = ifft(reducednoisefft); % Create new samples

When I run this the resulting audio (reducednoisesamples) has a new, loud whine much louder than anything else in the audio however you can just hear the original audio playing in the background.

  1. Does this method work (or am I missing something)?
  2. If it should work in theory, what am I doing wrong?
Was it helpful?

Solution

Suppose your signal's FFT looks like this:

signal FFT

If your noise is a whining sound, basically a sine wave of fixed frequency, noisefft will look like this:

noise FFT

And so signalfft - which is really signalPlusNoiseFFT - will look like this:

signal plus noise ffT

Dividing by noisefft is wrong, because you'll be essentially dividing by zero where noisefft is weak...

You want to multiply by a function like this:

desired multiplier

Which is given by:

max_noise = max(noisefft)
multiplier = (max_noise - noisefft) / max_noise
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top