maad.spl.wav2volt
- maad.spl.wav2volt(wave, Vadc=2)[source]
Convert an audio signal amplitude to Volts.
Warning
- Important: Previous versions of this function incorrectly calculated the
voltage conversion by omitting the division by 2 for the Vadc parameter. This resulted in voltage values that were twice as large as they should. If you want to correct the voltage values obtained with the previous version, you can simply divide the results by 2. In dB SPL, this 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 voltage values.
- 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
- Vadcscalar, optional, default is 2Vpp (=>+/-1V)
Maximal voltage (peak to peak) converted by the analog to digital convertor ADC
- Returns:
- voltndarray-like or scalar
ndarray-like or scalar containing the sound waveform in volt
Examples
>>> w, fs = maad.sound.load('../data/cold_forest_daylight.wav') >>> maad.spl.wav2volt(wave=w, Vadc=2) array([ 0.02155849, 0.02570888, 0.02583096, ..., -0.0082877 , -0.00219072, -0.00377764])