resample | R Documentation |
Resample numeric
data to a different rate.
resample(x, source.rate, target.rate, ...)
x |
A |
source.rate |
The rate at which |
target.rate |
The desired target sampling rate in Hz (or
another unit, as long as it is in the same unit as |
... |
Arguments passed on to |
This function resamples numeric
data (i.e., audio data) from a
source sample rate to a target sample rate. At the core it uses
the stats::approx
function.
Returns a resampled numeric
vector
of length
round(length(x) * target.rate / source.rate)
based on x
.
Pepijn de Vries
some.data <- 1:100
## assume that the current (sample) rate
## of 'some.data' is 100, and we want to
## resample this data to a rate of 200:
resamp.data <- resample(some.data, 100, 200, method = "constant")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.