timer {seewave}R Documentation

Time measurements of a time wave

Description

This function computes and shows the duration of signal periods, pause periods and their ratio.

Usage

timer(wave, f, threshold, smooth = NULL, plot = TRUE,
plotthreshold = TRUE, col = "black", colval = "red", 
xlab = "Time (s)", ylab = "Amplitude", ...)

Arguments

wave data describing a 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 for signal detection (in %).
smooth smoothes the envelope by averaging the number of points selected
plot logical, if TRUE plots the envelope and the measurements (by default TRUE).
plotthreshold logical, if TRUE plots the threshold as an horizontal line on the graph (by default TRUE).
col colour of the envelope.
colval colour of plotted measurements.
xlab title of the x-axis.
ylab title of the y-axis.
... other plot graphical parameters.

Value

If plot is FALSE, timer returns a list containing three components:

s duration of signal periods in seconds
p duration of pause periods in seconds
r ratio between the signal periods and silence

.

Author(s)

Jerome Sueur sueur@mnhn.fr

See Also

oscillo, cutw, pastew.

Examples

data(tico)
timer(tico,f=22050,threshold=5,smooth=50)
# to compare with an oscillographic representation
data(orni)
op<-par(mfrow=c(2,1))
timer(orni,f=22050,threshold=5,smooth=40,tck=0.05,
        bty="l",xaxs="i",colval="blue")
title(main="A cicada song made of five echemes",col="blue")
oscillo(orni,f=22050,k=1,j=1)
par(op)

[Package seewave version 1.5.0 Index]