maad.features.temporal_entropy

maad.features.temporal_entropy(s, compatibility='QUT', mode='fast', Nt=512)[source]

Computes the entropy of the envelope of an audio signal.

Parameters:
s1D array

Audio to process (wav) compatibility : string {‘QUT’, ‘seewave’}, default is ‘QUT’ Select the way to compute the temporal entropy.

  • QUT [2]: entropy of the squared envelope

  • seewave [1] : entropy of the envelope

modestr, optional, default is “fast”

Select the mode to compute the envelope of the audio waveform.

  • “fast” : The sound is first divided into frames (2d) using the function _wave2timeframes(s), then the max of each frame gives a good approximation of the envelope.

  • “Hilbert” : estimation of the envelope from the Hilbert transform. The method is slow.

Ntinteger, optional, default is 512

Size of each frame. The largest, the highest is the approximation.

Returns:
Ht: float

Temporal entropy of the audio

Notes

The entropy of an audio signal is a measure of energy dispersion. In the temporal domain, values below 0.7 indicate a brief concentration of energy (few miliseconds), while values close 1 indicate low concentration of energy, no peaks, smooth and constant background noise.

References

[1]

Seewave : http://rug.mnhn.fr/seewave. Sueur, J., Aubin, T., & Simonis, C. (2008). Seewave, a free modular tool for sound analysis and synthesis. Bioacoustics, 18(2), 213-226. DOI: 10.1080/09524622.2008.9753600

[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/spinetail.wav')
>>> Ht = maad.features.temporal_entropy (s)
>>> print(Ht) 
0.7518917279549968