Module ewt
Expand description
Empirical Wavelet Transform (EWT).
EWT (Gilles, IEEE Trans. Signal Processing, 2013) builds a wavelet filter bank whose pass-bands are adaptively chosen to match the Fourier-spectral structure of the input signal. It is the bridge between wavelet theory and EMD-style data adaptivity: unlike a fixed dyadic DWT/MODWT it places its sub-bands where the signal actually lives in the spectrum, and unlike EMD it offers both exact reconstruction and per-band Parseval simultaneously.
The pipeline is
- compute the half-spectrum magnitude of
x(optionallyln(1 + |·|)); - preprocess the spectrum (
Gaussian,Median, orNone); - detect
Nboundary frequenciesω_n ∈ (0, π)(BoundaryDetection::LocalMaxMinima,BoundaryDetection::Adaptive, orBoundaryDetection::Manual); - resolve the transition-width parameter
γ(GammaStrategy::Autouses Gilles 2013 Eq. 8 with virtual end-pointsω_0 = 0,ω_{N+1} = π); and - build a Meyer scaling function
φ̂_1plusNMeyer waveletsψ̂_1, …, ψ̂_Nwhose squared magnitudes form a partition of unity on[0, π].
Each output band is then exposed in two complementary forms because no
single set of smooth-filter outputs can satisfy both Σ_k c_k = x and
Σ_k ‖c_k‖² = ‖x‖² (the two together force every Ĥ_k(ω) ∈ {0, 1},
i.e. boxcar filters with their attendant Gibbs ringing — see the
“Convention note” below):
EWTResult::components= IFFT(|Ĥ_k|² · X̂)— bandpass modes that reconstruct viaΣ components[k] ≡ xto FFT round-off (becauseΣ |Ĥ_k|² ≡ 1by Meyer construction).EWTResult::coefficients= IFFT(Ĥ_k · X̂)— canonical Gilles 2013 analysis coefficients (W_f(k, t)) that satisfy strict ParsevalΣ_k ‖coefficients_k‖² = ‖x‖²(because the sameΣ |Ĥ_k|² ≡ 1identity, applied band-energy-wise per Parseval, telescopes to‖x‖²).
iewt is a trivial pointwise sum over components; it stays in the
API for symmetry with other transforms’ synthesis functions and so a
future biorthogonal variant can swap in non-trivial synthesis without
breaking callers.
Convention note. The two-array shape is a divergence from issue
#34’s API sketch (which lists only a components field) but is forced
by the math: Σ Ĥ_k(ω) ≡ 1 and Σ |Ĥ_k(ω)|² ≡ 1 jointly imply
Ĥ_k(ω)² = Ĥ_k(ω) for every k, ω, i.e. each filter response is in
{0, 1}. Either we accept boxcar filters (sharp-cut, Gibbs-prone,
no time-localization) or we expose both projections. We chose the
latter; the extra storage is one N × signal_len array and one extra
IFFT per band.
The filter-bank partition of unity Σ |Ĥ_k|² ≡ 1 is exercised by
meyer_partition_of_unity (internal) and
filter_bank_partition_of_unity_holds_via_public_responses
(integration).
§References
- Gilles, J. (2013). Empirical wavelet transform. IEEE Trans. Signal
Processing, 61(16), 3999–4010.
https://doi.org/10.1109/TSP.2013.2265222 — Eq. 8 (γ bound), §III.A
(
LocalMaxMinima), §III.B (Meyer filter construction), and the §IV synthetic AM-FM/chirp signals used by the integration boundary regression. Issue #34 names “Fig. 5” as the boundary reference, but the paper’s Fig. 5 is the Meyer periodicity diagram; the reproducible signal regression uses the published §IV third test signal instead. - Gilles, J., & Heal, K. (2014). A parameterless scale-space approach to
find meaningful modes in histograms. Int. J. Wavelets, Multiresolution
and Information Processing, 12(6).
https://doi.org/10.1142/S0219691314500441 —
Adaptiveboundary detection. - Daubechies, I. (1992). Ten Lectures on Wavelets, SIAM, §4.2.B — the
β(x) = x⁴(35 − 84x + 70x² − 20x³)polynomial used to shape the Meyer transitions. - Reference MATLAB toolbox: https://www.mathworks.com/matlabcentral/fileexchange/42141-empirical-wavelet-transforms.
Structs§
Enums§
- Boundary
Detection - How to locate the
NFourier-domain boundariesω_n ∈ (0, π)that partition the signal’s spectrum into adaptive bands. - Gamma
Strategy - How to choose the Meyer transition-width parameter
γ. - Spectrum
Preproc - Optional smoothing applied to the magnitude spectrum prior to peak
detection. Has no effect on the filter bank itself — only on which peaks
the
BoundaryDetectionsees.