Skip to contents

Decomposes a two-channel signal, read as the complex signal \(z = x_1 + i x_2\), by successive extraction of bivariate modes with envelopes built on projections onto equally spaced directions of the plane.

Usage

decomposeBEMD(signal, directionCount = 64, envelope, sifting)

Arguments

signal

Numeric matrix of finite real values with two columns, the real and the imaginary parts, samples in rows.

directionCount

Whole number \(D \ge 1\) of directions \(\varphi_d = 2 \pi (d - 1) / D\); default 64, the default of Rlibeemd bemd and of emdr memd.

envelope

Mean of the sifting, without default: "trajectory" averages the envelopes of the trajectory itself at the maxima of each projection; "projection" sums the envelopes of the projections, oriented on their directions, with the factor \(2/D\).

sifting

Named list of sifting controls, as in decomposeEMD, with stopRule = "fixed" only. The trajectory envelope admits only boundary = "reflection"; the projection envelope also admits "extrapolation".

Details

The projection on direction \(\varphi_d\) is \(p_d = x_1 \cos\varphi_d + x_2 \sin\varphi_d\). With "trajectory", \(e_d\) interpolates the two-dimensional samples at the maxima of \(p_d\) and the mean is $$m = \frac{1}{D} \sum_{d=1}^{D} e_d;$$ with "projection", the scalar upper envelope of \(p_d\) is oriented on \((\cos\varphi_d, \sin\varphi_d)\) and the sum is scaled by \(2/D\). Each extraction subtracts the mean fixedSift times. Before extraction \(k\) the decomposition ends with "terminalResidue" when every projection of \(r_{k-1}\) has at most one extremum, with "modeLimit" when \(k - 1\) equals sifting$maxModes, and with "insufficientExtrema" when a direction has no envelope. One extraction serves both channels, so they share the number of modes. If a direction loses its envelope before fixed sifting completes, the decomposition stops before adding that vector candidate and preserves the residue from before the attempt. A candidate that reaches the iteration limit of an adaptive rule is kept and flagged FALSE. Directions are not dropped from the mean.

Value

A list with

modes

Double array, samples by modes by channels.

residue

Numeric matrix, samples by channels.

iterations

Integer vector, the subtractions of each mode.

converged

Logical vector by mode: NA after the fixed number of subtractions. Interrupted attempts are reported in termination.

stopReason

"terminalResidue", "modeLimit" or "insufficientExtrema".

termination

Data frame with one row: mode, the next extraction index after the retained modes; direction, the one-based index of the first direction without an envelope, or NA when none failed; iterations, subtractions of the interrupted attempt, zero if it did not start; and stopReason.

References

Rilling, G., Flandrin, P., Gonçalves, P. and Lilly, J. M. (2007). Bivariate Empirical Mode Decomposition. IEEE Signal Processing Letters, 14, 936–939.

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 <- 2 * pi * (0:511) / 512
z <- cos(0.3 * Time) * exp(2i * Time) +
    0.3 * abs(sin(2.3 * Time)) * exp(17i * Time)
Signal <- cbind(Re(z), Im(z))
OUT <- decomposeBEMD(Signal, directionCount = 64, envelope = "projection",
                     sifting = list(stopRule = "fixed", fixedSift = 10,
                                    boundary = "extrapolation",
                                    maxModes = 3))
dim(OUT$modes)
#> [1] 512   3   2
OUT$stopReason
#> [1] "modeLimit"
max(abs(apply(OUT$modes, c(1, 3), sum) + OUT$residue - Signal))
#> [1] 2.220446e-16