Learn R Programming

seewave (version 1.5.5)

crest: Crest factor and visualization

Description

This function returns the crest factor and localizes the different crest(s).

Usage

crest(wave, f, plot = FALSE, col = 2, cex = 3, symbol = "*", ...)

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<
plot
if TRUE plots the oscillograme of wave and indicates the location of the crest(s)
col
color of the symbol indicating the localisation of the crest(s)
cex
symbol magnification
symbol
symbol indicating the localisation of the crest(s)
...
other

Value

  • The function returns a list of three items
  • Ccrest factor
  • valvalue of the crest(s)
  • loclocation of the crest(s)

Details

The crest factor of a time series s is calculated according to: $$C = \frac{max(s)}{rms(s)}$$ with rms the root-mean-square (see rms).

References

Hartmann, W. M. 1998 Signals, sound and sensation. New York: Springer.

See Also

oscillo, rms

Examples

Run this code
data(tico)
crest(tico, f=22050)
# see the crest location and change the default graphical parameters
crest(tico, f=22050, plot=TRUE, sym="-")

Run the code above in your browser using DataLab