maad.features.temporal_median
- maad.features.temporal_median(s, mode='fast', Nt=512)[source]
Computes the median of the envelope of an audio signal.
- Parameters:
- s1D array
Audio to process (wav)
- 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:
- MED: float
Median of the envelope
Examples
>>> import maad >>> s, fs = maad.sound.load('../data/spinetail.wav') >>> med = maad.features.temporal_median(s) >>> print(med) 0.007934564717486147