Source-linked AI summary

Introducing libeemd: A program package for performing the ensemble empirical mode decomposition

P. J. J. Luukko, J. Helske, E. Räsänen

arXiv:1707.00487v1stat.CO

TL;DR

EMD and the Hilbert-Huang transform analyze potentially nonlinear or nonstationary time series across a range of fields, though EMD’s mathematical foundation remains somewhat lacking. This paper presents libeemd, a free C library with Python and R interfaces implementing EMD, EEMD, and CEEMDAN. The implementation corrects an extrema-handling issue and includes an optimized, parallel CEEMDAN implementation.

  • Problem

    EMD and the Hilbert-Huang transform analyze nonlinear or nonstationary time series across varied fields, while EMD’s mathematical foundation remains somewhat lacking.

    Source: §1 · p. 2
  • Method

    The paper presents a free C library implementing EMD, EEMD, and CEEMDAN, with interfaces for Python and R.

    Source: §1 · p. 2, §5 · pp. 12–13
  • Results

    libeemd corrects a minor equal-data-point issue in the reference implementation and includes the first optimized and parallel implementation of CEEMDAN.

    Source: §5 · p. 13
  • Takeaways & Limitations

    The C implementation and high-level-language interfaces combine low-level speed with the ease and flexibility of higher-level languages.

    Source: §5 · p. 13

    The implementation focuses on free, generic offline data analysis and excludes real-time EMD-like implementations from its comparison.

    Source: §4 · p. 11

Abstract

from arXiv · show

The ensemble empirical mode decomposition (EEMD) and its complete variant (CEEMDAN) are adaptive, noise-assisted data analysis methods that improve on the ordinary empirical mode decomposition (EMD). All these methods decompose possibly nonlinear and/or nonstationary time series data into a finite amount of components separated by instantaneous frequencies. This decomposition provides a powerful method to look into the different processes behind a given time series data, and provides a way to separate short time-scale events from a general trend. We present a free software implementation of EMD, EEMD and CEEMDAN and give an overview of the EMD methodology and the algorithms used in the decomposition. We release our implementation, libeemd, with the aim of providing a user-friendly, fast, stable, well-documented and easily extensible EEMD library for anyone interested in using (E)EMD in the analysis of time series data. While written in C for numerical efficiency, our implementation includes interfaces to the Python and R languages, and interfaces to other languages are straightforward.

1 Introduction

EMD and its noise-assisted variants decompose nonlinear or nonstationary time series into oscillatory components and a residual, helping characterize underlying processes. This work provides a free, accessible implementation of EMD, EEMD, and CEEMDAN.

1 Introduction

  • EMD decomposes potentially nonlinear or nonstationary time series into intrinsic mode functions with meaningful instantaneous frequencies and a residual trend.Combined with Hilbert spectrum analysis, it forms the Hilbert-Huang transform for characterizing underlying processes.Source: §1 · p. 2
  • EMD and the Hilbert-Huang transform have been applied across fields including medicine, finance, speech recognition, and quantum-system detrending.Their mathematical foundation is still described as somewhat lacking.Source: §1 · p. 2
  • EEMD adds noise to separate frequency scales without subjective selection, while CEEMDAN makes the decomposition complete and improves robustness to noisy inputs.EEMD components do not exactly reconstruct the original signal when summed.Source: §1 · p. 2
  • libeemd implements EMD, EEMD, and CEEMDAN as free software intended to be fast, generic, well documented, and accessible.The library is also intended as a basis for existing and future EMD derivatives.Source: §1 · p. 2

2 Algorithms

The algorithms extract intrinsic mode functions by repeatedly removing local means, with implementation choices addressing extrema, envelope boundaries, and stopping. EEMD uses noise-assisted ensembles, while CEEMDAN changes the averaging order to preserve completeness.

2.1 Empirical mode decomposition

  • EMD defines intrinsic mode functions by two conditions and extracts them through repeated sifting, then repeats the process on the residual until it is monotonous.Each sifting step subtracts the mean of spline-interpolated upper and lower envelopes; the residual, sometimes with the lowest-frequency IMFs, can represent trend. Individual IMFs are not guaranteed to correspond to physical time scales.Source: §2.1 · pp. 3–4

2.2 Detection of extrema and zero slopes

  • libeemd treats a flat stretch as one extremum at its center, avoiding the reference implementation’s assignment of equal consecutive points as both maxima and minima.That reference convention can make the lower envelope rise sharply at a local maximum.Source: §2.2 · pp. 4–5, Figure 2 · p. 5

2.3 Spline envelopes

  • The implementation uses cubic splines with nota-knot end conditions for its envelopes, falling back to linear or polynomial interpolation when too few extrema are available.B-splines and piecewise cubic Hermite interpolation are noted as possible future alternatives.Source: §2.3 · pp. 5–6

2.4 End effects

  • Spline extrapolation errors at data boundaries can corrupt IMF ends and propagate inward, so the implementation adds extrema by linear extrapolation of the previous two extrema.If an extrapolated extremum is less extreme than the last data point, that data point is used instead.Source: §2.4 · p. 6

2.5 Stopping criteria

  • The default stopping rule ends sifting when zero-crossing and extrema counts differ by at most one and remain unchanged for S = 4 iterations.A maximum iteration count can prevent oversifting; using only that maximum permits a fixed number of iterations.Source: §2.5 · pp. 6–7

2.6 Ensemble EMD and CEEMDAN

  • EEMD averages decompositions of low-amplitude-noise-perturbed signals to reduce mode mixing, while CEEMDAN averages separately for each IMF so extracted components and the residual reconstruct the input.Finite-ensemble noise does not cancel completely in EEMD; CEEMDAN’s changed averaging order preserves completeness up to numerical precision and may improve recovery of an underlying tone from noisy input.Source: §2.6 · p. 7

3 Implementation details

libeemd combines a portable C99 implementation with Python and R interfaces designed to make EMD-family decompositions accessible in data-analysis workflows. The interfaces expose decomposition controls and outputs, with examples, plotting support, and tests.

3.1 Low-level C library

  • The C99 library prioritizes numerical efficiency and portability, and provides direct C access alongside complete Python and R interfaces.Interfaces to other languages are considered for the future.Source: §3.1 · p. 7
  • The implementation treats a one-number change by 1 as stable under the relaxed condition, without affecting normal EMD operation.Source: §3.1 · p. 7
  • OpenMP parallelizes ensemble members; users can also compile single-threaded, while GSL supplies random-number and basic linear-algebra routines.The library uses GSL for random number generation and basic linear algebra.Source: §3.1 · p. 8

3.2 Python interface

  • pyeemd accepts NumPy arrays or other Python sequences; its M × N output stores IMFs by row, with the residual last.A helper routine supports quick visualization of the IMFs.Source: §3.2 · p. 8
  • Defaults are S-number 4, maximum 50 siftings, ensemble size 250, and noise SD 0.2 times signal SD.Setting ensemble size to 1 and noise strength to 0 provides simple EMD.Source: §3.2 · p. 8
  • pyeemd unit tests check reproduction of the reference EEMD results, except for the equal-data-points case.Source: §3.2 · pp. 8–9

3.3 R interface

  • Rlibeemd integrates the C library through Rcpp, accepts numeric or coercible input, and returns decompositions as mts time-series objects.Source: §3.3 · p. 9
  • In the UK gas example, CEEMDAN returns five IMFs and a trend residual; IMF 1 is seasonal, while IMFs 2–5 are summed as irregular.The resulting components are shown in Fig. 3.Source: §3.3 · p. 9, Figure 3 · p. 10

4 Comparison to other implementations

libeemd offers a portable, open-source C implementation with language interfaces, and its R package substantially outperforms compared implementations in the reported benchmarks.

4 Comparison to other implementations

  • A standard C interface is intended to ease bindings to high-level languages, while low-level C brings speed improvements over interpreted implementations.The authors also emphasize readable, documented, tested code and an open-source license that permits modification and supports further development.Source: §4 · pp. 10–11
  • libeemd provides the first C and Python implementations of CEEMDAN and the first parallelized CEEMDAN implementation, alongside existing implementations described in the paper.The authors identify Wu and Huang’s reference implementation and the hht R package as the other publicly available CEEMDAN implementations known to them.Source: §4 · pp. 10–11
  • The comparison focuses on free, generic software for offline analysis and excludes real-time implementations tailored to specific data or specialized hardware.The reported CEEMDAN benchmark used ECG data, signals of length 100–2000, and ensemble sizes of 50–500.Source: §4 · p. 11, §4.1 · p. 11

4.1 Performance comparison

  • Rlibeemd is approximately two orders of magnitude faster than hht for CEEMDAN; parallelization makes it approximately four times faster than non-parallelized Rlibeemd.Similar results were obtained when varying ensemble size and when comparing EEMD.Source: §4.1 · p. 12, Figure 4 · p. 12
  • Rlibeemd was approximately three orders of magnitude faster than the R package EMD for ordinary EMD decomposition.The comparison used the same overall parameters as the CEEMDAN comparison.Source: §4.1 · p. 12

5 Conclusions

The paper presents libeemd as a free software library implementing EMD, EEMD, and CEEMDAN. Its C core and Python and R interfaces combine low-level speed with high-level-language flexibility.

5 Conclusions

  • libeemd is a free software library implementing EEMD, with ordinary EMD as a special case, and its complete variant CEEMDAN.Source: §5 · p. 12
  • The C library has complete Python and R interfaces, corrects an equal-data-point issue in the reference EEMD implementation, and includes the first optimized parallel CEEMDAN implementation.The authors describe it as a documented basis for existing and future improvements to (E)EMD.Source: §5 · p. 13
Loading 1707.00487v1…