View source: R/loudness_utilities.R
getLoudnessPerFrame | R Documentation |
Internal soundgen function
getLoudnessPerFrame(spec, samplingRate, spreadSpectrum = TRUE)
samplingRate |
sampling rate of |
spreadSpectrum |
if TRUE, applies a spreading function to account for frequency masking |
Takes as input the absolute (not power) spectrum of a single STFT frame and
estimates its loudness in sone. See getLoudness
for details.
sound = sin(2*pi*1000/16000*(1:1000))
sound_scaled = soundgen:::scaleSPL(sound, SPL_measured = 40)
spec = spectrogram(
sound_scaled, samplingRate = 16000, windowLength = 10,
normalize = FALSE, output = 'original')[, 10]
# plot(spec, type = 'l')
soundgen:::getLoudnessPerFrame(spec, samplingRate = 16000) # 1 sone
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.