| decomposeLMD | R Documentation |
Decomposes a signal by successive extraction of product functions, each obtained by repeated subtraction of a smoothed local mean and division by a smoothed local magnitude.
decomposeLMD(signal, maxIterations, envelopeTolerance, changeTolerance,
maxSmoothPasses, maxModes = Inf)
signal |
Numeric vector of finite values without |
maxIterations |
Whole number |
envelopeTolerance |
Number |
changeTolerance |
Number |
maxSmoothPasses |
Whole number |
maxModes |
Whole number |
The local levels of a function use as nodes its interior extrema and its
first and last samples: consecutive nodes n_i, n_{i+1} give the mean
m_i = (n_i + n_{i+1}) / 2 and the magnitude
a_i = |n_i - n_{i+1}| / 2, held between the two nodes. Both levels are
smoothed by a repeated uniform moving average whose half width follows from
the largest gap between nodes and shrinks at the borders; passes repeat
while two consecutive samples are equal, up to maxSmoothPasses.
From s_0 = r_{p-1}, iteration q forms
s_q = \frac{s_{q-1} - m_q}{a_q}
with the smoothed levels of s_{q-1}. The extraction ends without that
normalization, with converged TRUE, when one of the two
tolerances is met; it ends with converged FALSE when
s_{q-1} has at most one extremum or after maxIterations
normalizations. With Q normalizations, the product function is
a_1 \cdots a_Q s_Q and r_p = r_{p-1} - PF_p. Before extraction
p the decomposition ends with "terminalResidue" when
r_{p-1} has at most one extremum and with "modeLimit" when
p - 1 equals maxModes. A product function combines an
accumulated amplitude envelope with a normalized oscillation; this
construction does not impose the IMF envelope conditions of EMD.
In the first iteration a_1 and s_0 = r_{p-1} carry the units of
the signal, so both tolerances compare magnitudes in those units with
dimensionless quantities; the result depends on the unit only when the
initial magnitude approaches 1 in that unit.
A list with
modes |
Double matrix, samples by product functions. |
residue |
Numeric vector, the final residue. |
iterations |
Integer vector, the number |
converged |
Logical vector by product function. |
stopReason |
|
A local magnitude that is not positive leaves the normalization undefined
and stops the function with an error of class xemdZeroEnvelope.
Smith, J. S. (2005). The local mean decomposition and its application to EEG perception data. Journal of the Royal Society Interface, 2(5), 443–454. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1098/rsif.2005.0058")}
The local levels and the extraction of a product function are adapted from LMD 1.2.1 (Shubhra Prakash), revision ec11b721ec7b05f0137eeb67a619b28f62ef85a2, Apache License (>= 2); see the NOTICE file of the installed package.
decomposeIF, decomposeEMD
Time <- seq(0, 9, length.out = 3000)
Signal <- sin(pi * Time) + sin(2 * pi * Time) + sin(6 * pi * Time) +
0.5 * Time
OUT <- decomposeLMD(Signal, maxIterations = 200, envelopeTolerance = 0.01,
changeTolerance = 0.01, maxSmoothPasses = 12,
maxModes = 8)
dim(OUT$modes)
OUT$iterations
OUT$stopReason
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.