Sound pressure level

The module spl is a collection of functions used to describe the physics of acoustic waves.

Conversion to sound pressure level (SPL)

wav2volt(wave[, Vadc]) Convert an audio signal amplitude to Volts.
volt2pressure(volt, gain[, sensitivity, dBref]) Convert Volts to instantaneous sound pressure (p [Pa]).
wav2pressure(wave, gain[, Vadc, ...]) Convert wave amplitude to instantaneous sound pressure (p [Pa]).
pressure2dBSPL(p[, pRef]) Convert sound pressure (p [Pa]) to sound pressure level (L [dB]).
dBSPL2pressure(L[, pRef]) Convert sound pressure level (L [dB]) to sound pressure (p [Pa]).
power2dBSPL(P, gain[, Vadc, sensitivity, ...]) Convert power (amplitude²) to sound pressure level (L [dB]).
amplitude2dBSPL(s, gain[, Vadc, ...]) Convert signal (amplitude) to instantaneous sound pressure level (L [dB SPL]).
wav2dBSPL(wave, gain[, Vadc, sensitivity, ...]) Convert wave amplitude to instantaneous sound pressure level (L [dB SPL]).
wav2leq(wave, f, gain[, Vadc, dt, ...]) Convert wave to Equivalent Continuous Sound Pressure level (Leq [dB SPL]).
pressure2leq(p, fs[, dt, pRef]) Convert pressure vector (p [Pa]) to Equivalent Continuous Sound Pressure level (Leq [dB SPL]).
psd2leq(P, gain[, Vadc, sensitivity, dBref, ...]) Convert Power spectral density (PSD, amplitude²) into Equivalent Continuous Sound pressure level (Leq [dB SPL])

Attenuation and active distance

attenuation_dB(f, r, r0[, t, rh, pa, a0]) Compute the attenuation in decibels taking into account the geometric, atmospheric and habitat attenuation contributions.
dBSPL_per_bin(L, f) Function to spread the sound pressure level (Energy in dB) along a frequency vector (bins).
detection_distance(L_bkg, L0, f[, r0, ...]) Compute the detection distance also known as detection range or detection radius or active space.
pressure_at_r0(f, r, p[, r0, t, rh, pa, a0]) Estimate the pressure p0 at distance r0 from pressure p measured at
dBSPL_at_r0(f, r, L[, r0, t, rh, pa, a0, pRef]) Estimate the sound pressure level L0 (dB SPL) at distance r0 from sound pressure
apply_attenuation(p0, fs, r[, r0, t, rh, pa, a0]) Apply attenuation of a temporal signal p0 after propagation between the reference distance r0 and the final distance r taken into account the geometric, atmospheric and habitat attenuation contributions.