Learn R Programming

seewave (version 1.7.6)

TKEO: Teager-Kaiser energy tracking operator

Description

This function computes the Teager-Kaiser energy operator.

Usage

TKEO(wave, f, m = 1, M = 1, plot = TRUE,
xlab = "Time (s)", ylab = "Energy",
type = "l", bty = "l", ...)

Arguments

wave
an R object.
f
sampling frequency of wave (in Hz). Does not need to be specified if embedded in wave.
m
a numeric vector of length 1 for the lag parameter. See details.
M
a numeric vector of length 1 for the exponent parameter. See details.
plot
logical, if TRUE returns a plot of the TK energy along time (by default TRUE).
xlab
Label of time x-axis.
ylab
Label of energy y-axis.
type
if plot is TRUE, type of plot that should be drawn. See plot for details (by default "l" for lines).
bty
the type of box to be drawn around the energy plot.
...
other plot graphical parameters.

Value

  • This function returns a two-column matrix, the first column is time and the second column includes the successive energy values. m/2 NA values are added at the start and end of the vector.

Details

The discrete version of the Teager-Kaiser operator is computed according to: $$y_{n} = x_{n}^{2/m} - (x_{n-M} \times x_{n+M})^{1/m}$$, with M the lag and m the exponent which usually equal to 1 for the conventional operator. The Teaser-Kaiser operator can be used to filter out a signal or to track amplitude modulations (AM) and/or frequency modulations (FM). See examples.

References

Kvedalen, E. (2003). Signal processing using the Teager Energy Operator and other nonlinear operators. University of Oslo, Department of Informatics, PhD Thesis, x + 100 p.

See Also

env, ifreq.

Examples

Run this code
op <- par(mfrow=c(2,1))

## sinusoid AM 
s1 <- synth(f=8000, d=0.1, cf=200, am=c(100,10), output="Wave") 
oscillo(s1)
TKEO(s1)

## linear AM decrease
s2 <- synth(f=8000, d=0.1, cf=200, shape="decr", output="Wave") 
oscillo(s2)
TKEO(s2)

## sinusoid FM
s3 <- synth(f=8000, d=0.1, cf=200, fm=c(150,50,0), output="Wave") 
oscillo(s3)
TKEO(s3)

## linear FM increase
s4 <- synth(f=8000, d=0.1, cf=200, fm=c(0,0,600), output="Wave") 
oscillo(s4)
TKEO(s4)

## AM and FM
s5 <- synth(f=8000, d=0.1, cf=200, am=c(100,10), fm=c(150,50,0), output="Wave")
oscillo(s5)
TKEO(s5)

par(op)

Run the code above in your browser using DataLab