View source: R/decomposeIteratedMaskedEMD.R
| decomposeIteratedMaskedEMD | R Documentation |
Iterates a uniform-phase masked decomposition, updating each mask frequency to the amplitude-weighted mean instantaneous frequency of its mode until a relative-change test passes or the iteration limit is reached (itEMD).
decomposeIteratedMaskedEMD(signal, samplingInterval, initialFrequencies,
phaseCount, amplitudeRatio, tolerance = 0.1,
maxIterations = 15, sifting)
signal |
Numeric vector of finite real values without |
samplingInterval |
Sampling interval in seconds, a finite number greater than zero, without default. |
initialFrequencies |
Numeric vector of |
phaseCount |
Whole number |
amplitudeRatio |
Dimensionless |
tolerance |
Threshold of the largest relative change of the mask
frequencies, a finite number greater than zero; default |
maxIterations |
Whole number |
sifting |
Named list of sifting controls, as in
|
Iteration q decomposes the signal with the uniform-phase masks of
decomposeMaskedEMD, one stage per frequency of
\mathbf{f}^{(q)}, phases 2 \pi p / P and the amplitude above.
Each frequency is then updated to the mean instantaneous frequency of its
mode weighted by the squared instantaneous amplitude, over the samples where
the frequency is defined,
f_j^{(q+1)} = \frac{\sum_n A_j[n]^2 \, \nu_j[n]}{\sum_n A_j[n]^2},
with A_j and \nu_j from
computeInstantaneousAttributes. The iteration stops with
"tolerance" when every relative change
|f_j^{(q+1)} - f_j^{(q)}| / f_j^{(q)} is below tolerance, or with
"iterationLimit" after maxIterations updates. The result is the
last decomposition together with the frequencies that produced it.
A list with the fields of decomposeMaskedEMD for the last
decomposition (modes, residue, iterations,
converged) and
stopReason |
|
maskFrequencies |
Numeric vector, the |
maskIterations |
Integer, the number of frequency updates. |
innerStopReason |
The termination of the returned masked
decomposition, with the vocabulary of |
When the masked decomposition has fewer modes than masks the update is
undefined and the function stops with an error of class
xemdInsufficientModes. A mode with zero squared amplitude where its
frequency is defined stops with an error of class xemdZeroEnergy. An
updated frequency that is not positive stops with an error when the
iteration continues.
Fabus, M. S., Quinn, A. J., Warnaby, C. E. and Woolrich, M. W. (2021). Automatic decomposition of electrophysiological data into distinct nonsinusoidal oscillatory modes. Journal of Neurophysiology, 126(5), 1670–1684. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1152/jn.00315.2021")}
The selection of the reflected extrema and the spline interpolation of the envelope nodes are adapted from emd.m (G. Rilling, March 2007), distributed with CEEMDAN revision af9a0f83, copyright (c) 2020 Marcelo A. Colominas, MIT License; see the NOTICE file of the installed package.
decomposeMaskedEMD, computeInstantaneousAttributes
Time <- seq(0, 9, length.out = 3000)
Signal <- sin(pi * Time) + sin(2 * pi * Time) + sin(6 * pi * Time) +
0.5 * Time
Sifting <- list(stopRule = "doubleThreshold", thresholds = c(0.05, 0.5),
fraction = 0.05, maxSift = 2000, boundary = "reflection",
maxModes = 3)
# Three dyadic initial frequencies, with one sample per second.
OUT <- decomposeIteratedMaskedEMD(Signal, samplingInterval = 1,
initialFrequencies = 55 / 3000 / 2 / 2^(0:2),
phaseCount = 4, amplitudeRatio = 1,
tolerance = 0.1, maxIterations = 15,
sifting = Sifting)
OUT$maskFrequencies
OUT$maskIterations
OUT$stopReason
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.