Optimal Calibration of the endpoint-corrected Hilbert Transform
Eike Osmers, Dorothea Kolossa
TL;DR
The paper tackles the challenge of low-latency, accurate instantaneous phase estimation in real-time systems by analyzing the endpoint distortions of the endpoint-corrected Hilbert transform (ecHT). It derives an analytic endpoint operator that decomposes the ecHT output into a deterministic positive-frequency gain $G_+$ and a leakage term $G_-$, enabling a mean-squared-error optimal scalar calibration $C_{opt}$ (the c-ecHT). It then provides practical design rules linking window length, bandwidth, center frequency, and sampling to the residual bias via endpoint group delay, along with a data-driven calibration procedure and theoretical guarantees. Empirical results on simulations, EEG alpha-phase data, and tremor-phase recordings show that c-ecHT achieves near-zero mean phase error while preserving phase-locking, enabling robust real-time closed-loop applications; code is available at the project repository.
Abstract
Accurate, low-latency estimates of the instantaneous phase of oscillations are essential for closed-loop sensing and actuation, including (but not limited to) phase-locked neurostimulation and other real-time applications. The endpoint-corrected Hilbert transform (ecHT) reduces boundary artefacts of the Hilbert transform by applying a causal narrow-band filter to the analytic spectrum. This improves the phase estimate at the most recent sample. Despite its widespread empirical use, the systematic endpoint distortions of ecHT have lacked a principled, closed-form analysis. In this study, we derive the ecHT endpoint operator analytically and demonstrate that its output can be decomposed into a desired positive-frequency term (a deterministic complex gain that induces a calibratable amplitude/phase bias) and a residual leakage term setting an irreducible variance floor. This yields (i) an explicit characterisation and bounds for endpoint phase/amplitude error, (ii) a mean-squared-error-optimal scalar calibration (c-ecHT), and (iii) practical design rules relating window length, bandwidth/order, and centre-frequency mismatch to residual bias via an endpoint group delay. The resulting calibrated ecHT achieves near-zero mean phase error and remains computationally compatible with real-time pipelines. Code and analyses are provided at https://github.com/eosmers/cecHT.
