Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

crest

Crest factor and visualization


Description

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

Usage

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

Arguments

wave

an R object.

f

sampling frequency of wave (in Hz). Does not need to be specified if embedded in wave.

channel

channel of the R object, by default left channel (1).

plot

if TRUE plots the oscillogram 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

Details

The crest factor of a time series s is calculated according to:

C = max(abs(s))/rms(s)

with rms the root-mean-square (see rms).

Value

The function returns a list of three items

C

crest factor

val

value of the crest(s)

loc

location of the crest(s)

Note

There might be several crests (maxima) along the time wave but there is a single crest factor.

Author(s)

Jerome Sueur sueur@mnhn.fr

References

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

See Also

Examples

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

seewave

Sound Analysis and Synthesis

v2.1.6
GPL (>= 2)
Authors
Jerome Sueur <sueur@mnhn.fr> [cre, au], Thierry Aubin [au], Caroline Simonis [au], Laurent Lellouch [main ctrb], Ethan C. Brown [ctrb], Marion Depraetere [ctrb], Camille Desjonqueres [ctrb], Francois Fabianek [ctrb], Amandine Gasc [ctrb], Eric Kasten [ctrb], Stefanie LaZerte [ctrb], Jonathan Lees [ctrb], Jean Marchal [ctrb], Andre Mikulec [ctrb], Sandrine Pavoine [ctrb], David Pinaud [ctrb], Alicia Stotz [ctrb], Luis J. Villanueva-Rivera [ctrb], Zev Ross [ctrb], Carl G. Witthoft [ctrb], Hristo Zhivomirov [ctrb].
Initial release
2020-06-28

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.