Learn R Programming

seewave (version 1.6.1)

timer: 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 = 5, envt="abs",
power = 1, msmooth = NULL, ksmooth = NULL,
plot = TRUE, plotthreshold = TRUE,
col = "black", colval = "red", 
xlab = "Time (s)", ylab = "Amplitude", ...)

Arguments

Value

  • If plot is FALSE, timer returns a list containing three components:
  • sduration of signal period(s) in seconds
  • pduration of pause period(s) in seconds
  • rratio between the signal and silence periods(s)
  • .
  • positionsa list containing four elements:
  • s.startstart position(s) of signal period(s)
  • s.endend position(s) of signal period(s)

See Also

env, cutw, pastew.

Examples

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

Run the code above in your browser using DataLab