"Fourier hands me a basis and asks the signal to conform. EMD asks the signal what it is, then listens."
An Adaptive AI Agent
The big picture
Every representation you have met so far in this chapter fixes its basis before it sees your data. The Fourier transform of Section 7.1 assumes stationary sinusoids; the wavelets of Section 7.3 assume a fixed mother shape dilated across scales. Real sensor signals rarely oblige. A footstep on an accelerometer, an arrhythmic heartbeat, a bearing spalling under load: these are nonlinear and nonstationary, with instantaneous frequencies that drift within a single cycle. Empirical mode decomposition (EMD) inverts the usual contract. Instead of projecting onto a predetermined dictionary, it lets the data define its own oscillatory components, called intrinsic mode functions, directly from the local extrema. Pair that decomposition with the Hilbert transform and you get the Hilbert-Huang transform (HHT), a fully data-driven time-frequency picture. This section explains what an intrinsic mode function is, why the sifting algorithm produces one, how to read a Hilbert spectrum, and when this adaptive power is worth its well-known fragility.
This section assumes you are comfortable with the analytic-signal and instantaneous-frequency ideas introduced alongside sampling in Chapter 3, and with the leakage and windowing tradeoffs from Section 7.1. If the Hilbert transform is unfamiliar, the analytic-signal box below is self-contained enough to follow.
Intrinsic mode functions: letting the signal pick its own basis
The Hilbert transform can assign an instantaneous frequency to any signal, but the number is only physically meaningful when the signal is locally symmetric about zero and contains exactly one oscillation per zero crossing. Huang and colleagues formalized this with the intrinsic mode function (IMF), a component satisfying two conditions: the number of extrema and the number of zero crossings differ by at most one, and at every point the mean of the upper envelope (through the maxima) and the lower envelope (through the minima) is zero. An IMF is what a "well-behaved oscillation with a slowly varying amplitude and frequency" looks like when you refuse to name a carrier frequency in advance.
Why insist on the zero-mean-envelope property? Because the Hilbert transform of a signal riding on a slow trend produces nonsensical negative or wildly swinging instantaneous frequencies. The IMF condition guarantees the analytic signal traces a clean, mostly-positive-radius spiral in the complex plane, so that differentiating its phase gives a frequency you can trust. This is the crucial difference from Fourier: an IMF may change both its amplitude and its frequency from one cycle to the next, which a fixed sinusoid can never do.
Sifting: the algorithm that manufactures an IMF
EMD extracts IMFs one at a time with an iterative procedure called sifting. Given a signal \(x(t)\), you find all local maxima and interpolate them with a cubic spline to form the upper envelope \(e_{\max}(t)\); do the same for the minima to get \(e_{\min}(t)\). Their mean is a local trend
$$m(t) = \tfrac{1}{2}\bigl(e_{\max}(t) + e_{\min}(t)\bigr),$$and the candidate detail is \(h(t) = x(t) - m(t)\). If \(h\) already satisfies the IMF conditions you stop; otherwise you treat \(h\) as the new signal and repeat. Sifting is halted by a stoppage criterion, classically a Cauchy-type test on the normalized change between successive siftings,
$$\mathrm{SD} = \sum_{t} \frac{\lvert h_{k-1}(t) - h_{k}(t)\rvert^{2}}{h_{k-1}^{2}(t)} < \varepsilon,$$with \(\varepsilon\) commonly near 0.2 to 0.3. Once an IMF \(c_1(t)\) emerges, you subtract it, \(r_1(t) = x(t) - c_1(t)\), and sift the residual for the next, lower-frequency IMF. The loop ends when the residual becomes monotone or has too few extrema to interpolate. The result is a fully reconstructing decomposition
$$x(t) = \sum_{i=1}^{n} c_i(t) + r_n(t),$$where the IMFs \(c_i\) run from fastest to slowest oscillation and \(r_n\) is the residual trend. Unlike a filter bank, no band edges were chosen; the extrema of your data alone set the partition.
Key insight: adaptivity is a double-edged sword
Because the envelopes are recomputed from the data at every step, EMD adapts to a chirp, a transient, or a slow drift without any parameter tuning. That same data dependence makes it fragile: a little added noise moves the extrema, which moves the splines, which can move a single oscillation from IMF 3 into IMF 4. This is mode mixing, and it is the reason vanilla EMD is rarely deployed alone. The fix, ensemble EMD (EEMD), adds many independent white-noise realizations, decomposes each, and averages the IMFs; the noise populates the extrema uniformly across scales so the true components land in consistent IMFs while the added noise averages toward zero. Its refinement, complete ensemble EMD with adaptive noise (CEEMDAN), adds the noise stage by stage for a near-exact reconstruction. When someone reports "EMD" in a modern pipeline, they almost always mean EEMD or CEEMDAN.
From IMFs to the Hilbert spectrum
Decomposition is only half of the Hilbert-Huang transform. For each IMF \(c_i(t)\) you form the analytic signal \(z_i(t) = c_i(t) + j\,\mathcal{H}\{c_i\}(t) = a_i(t)\,e^{j\theta_i(t)}\), where \(\mathcal{H}\) is the Hilbert transform. The instantaneous amplitude is \(a_i(t) = \lvert z_i(t)\rvert\) and the instantaneous frequency is
$$\omega_i(t) = \frac{d\theta_i(t)}{dt}.$$Plotting amplitude (or its square, energy) as a function of both time and this instantaneous frequency produces the Hilbert spectrum \(H(\omega, t)\). Integrating it over time gives the marginal spectrum, an energy-versus-frequency curve that looks like a Fourier power spectrum but earns its frequency axis from local phase rather than from global sinusoidal projection. The payoff is resolution: a spectrogram (Section 7.2) smears energy across a window's worth of time and a bin's worth of frequency, while the Hilbert spectrum can place a sharp ridge exactly where the instantaneous frequency is, unconstrained by the uncertainty-principle box of the short-time Fourier transform. The cost is that this sharp picture is only trustworthy when the IMFs are clean, which loops you straight back to mode mixing.
Practical example: catching a bearing fault that hides from the FFT
A wind-turbine gearbox streams a 25.6 kHz accelerometer. The outer-race fault frequency sits near 162 Hz, but the machine changes rotor speed constantly, so a plain FFT smears that tone across a wide, unreadable hump: the defect is nonstationary because the speed is. The condition-monitoring team runs CEEMDAN, and the impulsive fault energy concentrates into the second and third IMFs. The Hilbert spectrum of those IMFs shows a bright ridge that tracks the 162 Hz line as it slides with rpm, along with its harmonics, days before the trend alarm in the vibration RMS would have fired. This is exactly the kind of nonstationary, modulated signature that the predictive-maintenance workflows of Chapter 36 depend on, and it pairs naturally with the envelope and cepstral tools you will meet in Section 7.5.
Doing it in practice, and where the shortcut lives
Writing a correct sifting loop with spline envelopes, boundary handling, and a defensible stoppage rule is a day of careful work and a longer day of debugging edge effects. In practice you reach for a maintained library. The code below decomposes a two-tone chirp-plus-trend signal with CEEMDAN and reads off the instantaneous frequency of the first IMF; the same eight lines would replace roughly 150 lines of hand-rolled sifting, envelope interpolation, and ensemble bookkeeping.
import numpy as np
from PyEMD import CEEMDAN # pip install EMD-signal
from scipy.signal import hilbert
fs = 1000
t = np.arange(0, 2, 1 / fs)
# a rising chirp, a steady tone, and a slow drift, all superimposed
x = (np.sin(2*np.pi*(5 + 15*t)*t) # 5 -> 35 Hz chirp
+ 0.6*np.sin(2*np.pi*40*t) # steady 40 Hz tone
+ 0.3*t) # low-frequency trend
imfs = CEEMDAN().ceemdan(x, t) # data-driven; no band edges chosen
phase = np.unwrap(np.angle(hilbert(imfs[0])))
inst_freq = np.diff(phase) / (2*np.pi) * fs # instantaneous frequency, Hz
print(f"{imfs.shape[0]} IMFs; IMF-1 mean inst. freq "
f"{inst_freq[fs//4:-fs//4].mean():.1f} Hz")
Library shortcut: EMD-signal (PyEMD)
The EMD-signal package (imported as PyEMD) ships EMD, EEMD, and CEEMDAN with vetted spline envelopes, boundary mirroring, ensemble noise scaling, and stoppage criteria already tuned. A from-scratch, correct CEEMDAN with edge handling is roughly 150 lines; here it is one constructor and one call. The library also parallelizes the ensemble, which matters because CEEMDAN reruns EMD hundreds of times. Treat the noise-strength and trial-count settings as the parameters you actually tune, and keep them fixed across a dataset for reproducibility, in line with the leakage-safe habits from Chapter 5.
When to reach for HHT, and when not to
Choose the Hilbert-Huang transform when the signal is genuinely nonlinear or nonstationary and you need instantaneous behavior a fixed basis cannot express: swallowing and gait segments in a wearable inertial stream (Chapter 2 explains why those sensors produce such signals), motor-unit bursts in EMG, speed-varying machine vibration, or seismic and oceanographic records where HHT was born. Prefer a wavelet transform when you want a stable, orthogonal, invertible decomposition with a mathematical error bound, and prefer the STFT when you need a fast, interpretable, well-understood spectrogram for a roughly stationary signal. The honest weaknesses of EMD are real and worth stating plainly: it has no complete theory, its output depends on interpolation and stoppage choices, mode mixing can scramble physical meaning, and ensemble variants cost a great deal of compute. Use it where its adaptivity buys you something the fixed bases cannot, validate the IMFs against physics, and never treat an IMF as ground truth without checking it.
Exercise
Build a test signal that is a 20 Hz tone for the first second and a 60 Hz tone for the second second (a hard switch, not a blend). Decompose it three ways: plain EMD, EEMD, and CEEMDAN. For each, plot the first two IMFs and mark where the 20 Hz and 60 Hz energy landed. Which method keeps the two tones in separate, consistent IMFs, and which one lets the switch bleed one tone across two IMFs? Now add white noise at 10 dB SNR and repeat. Explain, in terms of extrema placement, why the ensemble methods degrade more gracefully.
Self-check
- State the two conditions a signal must satisfy to be an intrinsic mode function, and explain why the zero-mean-envelope condition is what makes its instantaneous frequency meaningful.
- What is mode mixing, and by what mechanism does adding white noise (EEMD, CEEMDAN) reduce it rather than make it worse?
- The Hilbert spectrum can look sharper than a spectrogram of the same signal. Give one reason that sharpness is genuine information and one reason it can be an artifact.
What's Next
In Section 7.5, we turn to cepstral and envelope analysis, the workhorse pair for machines with periodic structure. Where HHT chases instantaneous frequency, the cepstrum unwraps periodicities-of-periodicities to expose gear-mesh sidebands and harmonic families, and envelope demodulation isolates the impulsive signature of a spalling bearing. Together they complete the rotating-machinery toolkit that this section only opened.