View source: R/loudness_utilities.R
scaleSPL | R Documentation |
Internal soundgen function
scaleSPL(x, scale = NULL, SPL_measured = 70, Pref = 2e-05)
x |
numeric vector ranging from -1 to +1 |
scale |
maximum possible amplitude of input used for normalization of
input vector (only needed if |
SPL_measured |
sound pressure level at which the sound is presented, dB |
Pref |
reference pressure, Pa (currently has no effect on the estimate) |
Converts a sound from SPL on any scale to a desired level of dB SPL. See Timoney et al. (2004) "Implementing loudness models in MATLAB"
sound = rnorm(100) * getSmoothContour(c(0, 1, 0), len = 100)
sound = sound / max(abs(sound))
# plot(sound, type = 'l')
sound_scaled = soundgen:::scaleSPL(sound, Pref = 2e-1)
plot(sound_scaled, type = 'l')
sound2 = sound / 3
range(soundgen:::scaleSPL(sound2, scale = NULL))
range(soundgen:::scaleSPL(sound2, scale = 1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.