dot-resample: Resample per sound

.resampleR Documentation

Resample per sound

Description

Internal soundgen function

Usage

.resample(
  audio,
  mult = NULL,
  len = NULL,
  samplingRate_new = NULL,
  lowPass = TRUE,
  na.rm = FALSE,
  nPoints = 1,
  plot = FALSE,
  width = 900,
  height = 500,
  units = "px",
  res = NA,
  ...
)

Arguments

audio

a list returned by readAudio

mult

multiplier of sampling rate: new sampling rate = old sampling rate x mult, so 1 = no effect, >1 = upsample, <1 = downsample

len

if specified, overrides mult and samplingRate_new and simply returns a vector of length len

samplingRate_new

an alternative to mult provided that the old samplingRate is know (NB: mult takes precedence)

lowPass

if TRUE, applies a low-pass filter before decimating or after upsampling to avoid aliasing

na.rm

if TRUE, NAs are interpolated, otherwise they are preserved in the output

nPoints

the number of points to use for interpolating leading and trailing NAs: 1 = constant interpolation, 2 = use the first two non-NAs at the beginning and the last two non-NAs at the end, etc.

plot

should a spectrogram be plotted? TRUE / FALSE

width, height, units, res

graphical parameters for saving plots passed to png

...

other graphical parameters


soundgen documentation built on Sept. 12, 2024, 6:29 a.m.