powered by
Internal soundgen function
downsample(s, srNew = 10, srOld = 120, minLen = 3)
a numeric vector
the new, required sampling rate
the original sampling rate
the minimum length of returned vector
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.
# 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