# Difference between librosa.stft and scipy.signal.stft

I read the source code of librosa.stft and sicpy.signal.stft, and notice that the calculation results of STFT(short-time fourier transform) in these two libraries are quite different: In scipy.signal.stft, the stft result is scaled by 1.0/win.sum(), while in librosa.stft no scaling or normalization procedure is done. So why scipy.signal.stft do the additional scaling procedure? And is there any other difference in the calculation of STFT in these two libraries?

Fft scaling (normalization) isn't strictly a part of an fft algorithm although some implementations (like the one you mention) include it. Since scaling depends on the actual fft algorithm, it makes sense, in my opinion, to include it in the implementation because it may not be obvious for programmers to decide what scaling factor(s) to use (the usual scaling factors are $$1/N$$, $$2/N$$ (an efficient fft algorithm that is using only half the spectrum so we need to multiply by 2 to compensate for the missing energy), $$1/sum(wnd)$$, $$2/sum(wnd)$$
scipy.signal.stft uses scale factor for the result stft source code
To get the same values as for librosa.stft you need: