Skip to contents

Acoustic Evenness Index from Villanueva-Rivera et al. 2011. The AEI is calculated by dividing the spectrogram into frequency bands (default 10), taking the proportion of energy in each band above an energy threshold, and then calculating the Gini Coefficient from those proportions. The new version allows the user to choose between different ways to compute the proportions before calculating the Gini, among other new parameter options (see Details)

Usage

aei(
  wave,
  freq.res = 50,
  win.fun = "hanning",
  min.freq = 0,
  max.freq = 10000,
  n.bands = 10,
  cutoff = -60,
  norm.spec = FALSE,
  noise.red = 0,
  rm.offset = TRUE,
  props = TRUE,
  prop.den = 1,
  db.fs = TRUE
)

Arguments

wave

an object of class Wave imported with the readWave function of the tuneR package.

win.fun

window function (filter to handle spectral leakage); "bartlett", "blackman", "flattop", "hamming", "hanning", or "rectangle".

min.freq

minimum frequency to compute the spectrogram.

max.freq

maximum frequency to compute the spectrogram.

n.bands

number of bands to split the spectrogram.

cutoff

dB threshold to calculate energy proportions.

norm.spec

logical; if TRUE, the spectrogram is normalized, scaled by its maximum value (not recommended because normalized spectrograms with different SNR are not comparable).

noise.red

numeric; controls the application of noise reduction. If set to 1, noise reduction is applied to each row by subtracting the median from the amplitude values. If set to 2, noise reduction is applied to each column similarly. If set to 0, noise reduction is not applied.

rm.offset

logical; if set to TRUE, the function will remove DC offset before computing ADI. Default = TRUE.

props

logical; if set to TRUE, the function stores the energy proportion values for each frequency band and channel. Default = TRUE.

prop.den

numeric; indicates how the energy proportion is calculated.

db.fs

logical; if TRUE, the amplitude scale is expressed as decibels Full Scale (dBFS). Only used when norm = FALSE.

frew.res

the frequency resolution (Hz per bin) to use. From this value the window length for the FFT will be calculated (sampling rate / frequency resolution).

Value

A tibble (data frame) with the AEI values for each channel (if stereo), metadata, and the parameters used for the calculation.

Examples

aei(tropicalsound)
#> Error: object 'tropicalsound' not found