getEnv: Get amplitude envelope

Description Usage Arguments Details Examples

View source: R/utilities_postprocessing.R

Description

Internal soundgen function

Usage

1
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

1
2
a = rnorm(500) * seq(1, 0, length.out = 500)
plot(soundgen:::getEnv(a, 20))

soundgen documentation built on Oct. 4, 2018, 9:04 a.m.