emd
Builtin index · Signal processing
result = emd(x, [max_imfs=])
Input: x, max_imfs · Output: result
What it is
x: a length-N real vector. max_imfs (optional number): caps the number of IMFs extracted. Empirical Mode Decomposition: splits x into oscillatory intrinsic mode functions (IMFs, highest frequency first) plus a residual trend, via the standard sifting algorithm.
Overloads
One call shape — this function is not overloaded.
| Code | Input | Output | Description |
result = emd(x, [max_imfs=]) | x vectorx: a length-N real vector.max_imfs number, optionalmax_imfs (optional number): caps the number of IMFs extracted. | Model —kind "emd"imfs matrixa K×N matrix, one IMF per rowresidual vectora length-N vectorcount numbera number, K | Returns a Model (kind "emd") with fields imfs (a K×N matrix, one IMF per row), residual (a length-N vector), count (a number, K). sum(e.imfs, axis=0) + e.residual reconstructs x exactly. |
Examples
From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.
e = emd(signal)
recon = sum(e.imfs, axis=0) + e.residual # == signal, to floating precision
first_imf = e.imfs[0, :] # the highest-frequency mode
from numerics-dsp
How it works
emd(x, [max_imfs=]) — Empirical Mode Decomposition: splits x into a small number of oscillatory intrinsic mode functions (IMFs, highest frequency first) plus a residual trend, via the standard sifting algorithm. Model kind "emd", fields imfs (a matrix, one IMF per row — e.imfs has zero rows if x had no oscillation to extract at all), residual (a Vec), and count (the number of IMFs). sum(e.imfs, axis=0) + e.residual reconstructs x exactly.
From the note above this builtin in the interpreter, where the reasoning was written down as it was built.