A state space modeling approach to real-time phase estimation

Curation statements for this article:
  • Curated by eLife

    eLife logo

    Evaluation Summary:

    Rhythmic activities play an important role in cognition and disease, and there is an increasing interest in real-time phase tracking for closed-loop applications. In this manuscript, a novel approach based on state-space modeling to estimate the phase of EEG and LFP signals in real-time is presented. Open code for distribution is readily available. The proposed model is novel, timely and makes a clear contribution to the methods base in the field.

    (This preprint has been reviewed by eLife. We include the public reviews from the reviewers here; the authors also receive private feedback with suggested changes to the manuscript. Reviewer #1 agreed to share their name with the authors.)

This article has been Reviewed by the following groups

Read the full article See related articles

Abstract

Brain rhythms have been proposed to facilitate brain function, with an especially important role attributed to the phase of low-frequency rhythms. Understanding the role of phase in neural function requires interventions that perturb neural activity at a target phase, necessitating estimation of phase in real-time. Current methods for real-time phase estimation rely on bandpass filtering, which assumes narrowband signals and couples the signal and noise in the phase estimate, adding noise to the phase and impairing detections of relationships between phase and behavior. To address this, we propose a state space phase estimator for real-time tracking of phase. By tracking the analytic signal as a latent state, this framework avoids the requirement of bandpass filtering, separately models the signal and the noise, accounts for rhythmic confounds, and provides credible intervals for the phase estimate. We demonstrate in simulations that the state space phase estimator outperforms current state-of-the-art real-time methods in the contexts of common confounds such as broadband rhythms, phase resets, and co-occurring rhythms. Finally, we show applications of this approach to in vivo data. The method is available as a ready-to-use plug-in for the Open Ephys acquisition system, making it widely available for use in experiments.

Article activity feed

  1. Author Response:

    Reviewer #2:

    Wodeyar and colleagues describe a new method for phase estimation and compare their method to a range of previously published approaches. Using a state space model, they separately model the signal and noise, and demonstrate accurate phase tracking for broadband signals, and in the presence of multiple rhythms and phase-resets.

    The major strength of the manuscript is the ability to track broadband signals without the need to use bandpass filters and to better distinguish between multiple rhythms, even those which are quite close in frequency. The methods and results segments are very well written and describe the approach in great detail. The manuscript also allows the reader to compare multiple methods, commonly used in the field. Processing rhythms without the need for a threshold based method is an added contribution of the method.

    The main weaknesses of the manuscript are (1) not being able to compensate for non stationary rhythms (2) and in-vivo phase estimation accuracy. For real-time closed loop phase-locked stimulation, stimulation itself has been shown to speed-up / slow down target rhythms depending on the stimulation angle, and also different rhythms have been shown to drift over time, therefore compensating for non stationary centre frequencies could be critical for such applications. Based on previously published phase-locked stimulation papers, an average 60 degree phase estimation accuracy (in vivo) may not be sufficient to determine effective stimulation parameters.

    While the paper makes a great contribution to phase estimation by removing the dependency on filters, whether or not this would actually improve applications (with respect to already trialled approaches) remains unclear.

    In the revised manuscript, we now discuss these two important points raised by the Reviewer, and how the method developed here can help address these points:

    (1) If we have understood the Reviewer correctly, the concern is that the underlying statistics/distribution of the rhythmic parameters vary over time, e.g., the central frequency and/or bandwidth of the rhythm may vary over time. The SSPE method, by virtue of the model structure (which permits stochastic frequency modulation) and the Kalman Filter (correcting the instantaneous frequency to better fit the observation) can track small changes in the center frequency. However, to the best of our knowledge, no current method for real-time phase estimation performs well with non-stationary rhythms. A potential future approach would incorporate an extended Kalman Filter that adjusts parameters of the model while filtering the state.

    We have updated the Discussion to include this important point as follows:

    Discussion, Limitations and Future Directions: “... Rhythms, observed over time, may be better represented by models with changing parameters. Indeed, non-stationarity is an important issue to consider when tracking brain rhythms. The SSPE method is robust (by virtue of the model structure and application of the Kalman Filter) to small changes in the central frequency or the bandwidth of a rhythm (e.g., Figure 2). However, non- stationary rhythms require new algorithms to be developed (such as the PLSO method in Song et al., 2020). An extension of the SSPE method that could potentially track changing central frequencies is to apply an extended Kalman Filter (Schiff, 2012) that simultaneously estimates the frequencies of interest while filtering the state. To address this, The SSPE method could also be extended to implement a switching model that utilizes multiple sets of parameters and switches between parameter sets as necessary, or by refitting the SSPE model as time evolves. ...”

    (2) To address the issue of in-vivo phase estimation accuracy, we first note that, in the original manuscript, we estimated the error in phase using all in-vivo data, which effectively serves as an upper bound on the possible error when estimating phase in real time. In the revised manuscript, we now consider an additional constraint of thresholding based on the credible interval width. Doing so, we find that the accuracy of the SSPE method dramatically improves. We include this new analysis in the Results:

    Results, Confidence in the Phase Estimate: “... at other times - when the theta rhythm is less obvious - the credible intervals expand. We can restrict error in the phase estimate by examining only samples with small CI width. When thresholding at 10 degrees of credible interval width, we find that the error decreases from (mean) 46.9 (s.e. 0.89) degrees to 26.91 (s.e. 1.07) degrees, while still retaining 27 percent of the data. This is within the current state-of-the-art in phase estimation with minimum of 20 to 40 degrees error as a function of SNR (when applying a sufficiently high amplitude threshold, Zrenner et al., 2020).”

    Additionally, for the second in-vivo analysis of the EEG mu rhythm we have added a similar analysis:

    Results, Example in-vivo Application: human EEG: “... When a strong mu rhythm emerges, tight credible intervals surround the mean phase estimate tracking the rhythm of interest; as the mu rhythm wanes, the credible intervals expand. When we restrict analysis to samples with credible interval width less than 25 degrees, the error drops from 40.5 (s.e. 1.1) to 11.2 (s.e. 0.46) degrees while still retaining 16.4 percent of the data. As with the LFP, we are able to assess certainty in our phase estimates using the credible intervals.”

  2. Reviewer #3 (Public Review):

    Wodeyar et al. suggest a new method for estimating the phase of oscillatory signals in real-time, based on a state-space objective. They test their approach in simulations and data and present evidence for higher accuracy compared to standard methods based on band-pass filtering. While I especially find the possibility of credible intervals highly interesting in this context, the relationship of credible intervals to an amplitude criterion threshold criterion, customary employed by standard approaches should be elucidated more, it's not clear to whether this practically results in very similar outcomes. In addition, it would be good to see clarifications on the underlying data generating process and physiological motivation for the provided simulations. It would increase accessibility of the manuscript, if the text would be more self-contained & more methodological details were included.

  3. Reviewer #2 (Public Review):

    Wodeyar and colleagues describe a new method for phase estimation and compare their method to a range of previously published approaches. Using a state space model, they separately model the signal and noise, and demonstrate accurate phase tracking for broadband signals, and in the presence of multiple rhythms and phase-resets.

    The major strength of the manuscript is the ability to track broadband signals without the need to use bandpass filters and to better distinguish between multiple rhythms, even those which are quite close in frequency. The methods and results segments are very well written and describe the approach in great detail. The manuscript also allows the reader to compare multiple methods, commonly used in the field. Processing rhythms without the need for a threshold based method is an added contribution of the method.

    The main weaknesses of the manuscript are (1) not being able to compensate for non stationary rhythms (2) and in-vivo phase estimation accuracy. For real-time closed loop phase-locked stimulation, stimulation itself has been shown to speed-up / slow down target rhythms depending on the stimulation angle, and also different rhythms have been shown to drift over time, therefore compensating for non stationary centre frequencies could be critical for such applications. Based on previously published phase-locked stimulation papers, an average 60 degree phase estimation accuracy (in vivo) may not be sufficient to determine effective stimulation parameters.

    While the paper makes a great contribution to phase estimation by removing the dependency on filters, whether or not this would actually improve applications (with respect to already trialled approaches) remains unclear.

  4. Reviewer #1 (Public Review):

    The phase of a signal (similar to its amplitude) is a significant and informative feature that helps for a better representation of time-series data. In Neuroscience, and in the context of neural oscillations, the phase of neural signals (for example EEG and LFP) plays an important role in understanding mechanisms underlying brain rhythms. The author of this paper proposed a novel approach to track the phase of neural signals in real-time. This approach is inspired by [Matsuda and Komaki, 2017] and employs the well-known state-space modeling framework. Using several synthetic data, it was shown that the proposed approach outperforms other methods in the literature which are based on band-pass filtering (not appropriate for broadband rhythms). The simulation studies were designed to demonstrate the strength of the state-space phase estimation approach vs. two recent methods in the context of common confounds such as broadband rhythms, phase resets, and co-occurring rhythms. As well, the state-space phase estimator was applied to in-vivo data including two datasets: (1) rodent LFP and (2) human EEG. Furthermore, the authors made their proposed method available online in the form of MATLAB code as well as a ready-to-use plug-in for the OpenEphys acquisition system. This effort is very much appreciated as it provides the code available for further theoretical and experimental studies.

    While the proposed method is very novel and timely, it would be helpful for the authors to: (i) consider the impact of noise in the phase estimation, (ii) describe specifications of the Kalman filter and its robustness, and (iii) consider the performance of the estimated phase relative to other methods.

  5. Evaluation Summary:

    Rhythmic activities play an important role in cognition and disease, and there is an increasing interest in real-time phase tracking for closed-loop applications. In this manuscript, a novel approach based on state-space modeling to estimate the phase of EEG and LFP signals in real-time is presented. Open code for distribution is readily available. The proposed model is novel, timely and makes a clear contribution to the methods base in the field.

    (This preprint has been reviewed by eLife. We include the public reviews from the reviewers here; the authors also receive private feedback with suggested changes to the manuscript. Reviewer #1 agreed to share their name with the authors.)