Suppose your signal's FFT looks like this:
If your noise is a whining sound, basically a sine wave of fixed frequency, noisefft
will look like this:
And so signalfft
- which is really signalPlusNoiseFFT
- will look like this:
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:
Which is given by:
max_noise = max(noisefft)
multiplier = (max_noise - noisefft) / max_noise