getLoudnessPerFrame {soundgen} | R Documentation |
Get loudness per frame
Description
Internal soundgen function
Usage
getLoudnessPerFrame(spec, samplingRate, spreadSpectrum = TRUE)
Arguments
samplingRate |
sampling rate of |
spreadSpectrum |
if TRUE, applies a spreading function to account for frequency masking |
Details
Takes as input the absolute (not power) spectrum of a single STFT frame and
estimates its loudness in sone. See getLoudness
for details.
Examples
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
[Package soundgen version 2.7.0 Index]