| env {seewave} | R Documentation |
This function returns the absolute or Hilbert amplitude envelope of a time wave.
env(wave, f, envt = "hil", msmooth = NULL, ksmooth = NULL, norm = FALSE, plot = TRUE, k = 1, j = 1, ...)
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. |
envt |
the type of envelope to be returned: either "abs" for absolute amplitude envelope or "hil" for Hilbert amplitude envelope. See Details section. |
msmooth |
a vector of length 2 to smooth the amplitude envelope with a mean sliding window. The first component is the window length (in number of points). The second component is the overlap between successive windows (in %). See examples. |
ksmooth |
kernel smooth via kernel. See examples. |
norm |
a logical, if TRUE the amplitude of the envelope
is normalised between 0 and 1. |
plot |
logical, if TRUE returns a plot
of wave envelope (by default TRUE). |
k |
number of horizontal sections when plot is TRUE
(by default =1). |
j |
number of vertical sections when plot is TRUE
(by default =1). |
... |
other oscillo graphical parameters. |
When envt is set as "abs", the amplitude envelope returned
is the absolute value of wave.
When envt is set as "hil", the amplitude envelope returned is the modulus
(Mod) of the analytical signal of wave
obtained through the Hilbert transform (hilbert).
Data are returned as one-column matrix when plot is FALSE.
Be aware that smoothing with either msmooth or ksmooth
changes the original number of points describing wave.
Jerome Sueur sueur@mnhn.fr
data(tico)
# Hilbert amplitude envelope
env(tico,f=22050)
# absolute amplitude envelope
env(tico,f=22050,envt="abs")
# smoothing with a 10 points and 50
env(tico,f=22050,msmooth=c(10,50))
# smoothing kernel
env(tico,f=22050,ksmooth=kernel("daniell",10))
# overplot of oscillographic and envelope representations
oscillo(tico,f=22050)
par(new=TRUE)
env(tico,f=22050,colwave=2)