Learn R Programming

soundgen (version 2.3.0)

.bandpass: Bandpass filter per sound

Description

Internal soundgen function

Usage

.bandpass(
  audio,
  lwr,
  upr,
  action = c("pass", "stop")[1],
  na.rm = TRUE,
  normalize = FALSE,
  plot = FALSE,
  width = 900,
  height = 500,
  units = "px",
  res = NA,
  ...
)

Arguments

audio

a list returned by readAudio

lwr

cutoff frequencies, Hz. Specifying just lwr gives a low-pass filter, just upr high-pass filter with action = 'pass' (or vice versa with action = 'stop'). Specifying both lwr and upr a bandpass/bandstop filter, depending on 'action'

upr

cutoff frequencies, Hz. Specifying just lwr gives a low-pass filter, just upr high-pass filter with action = 'pass' (or vice versa with action = 'stop'). Specifying both lwr and upr a bandpass/bandstop filter, depending on 'action'

action

"pass" = preserve the selected frequency range (bandpass), "stop" = remove the selected frequency range (bandstop)

na.rm

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

normalize

if TRUE, resets the output to the original scale (otherwise filtering often reduces the amplitude)

plot

should a spectrogram be plotted? TRUE / FALSE

width

graphical parameters for saving plots passed to png

height

graphical parameters for saving plots passed to png

units

graphical parameters for saving plots passed to png

res

graphical parameters for saving plots passed to png

...

other graphical parameters