maad.spl.psd2leq

maad.spl.psd2leq(P, gain, Vadc=2, sensitivity=-35, dBref=94, pRef=2e-05)[source]

Convert Power spectral density (PSD, amplitude²) into Equivalent Continuous Sound pressure level (Leq [dB SPL])

Warning

Important: Previous versions of this function incorrectly calculated the

volt conversion by omitting the division by 2 for the Vadc parameter. In dB SPL, this would lead to a 6 dB increase in the calculated sound pressure level. If you want to correct the SPL values obtained with the previous version, you can simply subtract 6 dB from the old results. This has been corrected in the version 1.5.1. Ensure you are using the latest version (>=1.5.1) to obtain accurate dB SPL values.

Parameters:
Pndarray-like (1d)

ndarray-like containing the Power spectral density (PSD=amplitude²)

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 (air:20e-6, water:1e-6 Pa)
Returns:
Leqfloat

Equivalent Continuous Sound pressure level (Leq [dB SPL])

Examples

>>> w, fs = maad.sound.load('../data/cold_forest_daylight.wav') 
>>> Sxx_power,tn,fn,_ = maad.sound.spectrogram (w, fs)
>>> S_power_mean = maad.sound.avg_power_spectro(Sxx_power) 
>>> maad.spl.psd2leq(S_power_mean, gain=42)
    47.537824826354665