maad.features.spectral_leq
- maad.features.spectral_leq(X, gain, Vadc=2, sensitivity=-35, dBref=94, pRef=2e-05)[source]
Computes the Equivalent Continuous Sound level (Leq) from a power spectrum (1d) or power spectrogram (2d).
- Parameters:
- Xndarray of floats
Spectrum (1d) or Spectrogram (2d). Work with PSD to be consistent with energy concervation
- gaininteger
Total gain applied to the sound (preamplifer + amplifier)
- Vadcscalar, optional, default is 2Vpp (=>+/-1V)
Maximal voltage (peak to peak) converted by the analog to digital convertor ADC
- sensitivityfloat, optional, default is -35 (dB/V)
Sensitivity of the microphone
- dBrefinteger, optional, default is 94 (dBSPL)
Pressure sound level used for the calibration of the microphone (usually 94dB, sometimes 114dB)
- pRefSound pressure reference in the medium (air20e-6, water1e-6)
- Returns:
- LEQf: float
Equivalent Continuous Sound level (Leq) in dB SPL
Examples
>>> import maad >>> s, fs = maad.sound.load('../data/spinetail.wav') >>> Sxx_power,_,_,_ = maad.sound.spectrogram(s,fs) >>> Leqf, Leqf_per_bin = maad.features.spectral_leq(Sxx_power, gain=42) >>> print('Leq (from spectrogram) is %2.1fdB SPL' % Leqf) Leq (from spectrogram) is 63.7dB SPL