The Hilbert Transform converts a real-valued narrowband EEG signal into a complex analytic signal. This mathematical transformation separates a continuous oscillation into two instantaneous, time-varying properties: its amplitude envelope (how strong the oscillation is at each millisecond) and its instantaneous phase (where the wave is in its cycle: peak, trough, or slope).
The Analytic Signal
Real + j · Imaginary
Given a real narrowband signal x(t), the Hilbert transform produces a 90° phase-shifted signal xH(t). Combining them forms the complex analytic signal:
z(t) = x(t) + i · xH(t) = A(t) · exp(i · φ(t))
• Instantaneous Amplitude A(t): np.abs(z) — the envelope of the signal.
• Instantaneous Phase φ(t): np.angle(z) — values from −π to +π.
Filter-Hilbert vs Wavelet Equivalence (Cohen ANTS Ch. 14): Bandpass filtering a signal followed by a Hilbert transform yields mathematically equivalent amplitude and phase estimates to Morlet wavelet convolution, provided the filter kernel matches the Gaussian shape of the wavelet!
Python Implementation
Filtering and Extracting Envelopes
from scipy.signal import hilbert import numpy as np # 1. Bandpass filter in narrow frequency range (e.g. Alpha 8-12 Hz) raw_alpha = raw.copy().filter(l_freq=8.0, h_freq=12.0) signal = raw_alpha.get_data(picks='Oz')[0] # 2. Compute analytic signal analytic = hilbert(signal) # 3. Extract envelope and phase amplitude_envelope = np.abs(analytic) instantaneous_phase = np.angle(analytic) # Power is envelope squared instantaneous_power = amplitude_envelope ** 2
Mandatory Rule: Never apply the Hilbert transform to broadband data! Without narrow bandpass filtering first, the concept of instantaneous phase and amplitude becomes mathematically undefined and produces meaningless noise.