Objective. Real-time approaches for transcranial magnetic stimulation (TMS) based on a specific EEG phase are a promising avenue for more precise neuromodulation interventions. However, optimal approaches to reliably extract the EEG phase in a frequency band of interest to inform TMS are still to be identified. Here, we implement a new real-time phase detection method for closed-loop EEG-TMS for robust phase extraction. We compare this algorithm with state-of-the-art methods and evaluate its performance both in silico and experimentally. Approach. We propose a new robust algorithm (Educated Temporal Prediction) for delivering real-time EEG phase-specific stimulation based on short prerecorded EEG training data. This method estimates the interpeak period from a training period and applies a bias correction to predict future peaks. We compare the accuracy and computation speed of the ETP algorithm with two existing methods (Fourier based, Autoregressive Prediction) using prerecorded resting EEG data and real-time experiments. Main results. We found that Educated Temporal Prediction performs with higher accuracy than Fourier-based or Autoregressive methods both in silico and in vivo while being computationally more efficient. Further, we document the dependency of the EEG signal-to-noise ratio (SNR) on algorithm accuracy across all algorithms. Significance. Our results give important insights for real-time EEG-TMS technical development as well as experimental design. Due to its robustness and computational efficiency, our method can find broad use in experimental research or clinical applications. Through open sharing of code for all three methods, we enable broad access of TMS-EEG real-time algorithms to the community.
- real-time brain stimulation
- transcranial magnetic stimulation
PubMed: MeSH publication types
- Journal Article