changeSampRate: Resample Wave objects

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/changeSampRate.R

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

1
2
changeSampRate(wchange, wkeep = NULL, sr.new = wkeep@samp.rate, dither = FALSE, 
               dith.noise = 32)

Arguments

wchange

Object of class Wave to resample.

wkeep

Object of class Wave to use to match sampling rate, or specify sampling rate with sr.new.

sr.new

Numerical sampling rate, if specified directly.

dither

Logical. TRUE adds gaussian dithering.

dith.noise

Adjustable dithering. If dither = TRUE, this value will be the stdev of the normally distributed noise.

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

downsample

Examples

1
2
3
data(survey)

survey <- changeSampRate(wchange = survey, sr.new = 24000)

monitoR documentation built on May 1, 2019, 6:28 p.m.