maad.features.spectral_cover
- maad.features.spectral_cover(Sxx, fn, dB_threshold=3, flim_LF=(0, 1000), flim_MF=(1000, 10000), flim_HF=(10000, 20000))[source]
Compute the proportion (cover) of the spectrogram above a threshold for three bandwidths : low frequency band (LF), medium frequency band (MF) and high frequency band (HF) [1] [2].
- Parameters:
- Sxx2D array of floats
Spectrogram 2D in dB. Usually, better to work with spectrogram without stationnary noise in order to measure only acoustic activity above the background noise
- fn1d ndarray of floats
frequency vector
- dB_thresholdscalar, optional, default is 3dB
data >Threshold is considered to be an activity
- flim_LFtupple, optional, default is (0,1000)
Low frequency band in Hz
- flim_MFtupple, optional, default is (1000,10000)
mid frequency band in Hz
- flim_HFtupple, optional, default is (10000,20000)
high frequency band in Hz
- Returns:
- LFC :scalar
Proportion of the LF bandwidth of the spectrogram with activity above the threshold
- MFC: scalar
Proportion of the MF bandwidth of the spectrogram with activity above the threshold
- HFC: scalar
Proportion of the HF bandwidth of the spectrogram with activity above the threshold
References
[1]TOWSEY, Michael W. The calculation of acoustic indices derived from long-duration recordings of the natural environment. 2017. https://eprints.qut.edu.au/110634/1/QUTePrints110634_TechReport_Towsey2017August_AcousticIndices%20v3.pdf
[2]QUT : https://github.com/QutEcoacoustics/audio-analysis. Michael Towsey, Anthony Truskinger, Mark Cottman-Fields, & Paul Roe. (2018, March 5). Ecoacoustics Audio Analysis Software v18.03.0.41 (Version v18.03.0.41). Zenodo. http://doi.org/10.5281/zenodo.1188744
Examples
>>> import maad >>> s, fs = maad.sound.load('../data/cold_forest_daylight.wav') >>> Sxx_power, tn, fn, ext = maad.sound.spectrogram (s, fs) >>> Sxx_noNoise= maad.sound.median_equalizer(Sxx_power, display=True, extent=ext) >>> Sxx_dB_noNoise = maad.util.power2dB(Sxx_noNoise) >>> LFC, MFC, HFC = maad.features.spectral_cover(Sxx_dB_noNoise, fn) >>> print('LFC: %2.2f / MFC: %2.2f / HFC: %2.2f' % (LFC, MFC, HFC)) LFC: 0.15 / MFC: 0.19 / HFC: 0.13