Created
April 19, 2018 13:32
-
-
Save bmcfee/746e572232be36f3bd462749fb1796da to your computer and use it in GitHub Desktop.
scipy.signal.stft uses scale factor for the result https://github.com/scipy/scipy/blob/43b76937c0aadf23b4e0fcc04f546fa5d61b543b/scipy/signal/spectral.py#L1805
To get the same values you need to divide D2 in following way:
hamm_win = scipy.signal.get_window('hamming', 2048)
scale = np.sqrt(1.0 / hamm_win.sum()**2)
D2 = D2 / scale
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@bmcfee thanks for doing this. I actually found out that you can get even closer for 'hann' windows. Also the normalization factor should be
n_fft
(in your example 1024).