soundgen (version 1.5.0)

getEnv: Get amplitude envelope

Description

Internal soundgen function

Usage

getEnv(sound, windowLength_points, method = c("rms", "peak", "mean")[1])

Arguments

sound

input vector oscillating about zero

windowLength_points

the length of smoothing window, points. If specified, overrides both windowLength and samplingRate

method

'peak' for peak amplitude per window, 'rms' for root mean square amplitude, 'mean' for mean (for DC offset removal)

Details

Returns the smoothed amplitude envelope of a waveform on the original scale.

Examples

Run this code
# NOT RUN {
a = rnorm(500) * seq(1, 0, length.out = 500)
plot(soundgen:::getEnv(a, 20))
# }

Run the code above in your browser using DataLab