Given an audio signal
x[n] sampled at 44.1khz (let's say 1 minute of music or speech) and a noise template
noise[n] (let's say 2 seconds, for example tape hiss), this might be the simplest STFT-based noise reduction algorithm :
noisetemplate = np.abs(stft(noise))).mean(axis=0) xSTFT = stft(x) outSTFT = np.zeros_like(x) for t in range(xSTFT.shape): # process each STFT frame a = np.abs(xSTFT[t, :]) - noisetemplate # spectral substraction for each frequency bin a = a * (a > 0) # if negative value, make it 0 outSTFT[t, :] = xSTFT / np.abs(xSTFT) * a # inverse STFT with overlap-add, etc.
It works ok, but I think we can do better.
What is a step further / a little bit better STFT-based noise reduction than this naive spectral substraction ?
Note: I've read a few things about Wiener, but I'm still unable to modify the previous code to turn it into Wiener filtering...