soundgen (version 1.5.0)

downsample: Simple downsampling

Description

Internal soundgen function

Usage

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

Run this code
# NOT RUN {
s = sort(rnorm(20))
soundgen:::downsample(s, srNew = 5, srOld = 18)
soundgen:::downsample(s, srNew = 5, srOld = 40)
# }

Run the code above in your browser using DataLab