Skip to contents

Decomposes pairs of copies of a signal perturbed with the same noise realization of opposite signs and averages the modes of all the copies by extraction order.

Usage

decomposeCEEMD(signal, noise, amplitudeRatio = 0.2, sifting)

Arguments

signal

Numeric vector of at least two finite values without dim, in the units of the quantity.

noise

Finite numeric matrix with one row per sample of signal and one column per realization, \(M \ge 1\); column \(m\) is a realization \(z^{(m)}\) of unit variance, used as supplied. The function draws no random numbers.

amplitudeRatio

Dimensionless ratio \(\varepsilon \ge 0\); the perturbation is \(a z^{(m)}\) with \(a = \varepsilon \, \mathrm{sd}(x)\) (divisor \(N - 1\)). Default 0.2, as in decomposeEEMD.

sifting

Named list of sifting controls, as in decomposeEMD; the rule "consecutive" is rejected.

Details

For each column, the inputs \(x + a z^{(m)}\) and \(x - a z^{(m)}\) are decomposed by scalar sifting, the positive input first. Each stops before adding an extraction whose sifting lost its envelopes and keeps its input in the residue. Accepted adaptive extractions, completed fixed sifting and extractions that reached the iteration limit are retained. The \(2M\) decompositions are extended with zero modes to the largest number of modes and averaged by extraction order, $$d_j = \frac{1}{2M} \sum_{m=1}^{M} \left(c_j^{(m,+)} + c_j^{(m,-)}\right),$$ and the residue is the mean of the \(2M\) residues, so the perturbations cancel in the reconstruction: rowSums(modes) + residue equals signal up to rounding. The method has no outer termination and returns neither meanNoise nor stopReason.

Value

A list with

modes

Double matrix, samples by modes.

residue

Numeric vector, the mean residue of the \(2M\) decompositions.

iterations

Integer vector by mode, the sum of the subtractions of the decompositions that have the mode.

converged

Logical vector by mode: TRUE only when every decomposition that has the mode accepted it; NA for completed fixed sifting. Failed attempts are reported in termination.

termination

Data frame with one row per signed realization: realization, its column index in noise; sign, 1 or -1; and mode, iterations and stopReason as in decomposeEEMD. A stopped realization stays in its pair and in the divisor \(2M\); its remaining content stays in the mean residue.

References

Yeh, J.-R., Shieh, J.-S. and Huang, N. E. (2010). Complementary ensemble empirical mode decomposition: A novel noise enhanced data analysis method. Advances in Adaptive Data Analysis, 2(2), 135–156. doi:10.1142/S1793536910000422

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.

Examples

Time <- seq(0, 9, length.out = 1000)
Signal <- sin(pi * Time) + sin(2 * pi * Time) + sin(6 * pi * Time) +
    0.5 * Time
set.seed(628)
Noise <- t(matrix(stats::rnorm(10L * length(Signal)), nrow = 10L,
                  byrow = TRUE))
Sifting <- list(stopRule = "doubleThreshold", thresholds = c(0.05, 0.5),
                fraction = 0.05, maxSift = 2000, boundary = "reflection",
                maxModes = Inf)
# Two of the ten realizations keep the example short.
OUT <- decomposeCEEMD(Signal, noise = Noise[, 1:2], amplitudeRatio = 0.2,
                      sifting = Sifting)
dim(OUT$modes)
#> [1] 1000    7
max(abs(rowSums(OUT$modes) + OUT$residue - Signal))
#> [1] 8.881784e-16