View source: R/decomposeMaskedEMD.R
| decomposeMaskedEMD | R Documentation |
Decomposes a signal by successive extraction in which each mode is the average first mode of the residue plus sinusoidal masks of several phases, under one of three mask rules: the opposite sine pair of 2005, dyadic masks (EMD-DMS) and uniformly distributed phases (UPEMD).
decomposeMaskedEMD(signal, samplingInterval, masking, sifting)
signal |
Numeric vector of finite real values without |
samplingInterval |
Sampling interval in seconds, a finite number greater than zero, without default. Mask frequencies are in Hz. |
masking |
Named list with the field
|
sifting |
Named list of sifting controls, as in
|
From r_0 = x, before stage k the decomposition ends, in this
order, with "terminalResidue" when r_{k-1} has at most one
extremum, with "modeLimit" when k - 1 equals
sifting$maxModes or the schedule of masks is exhausted, and with
"insufficientExtrema" when the envelopes of r_{k-1} cannot be
built. Otherwise the masks of stage k are
a_k \cos(2 \pi f_k n \Delta t + \theta_p), n = 0, \ldots, N - 1,
with the first sample as phase origin, and the mode is the average of the
first sifted component of r_{k-1} plus each mask,
c_k = \frac{1}{P} \sum_{p=1}^{P} E_1\left(r_{k-1} + w_p\right), \qquad r_k = r_{k-1} - c_k.
A stage is retained unless one of its phases has no first mode or loses
its envelopes during sifting; then the decomposition stops before adding
the stage mean or subtracting it from the residue. A phase that reaches
the iteration limit is kept and flags the stage FALSE. The phases and divisor are unchanged.
The rules fix the phases, frequencies and amplitudes:
"pair"Phases -\pi/2 and \pi/2, so the masks
are \pm a \sin(2 \pi f n \Delta t) and the mode is
(E_1(x + w) + E_1(x - w)) / 2. The schedule has one stage: the
decomposition ends with "modeLimit" after one extraction unless the
residue is terminal.
"dyadic"Phases 0 and \pi;
f_k = 2^{1-k} f_1; amplitude V_m times the mean absolute
value of the maxima of the residue.
"uniformPhase"Phases 2 \pi p / P,
p = 0, \ldots, P - 1; f_k = 1 / (2^k \Delta t); amplitude
\varepsilon_0 times the standard deviation of the residue with
divisor N.
The masks are deterministic: the function draws no random numbers.
A list with
modes |
Double matrix, samples by modes. |
residue |
Numeric vector, the final residue. |
iterations |
Integer vector by mode, the sum of the subtractions of the extractions of the stage. |
converged |
Logical vector by mode: |
stopReason |
|
maskFrequencies |
Numeric vector, the mask frequency of each mode in Hz. |
termination |
Data frame with |
Deering, R. and Kaiser, J. F. (2005). The use of a masking signal to improve empirical mode decomposition. In IEEE International Conference on Acoustics, Speech, and Signal Processing (ICASSP), 4, 485–488.
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.
estimateMaskFrequency,
decomposeIteratedMaskedEMD, decomposeEMD
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)
# Uniform phases, with one sample per second.
OUT <- decomposeMaskedEMD(Signal, samplingInterval = 1,
masking = list(rule = "uniformPhase",
amplitudeRatio = 1, phaseCount = 4),
sifting = Sifting)
OUT$maskFrequencies
OUT$stopReason
# The pair of 2005 at the estimated mask frequency.
Frequency <- estimateMaskFrequency(Signal, samplingInterval = 1,
sifting = Sifting)
Pair <- decomposeMaskedEMD(Signal, samplingInterval = 1,
masking = list(rule = "pair", frequency = Frequency,
amplitude = sqrt(mean((Signal -
mean(Signal))^2))),
sifting = Sifting)
dim(Pair$modes)
Pair$stopReason
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.