changeSampRate {monitoR} | R Documentation |
Resample Wave objects
Description
Downsample or upsample Wave
objects by specifying either a new sample rate or matching the sample rate of a different Wave
object. Optional adjustable dithering.
Usage
changeSampRate(wchange, wkeep = NULL, sr.new = wkeep@samp.rate, dither = FALSE,
dith.noise = 32)
Arguments
wchange |
Object of class |
wkeep |
Object of class |
sr.new |
Numerical sampling rate, if specified directly. |
dither |
Logical. |
dith.noise |
Adjustable dithering. If |
Details
Both downsampling and upsampling are done by spline-fitting a curve to the waveform and resampling the resulting waveform. Artifacts from resampling are nearly guaranteed. Artifacts can be masked with dithering at a cost: dithering raises the amplitude of background noise but not signal.
Value
An object of class Wave
with a modified sample rate.
Author(s)
Sasha D. Hafner, Jon Katz
See Also
Examples
data(survey)
survey <- changeSampRate(wchange = survey, sr.new = 24000)