get_magnitude#

Stft.get_magnitude()#

Get the magnitude of the STFT.

Returns:
numpy.ndarray

STFT magnitude in the input signal’s unit. The result contains a one-sided RMS spectrum for each time step, with positive frequencies only, up to half the sampling frequency. Magnitudes are scaled by sqrt(2) to account for both the positive- and negative-frequency energy.

For more information, see RMS spectrum.

Return type:

ndarray

Notes

Prior to Sound version 2027.1.0, RMS spectrum scaling is not applied in the returned STFT. As a consequence, the stored STFT values are not in the input signal’s unit if the used Sound version is not 2027.1.0 or higher. In such case, to scale the STFT values, you need to divide them by the sum of the values of the window function that is specified with attributes window_type and fft_size (the window size is equal to the FFT size in fft_size).