Table of Contents
Fetching ...

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.

Optimal Calibration of the endpoint-corrected Hilbert Transform

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 and a leakage term , enabling a mean-squared-error optimal scalar calibration (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.
Paper Structure (50 sections, 6 theorems, 167 equations, 5 figures, 4 tables, 2 algorithms)

This paper contains 50 sections, 6 theorems, 167 equations, 5 figures, 4 tables, 2 algorithms.

Key Result

Theorem 1

Assume $\abs{G_-}\le \abs{G_+}$ and define $r\in[0,1]$ and $\alpha=\arg G_+$ as above. Let Then for all $\varphi_0\in\mathbb{R}$, Moreover, the amplitude error satisfies the uniform bound

Figures (5)

  • Figure 1: Visual concept of the ecHT algorithm.(A) Finite window cut from a longer signal $x$; the DFT assumes periodic repetition, creating a discontinuity at the boundaries. (B) DFT magnitude $X$ with positive and negative sidebands. (C) Analytic signal spectrum $X^+$ after Hilbert mask removes negative frequencies. (D) The ecHT multiplies $X^+$ with a narrow-band Butterworth response $H$ centred at $f_0$. (E) Time-domain real parts: classical Hilbert (orange) shows endpoint ringing; ecHT (yellow) is closer to the true signal (blue). (F) Instantaneous phase near the endpoint: the ecHT reduces the phase error of the online Hilbert transform at the last sample but has itself a bias.
  • Figure 2: Parameter dependence of the ecHT endpoint phase error and effect of scalar calibration in single-tone simulations. Absolute endpoint phase error (deg) is shown for ecHT (orange) and c-ecHT (blue), with solid lines giving the mean and shaded bands indicating $\pm 1$ SD. If not noted differently: $f_0=10Hz$, $F_s=256Hz$, $N=\operatorname{round}(2.1 F_s/f_0)$, $\text{BW}=[0.7f_0,\, 1.3f_0]$, filter order 2. Window length is chosen slightly imperfectly to simulate realistic conditions. Across all panels, the analytic single-tone calibration reduces systematic phase bias while preserving the variability predicted by the complex-gain and leakage analysis. (A) Dependence on relative filter bandwidth (bandwidth/$f_0$). (B) Filter order. (C) Frequency detuning $\Delta f/f_0$. (D) Input SNR ($\log_{10} y$-axis). (E) Comparison of IIR filter families (Butterworth, Bessel, Chebyshev I & II, Cauer/elliptic; bars show mean, error bars SD). (F) Distribution of absolute endpoint error for non-integer window lengths spanning 1-4 cycles around $f_0$ (half-violins for uncalibrated vs calibrated, markers denote medians).
  • Figure 3: Causal alpha-phase estimation with the ecHT on the HMC sleep EEG dataset.$F_s=256Hz$, $N=2F_s/f_0$, $\text{BW}=[0.7f_0,\, 1.3f_0]$, filter order 2 (A) ecHT shows a systematic phase bias and elevated PLI in the distribution of alpha-band phase errors across all samples. (B) Applying the analytic calibration removes the bulk of this bias, preserves phase locking (PLV), and substantially reduces PLI. (C) Across recordings, the c-ecHT attenuates the dependence of mean phase error on individual alpha-frequency variability, indicating improved robustness to spectral instability.
  • Figure 4: Causal phase estimation with the ecHT on tremor data.$\text{BW}=[0.5f_0,\, 1.5f_0]$, $F_s\approx 500Hz$, $N=128$, filter order 4 (A) ecHT shows a systematic phase bias and elevated PLI in the distribution of phase errors across all samples. (B) Applying the analytic calibration removes the bulk of this bias, preserves phase locking (PLV), and substantially reduces PLI. (C) Across recordings, the c-ecHT attenuates the dependence of mean phase error on frequency variability, indicating improved robustness to spectral instability.
  • Figure 5: Causal tremor-phase estimation with the ecHT on the replication tremor data with centre-frequency tracking.(A) With centre-frequency tracking but without calibration, ecHT shows a slightly higher systematic phase bias and elevated PLI. (B) With analytic calibration and periodic $f_0$ updates, mean phase bias is reduced to 0.1 while PLV is preserved and PLI is strongly reduced. (C) Mean phase error versus tremor frequency variability, showing improved robustness under drift.

Theorems & Definitions (12)

  • Theorem 1: Deterministic phase-ripple and amplitude bounds, Proof Appendix \ref{['sec:det-bounds']}
  • Theorem 2: Mean-square optimal scalar calibration, Proof Appendix \ref{['sec:scalar-calibration-general-proof']}
  • Corollary 1: Correlation form of the minimal MSE, Proof Appendix \ref{['sec:correlation-general-proof']}
  • Corollary 2: Large-sample properties of the empirical calibration, Proof Appendix \ref{['sec:large-sample-conv']}
  • Theorem 3: Optimal scalar calibration for a single tone, Proof Appendix \ref{['sec:scalar-calibration-proof']}
  • proof : Proof of Theorem \ref{['thm:det-bounds']}
  • proof : Proof of Theorem \ref{['thm:scalar-calibration']}
  • proof : Proof of Corollary \ref{['cor:correlation-form']}
  • proof : Proof of Corollary \ref{['thm:asymptotics']}
  • proof : Proof of Theorem \ref{['thm:single-tone-calibration']}
  • ...and 2 more