Learn R Programming

seewave (version 1.4.5)

zapsilw: Zap silence periods of a time wave

Description

This function simply delete the silence periods of a time wave.

Usage

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

Arguments

wave
data describing the time wave or a Sample object generated loading a wav file with loadSample (package sound).
f
sampling frequency of wave (in Hz). Does not need to be specified if wave is a Sample object.
threshold
amplitude threshold (in %) between silence and signal.
plot
logical, if TRUE plots the new oscillogram (by default TRUE).
Sample
if TRUE and plot is FALSE returns an object of class Sample
...
other oscillo graphical parameters.

Value

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

See Also

afilter, oscillo

Examples

Run this code
data(orni)
op<-par(mfrow=c(3,1))
oscillo(orni,f=22050)
title(main = "original signal")
zapsilw(orni,f=22050,colwave="red")
title(main = "threshold level = 5")
zapsilw(orni,f=22050,threshold=1,colwave="blue")
title(main = "threshold level = 1")
par(op)

Run the code above in your browser using DataLab