afilter {seewave}R Documentation

Amplitude filter

Description

This function deletes all signal which amplitude is below a selected threshold.

Usage

afilter(wave, f, threshold = 5, plot = TRUE,
listen = FALSE, Sample = FALSE,...)

Arguments

wave a vector, a matrix (first column), an object of class ts, Sample (left channel), or Wave (left channel).
f sampling frequency of wave (in Hz). Does not need to be specified if wave is an object of class ts, Sample, or Wave.
threshold amplitude threshold (in %).
plot logical, if TRUE plots the new oscillogram (by default TRUE).
listen if TRUE the new sound is played back.
Sample a logical, if TRUE and plot is FALSE returns an object of class Sample
... other oscillo graphical parameters.

Details

The threshold value is in % relative to the maximal value of wave. Signal inferior to this value is clipped.

Value

If plot is FALSE, a new wave is returned as a one-column matrix or as a Sample object if Sample is TRUE.

Note

This function is used as an argument (threshold) in the following functions: autoc, csh, dfreq, timer and zc.

Author(s)

Jerome Sueur sueur@mnhn.fr

See Also

ffilter, oscillo

Examples

data(orni)
op<-par(mfrow=c(2,1))
afilter(orni,f=22050)
title(main = "threshold level = 5")
afilter(orni,f=22050,threshold=0.5,colwave="blue")
title(main = "threshold level = 0.5")
par(op)

[Package seewave version 1.5.4 Index]