downsample: Simple downsampling

Description Usage Arguments Details Examples

View source: R/utilities_math.R

Description

Internal soundgen function

Usage

1
downsample(s, srNew = 10, srOld = 120, minLen = 3)

Arguments

s

a numeric vector

srNew

the new, required sampling rate

srOld

the original sampling rate

minLen

the minimum length of returned vector

Details

Takes a numeric vector and downsamples it to the required sampling rate by simply throwing away some of the original points. If the new sampling rate is higher than the original, does nothing.

Examples

1
2
3
s = sort(rnorm(20))
soundgen:::downsample(s, srNew = 5, srOld = 18)
soundgen:::downsample(s, srNew = 5, srOld = 40)

tatters/soundgen_beta documentation built on May 14, 2019, 9 a.m.