wav2dBSPL | R Documentation |
This function applies an absolute dB SPL scale to the amplitude of a time wave based on the properties of the recording chain, if known.
wav2dBSPL(wave, f, channel = 1, gain, sensitivity = -35, Vadc = 2, pref = 2 * 10^-5)
wave |
an R object. |
f |
sampling frequency of |
channel |
channel of the R object, by default left channel (1). |
gain |
total gain applied to the sound (preamplifer + amplifier), in dB. |
sensitivity |
sensitivity of the microphone, in dB/V (by default - 35 dB/V). |
Vadc |
maximal voltage (peak to peak) converted by the analog to digital convertor ADC, in V (by default 2 V). |
pref |
sound pressure reference in the medium, in Pa (by default = 2*10^-5 Pa in air). |
A numeric vector of the same legnth as wave
containing the sound waveform in dB SPL (Sound Pressure level in dB)
This function can be used to turn a recorder, as a Songmeter or an Audiomoth, in a kind of soundlevel meter.
Sylvain Haupert
wav2leq
## note that the original gain, sensitivity and Vadc of tico
## are unknown, this is therefore a kind of 'unreal' example
data(tico)
res <- wav2dBSPL(tico, gain=18)
plot(x=seq(0,duration(tico),length=length(tico@left)), y=res, type="l", xlab="Time (s)",
ylab="dB SPL", las=1)
## dB SPL approximation for the complete sound
meandB(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.