maad.spl.wav2leq
- maad.spl.wav2leq(wave, f, gain, Vadc=2, dt=1, sensitivity=-35, dBref=94, pRef=2e-05)[source]
Convert wave to Equivalent Continuous Sound Pressure level (Leq [dB SPL]).
- Parameters:
- wavendarray-like or scalar
wave should already be normalized between -1 to 1 (depending on the number of bits) take the output of the function sound.load of maad module ndarray-like or scalar containing the raw sound waveform
- finteger
Sampling frequency in Hz
- 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
- dtfloat, optional, default is 1 (second)
Integration step to compute the Leq (Equivalent Continuous Sound level)
- 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') >>> Leq = maad.spl.wav2leq (w, fs, gain=42) >>> maad.util.mean_dB(Leq) 54.575482584140005