maad.features.acoustic_eveness_index

maad.features.acoustic_eveness_index(Sxx, fn, fmin=0, fmax=20000, bin_step=500, dB_threshold=-50)[source]

Compute the Acoustic Eveness Index (AEI) from a spectrogram [1].

Parameters:
Sxx: ndarray of floats

2d : amplitude spectrogram. In order to obtain the same output as for soundecology, the signal and the spectrogram need to be processed without detrend on. maad.sound.load(“myfile.wav”, …, detrend = False) maad.sound.spectrogram(s, fs, …, detrend = False) For a complete example, see the example below

fn1d ndarray of floats

frequency vector

fminscalar, optional, default is 0

Minimum frequency in Hz

fmaxscalar, optional, default is 20000

Maximum frequency in Hz

bin_stepscalar, optional, default is 500

Frequency step in Hz

dB_thresholdscalar, optional, default is -50

Threshold to compute the score (ie. the number of data > threshold, normalized by the length)

Returns:
AEIscalar

Acoustic Eveness of the spectrogram (ie. Gini of the vector of scores)

Notes

The Acoustic Eveness Index (AEI) and the Acoustic Diversity Index (ADI) are negatively correlated.

References

[1]

Villanueva-Rivera, L. J., B. C. Pijanowski, J. Doucette, and B. Pekin. 2011. A primer of acoustic analysis for landscape ecologists. Landscape Ecology 26: 1233-1246.`DOI: 10.1007/s10980-011-9636-9 <https://doi.org/10.1007/s10980-011-9636-9>`_

Examples

>>> import maad

Load the signal and compute the spectrogram to give the same result as soundecology

>>> s, fs = maad.sound.load('../data/cold_forest_daylight.wav', detrend=False) 
>>> Sxx, tn, fn, ext = maad.sound.spectrogram (s, fs, nperseg=int(fs/10), noverlap=0, mode='amplitude', detrend=False)   
>>> AEI  = maad.features.acoustic_eveness_index(Sxx,fn,fmax=10000)
>>> print('AEI : %2.2f ' %AEI) 
AEI : 0.39   

Load the signal and compute the spectrogram as usual (detrend ON) such that the dB threshold needs to be adapted to give results that are more or less in line with soundecology

>>> s, fs = maad.sound.load('../data/cold_forest_daylight.wav') 
>>> Sxx, tn, fn, ext = maad.sound.spectrogram (s, fs, mode='amplitude')   
>>> AEI  = maad.features.acoustic_eveness_index(Sxx,fn,fmax=10000, dB_threshold = -47)
>>> print('AEI : %2.2f ' %AEI) 
AEI : 0.39