🤖 AI Summary
This work addresses the boundary-induced systematic phase and amplitude biases in real-time phase estimation using endpoint-corrected Hilbert transform (ecHT). For the first time, a closed-form analytical expression of the ecHT endpoint error is derived, decomposing the output into a deterministic, calibratable gain term and an irreducible residual leakage term. Building on this decomposition, the authors propose a mean-square-error-optimal calibration method (c-ecHT) along with practical design guidelines. By integrating causal narrowband filtering, analytic signal processing, and group delay analysis, the approach substantially reduces phase estimation bias, achieving near-zero-mean phase error while maintaining low computational complexity—making it well-suited for real-time closed-loop neuromodulation and similar applications.
📝 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.