maad.sound.spectral_snr

maad.sound.spectral_snr(Sxx_power)[source]

Compute the signal to noise ratio (SNR) of an audio from its spectrogram in the time-frequency domain.

Parameters:
Sxx_power2D array

Power spectrogram density [Matrix] to process.

Returns:
ENRffloat

Total energy in dB computed in the frequency domain which corresponds to the average of the power spectrogram then the sum of the average

BGNffloat

Estimation of the background energy (dB) computed based on the estimation of the noise profile of the power spectrogram (2d)

SNRf: float

Signal to noise ratio (dB) computed in the frequency domain SNRf = ENRf - BGNf

ENRf_per_binvector of floats

Energy in dB per frequency bin

BGNf_per_binvector of floats

Background (noise profile) energy in dB per frequency bin

SNRf_per_binvector of floats

Signal to noise ratio per frequency bin

References

..[1] Towsey, Michael (2013), Noise Removal from Waveforms and Spectrograms Derived from Natural Recordings of the Environment. Queensland University of Technology, Brisbane. ..[2] Towsey, Michael (2017),The calculation of acoustic indices derived from long-duration recordings of the naturalenvironment.Queensland University of Technology, Brisbane.

Examples

>>> s, fs = maad.sound.load('../data/rock_savanna.wav')
>>> Sxx_power,_,_,_ = maad.sound.spectrogram (s, fs)  
>>> _, _, snr, _, _, _ = maad.sound.spectral_snr(Sxx_power)
>>> snr
4.084065436435541