Abstract
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.
Keywords: Transcranial magnetic stimulation, Electroencephalography, Real-time brain stimulation
1. Introduction
Large-scale brain activity undergoes ongoing cyclical changes resulting from neural activity interaction of cellular and circuit properties (Buzsáki and Draguhn, 2004). These neural oscillations represent rhythmic alternations between high and low excitability brain states (Schroeder and Lakatos, 2009). Electroencephalography (EEG) enables us to noninvasively record these brain oscillations, which are capturing the synchronous activity of neural ensembles (Buzsáki et al., 2012). The instantaneous phase of brain oscillations is an important feature of neural processing (Alekseichuk et al., 2016; Jacobs et al., 2007; Maris et al., 2016; Sauseng and Klimesch, 2008; Thut et al., 2012). Thus, it can serve as an indicator of brain excitability to inform the timing of brain stimulation delivery such as Transcranial Magnetic Stimulation (TMS).
TMS is a non-invasive brain stimulation method that induces strong short-lasting electric fields in the brain (Barker et al., 1985). A TMS pulse is generated by passing a high-intensity electrical current through an inductive coil to create a magnetic field that penetrates the skull and induces a secondary electric field in the brain, which modulates neural activity (Hallett, 2007; Opitz et al., 2011). TMS is being increasingly explored as a tool to modulate brain activity for the treatment of neurological and psychiatric disorders (Lefaucheur et al., 2014). The combination of TMS with EEG can improve stimulation protocols by tailoring them to the individual’s ongoing brain state (Bergmann et al., 2016; Thut et al., 2017).
Numerous studies have assessed the relationship between ongoing EEG oscillations and physiological responses to TMS. For instance, Romei et al., 2008 reported that for the same TMS stimuli, phosphene induction is increased for lower prestimulus alpha power in posterior brain regions. Dugué et al., 2011 found a higher probability of TMS-induced phosphenes during the peaks of occipital alpha oscillations. Reports on whether EEG power and/or phase are relevant markers of corticospinal excitability for TMS motor evoked potentials (MEPs) are mixed in the literature e.g. (Berger et al., 2014; Hussain et al., 2019; Keil et al., 2013; Schulz et al., 2014). However, the inferences to be drawn from these studies are limited, as they employed a post hoc analysis of EEG data, thus, not allowing a direct causal test of current EEG brain states on TMS responses.
Real-time EEG-TMS methods that deliver stimulation based on the present brain state have the potential to overcome the limitations of previous EEG-TMS studies. Further, they can potentially deliver more efficient brain stimulation and improve research and clinical outcomes (Karabanov et al., 2016; Polanía et al., 2018; Zrenner et al., 2016). Recent implementations of such real-time EEG-TMS systems delivered TMS based on the phase and power of the EEG mu-rhythm to study MEP corticomotor excitability (Madsen et al., 2019; Zrenner et al., 2018). Further, alpha-synchronized TMS over the dorsolateral prefrontal cortex (DLPFC) has been investigated for depression treatment (Zrenner et al., 2019).
While real-time approaches are a promising technology, they come with a set of technical challenges. In particular, it is difficult to extract the instantaneous phase of the recorded EEG signals accurately in real-time. One main problem of any real-time processing system compared to offline methods is the trade-off between speed and accuracy. Since the data needs to be processed within a limited time window, algorithms have to be computationally fast, even at the cost of accuracy. Another problem is that during real-time computations, we are limited by causality in signal processing, which means that future signal samples are not available for processing such as filtering. In signal processing, band-pass filters extract the frequency bands of interest (e.g. alpha, beta). These filters invariably introduce artifacts around the edges of the available time-series. Since only data recorded up until the current time point are available, causal filtering inevitably distorts the data and its phase at the current moment. Thus, it is necessary to predict the signal and phase based on the currently available undistorted data from the near past, which can also compensate for any hardware delays.
Multiple methods have been proposed for EEG forward prediction. Since continuous EEG signals to a certain degree are nonsinusoidal and nonstationary (Cole and Voytek, 2017; Mäkinen et al., 2005), this is a challenging problem. Two main methods have been suggested for real-time phase-dependent EEG-TMS: 1) Forward prediction in the time domain. Here, the algorithm uses temporal patterns in a short time window (e.g. the last 0.5 seconds of recorded data) in a frequency band of interest to predict the signal waveform for future time periods. One particular implementation is the autoregression model-based prediction (Chen et al., 2013). 2) Forward prediction in the frequency domain. Here, the signal is projected into the Fourier domain to capture the main sinusoidal (Mansouri et al., 2017) or wavelet component (Madsen et al., 2019) to be used for phase extrapolation.
While these methods have been successfully implemented for real-time phase prediction, they have certain drawbacks. Commonly used autoregressive (AR) predictions in the temporal domain need careful parameter optimizations, have high computational demand, and need high signal power in the frequency band of interest which can lead to the exclusion of participants (Zrenner et al., 2018). Frequency-domain algorithms, like in Mansouri et al., 2017 are computationally effective and relatively parameter-free, but their accuracy relies on the periodicity and harmonicity of the brain signal.
To overcome existing accuracy-complexity trade-offs, we propose a third, conceptually independent method that is parameter-free, fast, and provides a higher accuracy compared to the existing methods. This algorithm, named Educated Temporal Prediction (ETP) leverages a short training session before the real-time application to learn each individual’s statistical features of the target brain oscillation. Unlike the first two methods that only use data in the current time window for forward prediction, ETP utilizes pre-learned features for faster and more accurate prediction. Since this algorithm is trained on more data (~minutes) than it has access to during real-time processing (~ 1 second), it can be more robust to compensate for occasional reductions in signal quality. In our current implementation, the ETP algorithm relies on a basic statistical characteristic of phasic data – the central moment of the inter-peak intervals in the time domain. The goal of this study is to compare all algorithms using in silico and in vivo real-time implementations.
2. Methods
2.1. Phase Prediction Algorithms
Several different classes of algorithms to detect and predict the EEG phase for TMS closed-loop stimulation have been proposed in the literature. Below we summarize the key principles for (a) Fast Fourier Transform (FFT) based prediction, (b) Autoregressive (AR) forecasting, and (c) newly suggested Educated Temporal Prediction (ETP). In this study, we used a Laplacian montage (Hjorth, 1980) (Figure 1E) with a central electrode of interest and eight surrounding electrodes as the brain signal for the region of interest. However, since the algorithms are independent with respect to the electrode setup, other montages can be used, provided they capture the local brain signal of interest.
Figure 1.

Algorithm implementation. (A) FFT algorithm. Left panel: The raw data (black) is band-pass filtered (purple). Right panel: the filtered data is Fourier transformed (purple), the frequency and phase of the dominant frequency are calculated (red). A sine wave with the calculated frequency and phase is used for forward prediction (red, left panel). (B) AR algorithm. The raw data (black) is band-pass filtered (blue). Signal edges on both sides are removed (gray). The autoregressive model is estimated and the signal is predicted (dotted red). The phase of the predicted signal is calculated using the Hilbert transform (Solid red). (C) ETP training. During the learning phase, the first half of the resting state data is band-pass filtered and the distances between peaks are calculated. The median of the peak periods are calculated as the initial interpeak interval T. The second half of the resting-state data is used for the validation phase, the data is segmented into smaller epochs and the peaks are forward projected using T. The predicted peaks are compared with the ground truth. Then, T is fine-tuned for optimal performance (Tadj) (D) ETP Real-time application. The raw data (black) is band-pass filtered (green). The edge at the end of the data is removed (gray). The last peak in the time window is projected in the future using Tadj. (E) Laplacian montages used for the regions of interest. The red electrode is the central electrode. The mean of the surrounding electrodes (black) is removed from the central electrode.
Fast Fourier Transform (FFT) Prediction.
The key feature of this algorithm is to use the frequency domain of the EEG signal for forward prediction e.g. (Mansouri et al., 2017). The specific implementation in our experiment (Figure 1A) is as follows: 1) The Laplacian montage for the desired brain region is applied to the signal 2) The signal is zero-phase FIR (Finite Impulse Response, order 165) filtered in the frequency band of interest (Alpha: 8–13 Hz, Beta: 14–30 Hz) using the Fieldtrip toolbox (Oostenveld et al., 2010). 3) The FFT of the signal is calculated. 4) The dominant oscillation (the frequency with the maximum amplitude in the frequency spectrum within the band of interest) is detected. 5) The phase of the signal at the dominant frequency is calculated from the angular component of the complex FFT signal. 6) A sine wave of the dominant oscillation with given frequency and phase as calculated in the previous steps is used for forward prediction.
AutoRegressive (AR) Prediction.
In this method, the signal is predicted in the time domain. A detailed description can be found in (Zrenner et al., 2018; Chen et al., 2013). In short, we perform the following steps (Figure 1B): 1) The Laplacian of the electrodes corresponding to the region of interest is calculated. 2) The signal is zero-phase band-pass filtered in the frequency band of interest using an FIR filter. 3) The edges of the signal are trimmed to remove edge artifacts due to filtering. 4) The remaining signal is used to generate the coefficients for the autoregressive model (Yule-Walker method). 5) Using the AR coefficients, the signal is iteratively forward predicted. 6) The instantaneous phase of the predicted signal is calculated using the Hilbert transform.
Educated Temporal Prediction (ETP).
This method incorporates a training phase for the algorithm before the real-time application. We propose to include a short training phase to learn the individual statistical properties of the oscillation of interest. We use a simple and robust method to extract inter-peak intervals and their central moment. Assuming that brain oscillations are quasi-stable over the short measurement periods, one can determine the typical interval period between subsequent signal peaks (corresponding to 360° in phase). To predict the time point at which the next target phase, i.e. the peak, will occur, one can add the measured period between signal peaks to the time of the last peak in the current recorded signal window. Here, we have implemented this algorithm as shown in Figure 1C–D: 1) Three minutes of resting-state data is recorded. 2) The Laplacian montage for the region of interest is applied. 3) The data is filtered with a zero-phase FIR filter in the band of interest. This signal is used as the ground truth for later steps. 4) Signal peaks in the first 90 seconds of the training data (learning phase) are identified and the interval between each adjacent pairs of peaks is calculated (Tn). To ensure that found peaks are meaningful and to exclude the possible small fluctuations caused by unideal filtering, a criterion of minimum peak distance (i.e. 62.5 ms for alpha oscillations) was introduced. 5) The median of the periods between those peaks was chosen as the interpeak interval (T) to be used as an initial estimate for peak prediction. 6) The second 90 seconds of raw resting EEG data are used for the simulate estimation of the accuracy of the phase prediction (validation phase). In the validation phase, the value of T is adjusted to receive the best phase accuracy for this portion of the dataset. For this, 250 overlapping windows with a length of 500 ms are selected. 7) The Laplacian montage of the region of interest is applied and the windows are individually filtered in the band of interest using a non-causal sinc filter (brick-wall filter; ideal sharp filter in the frequency domain). 8) The edge (40 ms for alpha) from the end of the window is removed to avoid the edge artifact caused by the filter. 9) The peaks in this window with the criteria explained in step 4 are detected. 10) The timing of the next peak is predicted by adding T to the last detected peak. 11) The actual phases of the signal at the predicted peaks are measured from the Hilbert transform of the ground truth. 12) In an ideal case, the actual phase of all the predicted peaks should have no deviation from the target phase. However, due to the inherent limitations of real-time causal algorithms, the achieved phase values may have a systematic deviation (bias). To minimize the potential bias in the phase detection, the value of T is increased or decreased incrementally and the validation phase (steps 6–11) is rerun with the new T until deviation from the target phase is minimized. The optimal adjusted value (Tadj) is used for real-time phase estimation. See Table S4 for the comparison between the initial and adjusted values of T for a test dataset as well as the variability in interpeak intervals. In other words, in the validation phase, the bias in phase detection is removed without a change in variance by adjusting T. The calculated phases in this section can also be used as an estimation of the algorithm accuracy in real-time performance. In the real-time segment of the experiment, using Tadj, steps 7–10 described above are applied to the current window to predict the next peak (Figure 1D). If stimulation at any other phase is desired, we can progress the phase of the signal linearly and calculate the time projection needed from the last peak according to equation (1):
| (1) |
Where Tadj* is the new value of T to be added to the last detected peak in the time window, θ is the target phase for the stimulation.
2.2. In Silico Validation Based on Prerecorded Resting-State EEG
Algorithm Development and Parameter Optimization.
We used a separate prerecorded resting-state EEG dataset for the development and initial optimization of the ETP algorithm. For this, data from 25 individuals (13 female) with an average age of 19 years were taken from the Child Mind Institute healthy brain network dataset (Alexander et al., 2017). Phase detection was simulated on segments of resting EEG data which acted as surrogates of the real-time data. In the development process, we optimized parameters such as filter type, filter order, number of samples for edge removal, peak detection. Priority was given to algorithm performance (i.e. phase accuracy) as long as the process was fast enough to run in real-time. In the case where the performance of two procedures was equivalent, the faster one was chosen (e.g. brickwall vs FIR filter). The final parameters used for evaluation are reported in 2.1.
Algorithm validation.
After development, we used another dataset to estimate the accuracy and speed of each algorithm to ensure the generalizability of the results. This dataset included resting-state EEG from 13 healthy adults sampled at 1 kHz with a high number of electrodes (Sockeel et al., 2016). Each individual’s data was epoched with a 500 ms window length and a 50% overlap. We used the three algorithms, FFT, AR, and ETP, to predict the phase over three brain regions: left prefrontal cortex (PFC), left motor cortex (M1), and left occipital cortex (OC). These predicted values were compared to the ground truth to measure the performance. Throughout this study, for all methods and datasets, the ground truth is calculated by acausal (including samples after the time point of interest) filtering in the post-hoc analysis. In line with previous studies (Zrenner et al., 2018; Madsen et al., 2019; Schaworonkow et al., 2018), we first band-pass filter the continuous EEG data with a two-pass high-order FIR filter (since it does not distort the phase content of the signal) in the band of interest. Then, the filtered data is Hilbert transformed to extract the phase at the time of interest. The computation time needed for each algorithm to process the data was also recorded for each epoch.
2.3. In Vivo Real-Time Experiments
System Validation.
In order to technically validate the closed-loop system, including hardware and software, we created a test scenario using a dummy head model made of a plastic frame and soft fabric soaked with the saline solution and a known electrical input signal (alternating current at 10 Hz) generated with the XCSITE 100 amplifier (Pulvinar Neuro, Chapel Hill, North Carolina, US). Since the signals recorded by all EEG electrodes are perfect oscillations (within technical limits) with a high signal-to-noise ratio (SNR), we expected to detect the phase correctly using all algorithms (refer to Figure S1 for results).
Human Participants Testing.
The study protocol was approved by the Institutional Review Board of the University of Minnesota. All volunteers gave written informed consent prior to participation. Eight healthy participants (three female, average age = 27) without a history of neurological disorders took part in the main experiment, where we targeted the alpha oscillations. In one participant, due to a high level of noise during the measurement, the recordings of the motor region for all the methods were removed. In the main experiment, we targeted the alpha band (8 – 13 Hz). To test whether the algorithms can perform well in a different frequency band, four participants (two females) were called back to test the beta band condition. For this test, we changed the band-pass filter frequency to (14–30 Hz), while keeping all the other parameters the same.
Experimental Protocol.
The volunteers were asked to sit in a comfortable chair in a relaxed position throughout the experiment. The participants were instructed to maintain a resting state with eyes open during the recordings. The experimental paradigm is illustrated in Figure 2. Five minutes of resting-state were recorded at the beginning and the end of the session. We tested the three algorithms to predict the EEG alpha phase over three brain regions (left PFC, left M1, left OC) in a total of nine blocks, of five minutes each. The order of regions and the order of algorithms within each region was randomized. For the ETP method, there was a separate training block in which three minutes of resting-state data were recorded immediately prior to the real-time block.
Figure 2.

Experimental Protocol. Resting-state EEG is recorded at the beginning and end of the experiments. For each three brain regions that are randomized in order, three algorithms are tested in real-time. Prior to the real-time ETP block, resting-state is recorded and the algorithm is trained.
Electrophysiological Recordings.
Scalp EEG was recorded using a 64-channel EEG amplifier (actiCHamp, Brain Products GmbH, Germany) with active Ag/AgCl electrodes (actiCAP slim, Brain Products GmbH, Germany). The data were recorded at a sampling rate of 10 kHz with 24 bits resolution. The impedance between the scalp and each electrode was kept below 20 kΩ.
Since we are interested in recording the signal coming from a local brain region, we used the Laplacian montage that subtracts the mean values of the surrounding electrodes from the electrode of interest. This allows for common-mode rejection of signals coming from sources outside of the region of interest. Figure 1E illustrates the exact montages that were used for this study.
Real-time Digital Signal Processing.
EEG data from the amplifier was streamed to the processing computer (Microsoft Windows 10, 4 cores 3.60 GHz CPU, 16 GB RAM) using the Lab Streaming Layer (LSL, https://github.com/sccn/labstreaminglayer) software in real-time. Custom scripts (https://github.com/OpitzLab/CL-phase) were used in MATLAB R2017b to receive and process the EEG data and send the triggers to the TMS machine (Magstim Rapid2, UK). The last 500 ms of the streamed data was selected and fed to the algorithms to perform the phase estimation and prediction. The 500 ms window was updated upon receiving each new sample. In order to perform accurate real-time analysis, it is essential to process the current window of data before the next sample is received. This ensures that the system runs smoothly and sustains real-time performance during the whole session. Thus, the streaming data were downsampled before performing the analysis on each window. Since the ETP and FFT methods are computationally fast, we downsampled the EEG data to 1 kHz. For the AR algorithm, due to high computational demand and consistency with previous work (Zrenner et al., 2018), the data were downsampled to 500 Hz.
Real-Time Stimulation Triggers.
During the real-time phase estimation, a TTL (Transistor-transistor logic) pulse was sent from the parallel port of the computer to trigger the TMS machine. Due to an overall processing delay (~1–2 ms) and a lag of the TMS machine to deliver the magnetic pulse from the time it receives the trigger, there is a total trigger delay one needs to account for. Since this delay is stable over time, it was experimentally measured during the system validation and adjusted in the code. Note that the total delay is system-specific and should be measured for each system separately. In our experiments, triggers were sent when the estimated phase approached the proximity of the desired phase adjusted with the technical delay. We set a minimum of 2 s interval between the triggers in the experiment. This ensures that during actual TMS stimulation, all major evoked potentials induced in the brain by the TMS pulse have subsided. This prevents that previous TMS pulses contaminate the phase prediction for the next pulse. Since TMS pulses are very strong compared to the EEG signals, they cause large artifacts that would distort the phase estimation to determine the ground truth in offline processing (Ilmoniemi and Kičić, 2009; Herring et al., 2015). Therefore, in this study, since we are mainly interested in comparing the accuracy of different methods in phase prediction, rather than the physiological outcome of TMS stimulation, we did not apply a TMS pulse and only recorded the time at which the triggers were sent. This way, the EEG signal was not distorted, allowing us to accurately calculate the ground truth phase for algorithm comparison. Since the ETP algorithm relies on the dynamics of the brain during resting-state, we analyzed an additional dataset (Stanfield and Wiener, 2019) to ensure that ETP is capable of accurately detecting the EEG phase in the presence of a TMS pulse. In this public dataset, eleven participants (one of the twelve participants was excluded due to poor signal quality) performed a sensorimotor luminance detection task while TMS was applied to right frontal, central, or parietal regions in separate blocks. EEG was recorded with a 64-channel actiCHamp amplifier using actiCap electrodes (Brain Products) at 5000 Hz sampling rate. For the analysis, we applied the three algorithms to estimate the EEG phase at the time of the stimulation based on 0.5 s of data before each TMS pulse. We then compared the estimated phase to the ground truth. Note that because the TMS pulse distorts the EEG signal, we cannot calculate the ground truth as for the resting EEG dataset. Instead, we first partially recovered the neural signal by removing the TMS pulse and the following 50 ms (to remove muscle artifacts, etc) and added white noise to fill in the removed time period and then filtered the signal in the alpha band (8–13 Hz). Finally, we calculated the phase of the signal at the time of the TMS pulse with the Hilbert transform and used it as the ground truth. This procedure allows a relative comparison between the algorithms. Additionally, we compared the dynamics of the EEG oscillations before and after the TMS session to see if there is any change due to the TMS stimulation.
2.4. Data Analysis and Statistics
Algorithm Performance.
We quantified the performance of each algorithm calculating its bias, variance, and accuracy. Bias shows the systematic difference in the outcome from the target. Here, we used the average difference between the estimated phase and the target phase. Variance quantifies how spread the outcome distribution is. We used the standard deviation to report to quantify the spread. We defined the accuracy in equation (2):
| (2) |
Where N is the number of trials for which the phase is estimated, θi is the estimated phase (°) for the trial i, and θ0 (°) is the desired phase. An accuracy of 1 means that the phase has been estimated precisely every time. A uniformly distributed random phase estimation would yield an accuracy of 0.5 (in case of open-loop stimulation). An accuracy of 0 means that all phases have been detected as the opposite of the target phase (e.g. troughs instead of peaks).
Statistical Comparison Between the Algorithms.
To test whether there is a statistical difference between the algorithm performance, first, we calculated the accuracy of each algorithm for each participant over each brain region using equation (2). Then, we used a general linear mixed-effects model (GLME) with accuracy as the dependent variable, algorithm type as the fixed effect, and brain region as the random effect variables. In cases where the result of GLME was significant, we used the Wilcoxon signed-rank test to compare each pair of algorithms. We also further explored the differences between the three methods qualitatively (refer to the supplementary methods).
Signal-to-Noise Ratio (SNR) Measurements and Accuracy Regression.
One key factor for closed-loop performance is the signal-to-noise ratio in EEG recordings. In fact, the presence or absence of a prominent alpha rhythm has been used as participant selection criteria in previous studies (Zrenner et al., 2018). However, previous studies have not mentioned to what degree phase estimation accuracy will depend on data quality and alpha power. To test this effect and compare the algorithms, we calculated the SNR for each experimental EEG block during post-processing. SNR was measured by calculating the Power Spectral Density (PSD) using Welch’s method with 2s epochs and Hamming windows and then dividing the total power in the alpha band by the total power over all frequencies (1–45 Hz). To quantify this relationship, we calculated the linear regression model between the SNR and phase accuracy of each experimental block for the three algorithms separately.
Resting-State Analysis.
The ETP algorithm expects that EEG oscillations in the band of interest are quasi-stable over the experiment (in our case, approx. 1 h). To test this, we compared the resting-state data recorded pre-experiment with post-experiment data. Resting-state data were preprocessed to remove noise and artifacts (Delorme and Makeig, 2004; Oostenveld et al., 2010). We calculated the PSD and identified the frequency of maximum PSD for each volunteer in pre and post data. We used the Wilcoxon signed-rank test to evaluate any possible systematic shifts in the alpha peak frequency for all of the three brain regions throughout the experiment.
3. Results
3.1. In Silico Validation Based on Prerecorded Resting-State EEG
First, we evaluated the performance of each algorithm in silico. Figure 3A shows the polar histograms of the difference between the detected phase and the desired phase in the alpha band for FFT, AR, and ETP methods. Figure S4 also illustrates the polar histograms separately for each brain region. Qualitatively, all algorithms target zero degrees correctly; however, ETP shows the least spread, thus, higher in accuracy, while FFT shows the most spread around the target phase. Additionally, a difference in performance accuracy can be seen between brain regions with the occipital cortex showing the highest accuracy followed by M1 and finally PFC (Figure 3B). Table 1 summarizes the performance metrics (mean, standard deviation, and accuracy) for all algorithms and brain regions. As can be seen, all methods have a negligible bias in phase estimation; however, AR (mean accuracy = 68%) and ETP (71.8%) algorithms manifest lower spreads and therefore higher accuracies compared to the FFT (57.2%) algorithm (by 10.8% and 14.6% higher accuracy, respectively). ETP performs slightly better than AR by 3.8% in terms of accuracy. The general linear mixed effect model confirms significant differences between the algorithms accuracy (F(2,114) = 235, p < 1e-40). Non-parametric pairwise tests indicate a statistically significant difference between the accuracy of each algorithm pairs (AR vs. ETP: p < 1.e-6, AR vs. FFT: p < 1e-7, ETP vs. FFT: p < 1e-7).
Figure 3.

Phase estimation results for the in silico dataset in the alpha band. (A) Polar histograms of the difference between the estimated phase and ground truth for each algorithm. The phase values are binned into 36 bins. A zero degrees phase would be the ideal outcome since the detected phase matches the desired phase. (B) Box plot of the accuracy measurements with the individual data points over the three brain sites for each algorithm.
Table 1.
Summary of the performance metrics and computation time for AR, ETP, and FFT algorithms over the brain regions for the in silico dataset in the alpha band.
| Algorithm | Region | Mean (°) | SD (°) | Accuracy | Median Time (ms) |
|---|---|---|---|---|---|
| AR (500 Hz) | All | 5.44 | 73.59 | 0.68 | 0.78 |
| PF | 5.46 | 79.30 | 0.65 | 0.79 | |
| M1 | 6.37 | 75.88 | 0.67 | 0.81 | |
| OC | 4.49 | 65.59 | 0.73 | 0.74 | |
| ETP (1000 Hz) | All | 0.37 | 67.35 | 0.72 | 0.06 |
| PF | 0.16 | 73.54 | 0.69 | 0.06 | |
| M1 | 0.38 | 69.49 | 0.71 | 0.06 | |
| OC | 0.56 | 59.01 | 0.76 | 0.06 | |
| FFT (1000 Hz) | All | 5.55 | 92.36 | 0.57 | 0.82 |
| PF | 4.91 | 98.20 | 0.54 | 0.82 | |
| M1 | 5.92 | 94.33 | 0.56 | 0.82 | |
| OC | 5.83 | 84.57 | 0.62 | 0.81 |
Since computation speed is essential for real-time performance, we also report the median of the total computation times including filtering for each method in Table 1. ETP works significantly faster than the two other methods. FFT and AR perform at a similar speed, although the AR method runs at a lower sampling rate which means it is inherently slower. Note that the computation times are hardware-specific and, in order to ensure that the system can run in real-time, the processing time should be kept below the sampling interval.
To test how well the algorithms generalize, we additionally performed phase estimation in the beta band. Since beta oscillations are faster, less stable over time, and cover broader frequency band, all algorithms perform worse compared to the alpha band results (Figure S2 + S5 and Table S1). However, the same pattern between the algorithms still holds. ETP (mean accuracy = 64.7%) shows 3.5% higher accuracy than AR (61.2%), and AR is 5.7% more accurate than FFT (55.5%). The results for computation speeds are comparable to that of the alpha band.
3.2. Real-Time Experiments
After comparing the algorithms in silico using prerecorded EEG data, we implemented them in the laboratory for true real-time validation. Similar to the in silico validation, for the in vivo tests, we targeted the peak (zero phase) of the alpha rhythm. The polar histograms are illustrated in Figure 4A (for separate polar histograms per each brain region see Figure S6). Figure 4B breaks down the accuracy of each algorithm over different regions with box plots. The real-time results further validate the findings reported in the in silico results, with ETP (mean accuracy = 70.2%) performing marginally better than AR (66.6%), while ETP and AR perform considerably better than FFT (61.1%). Table 2 summarizes the performance metrics of each method in terms of bias, standard deviation, and accuracy for each brain region. As can be seen, ETP shows 3.6% and 9.1% higher accuracy relative to AR and FFT, respectively. Also, AR accuracy is 5.5% higher than FFT. General linear mixed effect model shows significant differences between the algorithms accuracy (F(2,66) = 31, p < 1e-9). Non-parametric pairwise tests confirm that there is a statistically significant difference between the accuracy of each algorithm pairs data (AR vs. ETP: p < 1e-3, AR vs. FFT: p < 1e-4, ETP vs. FFT: p < 1e-04). The analysis of an additional dataset with actual TMS delivery also shows similar results for the phase estimation accuracy (Figure S9). This demonstrates that the resting-state dynamics used for the forward prediction also apply for brain dynamics during TMS stimulation (given sufficient inter-pulse interval; 2 s in this study).
Figure 4.

Phase estimation results for the real-time experiment in the alpha band. (A) Polar histograms of the difference between the estimated phase and ground truth for each algorithm. (B) Box plot of the accuracy measurements with the individual data points over the three brain sites for each algorithm.
Table 2.
Summary of the performance metrics for AR, ETP, and FFT algorithms over the brain regions for the real-time experiment in the alpha band
| Algorithm | Region | Mean (°) | SD (°) | Accuracy |
|---|---|---|---|---|
| AR (500 Hz) | All | 8.39 | 76.00 | 0.67 |
| PF | 10.66 | 77.20 | 0.66 | |
| M1 | 9.43 | 75.26 | 0.67 | |
| OC | 5.07 | 75.54 | 0.67 | |
| ETP (1000 Hz) | All | 0.02 | 69.87 | 0.70 |
| PF | 1.34 | 73.82 | 0.68 | |
| M1 | −1.10 | 66.87 | 0.72 | |
| OC | −0.18 | 68.91 | 0.71 | |
| FFT (1000 Hz) | All | 1.31 | 85.63 | 0.61 |
| PF | 1.16 | 87.90 | 0.60 | |
| M1 | −0.47 | 84.01 | 0.62 | |
| OC | 3.23 | 84.99 | 0.61 |
We also evaluated real-time phase estimation in the beta band. The results for beta phase estimations can be found in Figure S3 + S7, and Table S2. ETP (mean accuracy = 65.4%) performs considerably better in the beta band as opposed to the other methods with 6.7% and 10% higher accuracy than AR (58.7%) and FFT (55.4%), respectively. These results are expected because the FFT method relies on finding the dominant oscillation to predict the signal and the beta band doesn’t have such stable narrowband oscillations as the alpha rhythm. For the AR method, optimal parameters such as filter order, edge removal, and autoregressive order are highly dependent on the frequency band of interest. Parameters used here were based on previous research (Zrenner et al., 2018) for the μ-rhythm in the motor cortex and tuned for the frequencies similar to the alpha band. Thus, it is likely that AR will need to be adapted for different frequencies for optimal performance. Our results indicate that ETP, which is a parameter-free method, is readily extendable to different EEG rhythms.
Signal-to-Noise Ratio (SNR) Measurements and Accuracy Regression.
To evaluate the importance of SNR for the phase prediction performance, we applied a linear regression model between the algorithm accuracies and SNR during the measurement. We defined SNR as the ratio of the alpha power to the total power of the signal. Figure 5 illustrates the regression results for each algorithm. In summary, all methods show a statistically significant increase in phase estimation accuracy for higher SNRs (FFT: R2adj = 0.54, F(21) = 26.3, p < 0.01; AR: R2adj = 0.41, F(21) = 16.3, p < 0.01; ETP: R2adj = 0.44, F(21) = 18.4, p < 0.01). The regression slopes are comparable between the methods (0.31 for FFT, 0.28 for AR, and 0.32 for ETP).
Figure 5.

Dependence of phase accuracy during the alpha band stimulation on SNR for each algorithm. The linear regression lines are shown in red and the confidence intervals in grey.
Resting-state EEG Analysis.
To test whether EEG oscillations are stable throughout the experiment, we compared the frequency of maximum PSD in the alpha band between the pre- and post-experiment resting-state recordings across participants for all three sites using non-parametric paired test. We found no systematic differences (Prefrontal region: p-value = 0.53, Motor: p-value = 0.99, Occipital: p-value = 0.58; all degrees of freedom = 22). See Figure S8 for the peak frequency of the resting-state EEG pre- and post-experiment. In a similar fashion, we analyzed the resting-state EEG before and after the TMS session in the dataset with actual TMS pulses. The results shown in Figure S10 indicate that there is no significant difference in brain oscillation dynamics in the alpha band before and after the TMS session.
4. Discussion
Real-time EEG based TMS applications have high potential to develop more precise stimulation protocols tailored to the individual’s ongoing brain state. However, optimal technical solutions are still being developed and evaluated. Here, we introduced a new education-based method in which the algorithm learns important features from a short prerecorded EEG session. We further compared the accuracy of three conceptually distinct algorithms (temporal prediction, frequency domain prediction, and education-based prediction) to target the peaks of the alpha rhythm over three different brain regions. We compared the performance of these algorithms first in silico using prerecorded EEG data and second in vivo real-time experiments in human participants. We found the FFT method to perform least accurately among the three studied algorithms, likely due to reducing the signal to a single-frequency sine wave in the observed time window. Since EEG signals are non-stationary and composed of several frequency components, such simplification can impair forward prediction. Our proposed education-based algorithm (ETP) outperformed the two other methods but was otherwise close in accuracy to the AR method. The performance of the ETP method might be due to the robustness of the algorithm since it learns EEG signal patterns beforehand and doesn’t rely only on a short and possibly noisy segment of data that it has access to at the moment of online processing. In addition, we did not exclude any volunteer or data epoch to evaluate performance across a more representative sample. However, as indicated by the found correlation between algorithm accuracy and SNR, higher accuracies could be achieved by excluding participants or time windows with low SNR or oscillatory power.
For real-time applications, computation speed is essential. Hence, we compared the run-time speed of all three algorithms. For a given sampling rate, the AR algorithm is the most computationally demanding. This is due to the heavy calculations needed to compute autoregressive coefficients. On the other hand, because of the simplicity of the ETP method, its computation time is significantly lower than the other two methods. Thus, ETP can run on lower-end hardware and is more accessible to use. Another upside to fast computation time is that it provides more room for future developments in real-time processing. One drawback of using the ETP method is that it needs to be trained on prerecorded data. However, in our case, three minutes of resting-EEG data were fully sufficient for training, which can be easily integrated into a real-time experiment. Further, the ETP algorithm is computationally robust and does not need to tune several parameters such as the AR method. For example, the order of the autoregressive model used in the AR algorithm is highly dependent on the sampling rate and frequency of interest on each application, and no trivial method for this optimization is available (Krusienski et al., 2006; McFarland and Wolpaw, 2008). For all three algorithms used, filter type and order can strongly affect the performance and careful consideration is essential for their proper optimization along with any algorithm-specific parameters.
Widespread implementation of real-time EEG-TMS has several potential advantages for future research. For example, brain-state dependent EEG-TMS studies can remove the need for post hoc analysis since the brain state of interest can be controlled during the experiments. Additionally, closed-loop TMS-EEG can allow investigating the dynamic interaction between different brain regions, e.g. by reading EEG from a brain region and targeting TMS to a different region. To date, closed-loop TMS has mainly been used in research applications. However, with increased use in clinical applications, algorithms with high accuracy and low computational demands, such as ETP are particularly promising. For instance, repetitive TMS (rTMS) to the left DLPFC is widely used for treating medication-resistant major depression (Avery et al., 2006; O’Reardon et al., 2007). Currently, the treatment protocol does not consider the current brain state. However, it is known that EEG oscillations play an important role in major depression which can be utilized for treatment plans (Fingelkurts and Fingelkurts, 2015; Leuchter et al., 2015). Timing TMS to a high-excitable state might mean that the brain will be more responsive (Zrenner et al., 2019), possibly leading to better treatment outcomes or shorter treatment duration. So far, closed-loop TMS-EEG applications have mostly focused on single-pulse TMS with relatively high inter-pulse intervals which are generally considered safe (Rossi et al., 2009). However, with increasing interest in the field, safety guidelines for high-frequency closed-loop TMS-EEG need to be reevaluated.
In this manuscript, we focused on the real-time phase detection of EEG for closed-loop TMS application. It is possible to apply these methods for other electrophysiological signals or other stimulation modalities, given they comply with the technical requirements for the algorithm. Beyond the algorithms evaluated in this study other less common methods to estimate the signal phase exist. (Madsen et al., 2019) used wavelet transforms, which are conceptually similar to the FFT method. Recently, machine learning algorithms have been suggested to estimate the instantaneous phase from unfiltered EEG data (McIntosh and Sajda, 2019). This is similar to the ETP method since it uses prerecorded data to extract features which can inform the real-time application. However, all existing algorithms have room for improvement in accuracy. Due to challenges in implementing real-time phase estimation (such as causality, filtering edge artifact, and system delay), further efforts are needed to improve the performance of such online phase estimation and prediction algorithms. Here, we propose a simple and parameter-free education-based method that only uses easy to access temporal features in the signal (i.e. inter-peak intervals). Our comparison of phase prediction algorithms was based on current implementations in the literature (Mansouri et al., 2017, Zrenner et al., 2018). However, it is conceivable that the FFT algorithm could be potentially improved by using multiple components for the forward prediction. In the AR method, the autoregressive coefficients are fitted individually for each time window. Since these coefficients can change abruptly over short periods of time, one possible way to improve the accuracy of the AR method is to smooth the coefficients across adjacent time windows. However, due to the high computational demand of the AR method, this might further impede its real-time application. In the future, more sophisticated algorithms combining temporal, frequency, and spatial features present in resting-state EEG can be developed for more accurate phase prediction in real-time applications. Due to the increasing adoption of brain state-dependent neuromodulation approaches in research and clinical applications, further technical developments can help reach the full potential of this emerging field.
Supplementary Material
Acknowledgments
Research presented here was supported by the University of Minnesota’s MnDRIVE Initiative and National Institutes of Health R01NS109498.
Footnotes
Ethical Statement
The study protocol was approved by the Institutional Review Board of the University of Minnesota. All volunteers gave written informed consent prior to participation.
References
- Alekseichuk I, Turi Z, Amador de Lara G, Antal A, Paulus W, 2016. Spatial Working Memory in Humans Depends on Theta and High Gamma Synchronization in the Prefrontal Cortex. Current Biology 26, 1513–1521. 10.1016/j.cub.2016.04.035 [DOI] [PubMed] [Google Scholar]
- Alexander LM, Escalera J, Ai L, Andreotti C, Febre K, Mangone A, Vega-Potler N, Langer N, Alexander A, Kovacs M, Litke S, O’Hagan B, Andersen J, Bronstein B, Bui A, Bushey M, Butler H, Castagna V, Camacho N, Chan E, Citera D, Clucas J, Cohen S, Dufek S, Eaves M, Fradera B, Gardner J, Grant-Villegas N, Green G, Gregory C, Hart E, Harris S, Horton M, Kahn D, Kabotyanski K, Karmel B, Kelly SP, Kleinman K, Koo B, Kramer E, Lennon E, Lord C, Mantello G, Margolis A, Merikangas KR, Milham J, Minniti G, Neuhaus R, Levine A, Osman Y, Parra LC, Pugh KR, Racanello A, Restrepo A, Saltzman T, Septimus B, Tobe R, Waltz R, Williams A, Yeo A, Castellanos FX, Klein A, Paus T, Leventhal BL, Craddock RC, Koplewicz HS, Milham MP, 2017. An open resource for transdiagnostic research in pediatric mental health and learning disorders. Scientific Data 4, 170181. 10.1038/sdata.2017.181 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Avery DH, Holtzheimer PE, Fawaz W, Russo J, Neumaier J, Dunner DL, Haynor DR, Claypoole KH, Wajdik C, Roy-Byrne P, 2006. A Controlled Study of Repetitive Transcranial Magnetic Stimulation in Medication-Resistant Major Depression. Biological Psychiatry 59, 187–194. 10.1016/j.biopsych.2005.07.003 [DOI] [PubMed] [Google Scholar]
- Barker AT, Jalinous R, Freeston IL, 1985. NON-INVASIVE MAGNETIC STIMULATION OF HUMAN MOTOR CORTEX. The Lancet, Originally published as Volume 1, Issue 8437 325, 1106–1107. 10.1016/S0140-6736(85)92413-4 [DOI] [PubMed] [Google Scholar]
- Berger B, Minarik T, Liuzzi G, Hummel FC, Sauseng P, 2014. EEG Oscillatory Phase-Dependent Markers of Corticospinal Excitability in the Resting Brain [WWW Document]. BioMed Research International. 10.1155/2014/936096 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Bergmann TO, Karabanov A, Hartwigsen G, Thielscher A, Siebner HR, 2016. Combining non-invasive transcranial brain stimulation with neuroimaging and electrophysiology: Current approaches and future perspectives. NeuroImage, Transcranial electric stimulation (tES) and Neuroimaging 140, 4–19. 10.1016/j.neuroimage.2016.02.012 [DOI] [PubMed] [Google Scholar]
- Buzsáki G, Anastassiou CA, Koch C, 2012. The origin of extracellular fields and currents — EEG, ECoG, LFP and spikes. Nature Reviews Neuroscience 13, 407–420. 10.1038/nrn3241 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Buzsáki G, Draguhn A, 2004. Neuronal Oscillations in Cortical Networks. Science 304, 1926–1929. 10.1126/science.1099745 [DOI] [PubMed] [Google Scholar]
- Chen LL, Madhavan R, Rapoport BI, Anderson WS, 2013. Real-time brain oscillation detection and phase-locked stimulation using autoregressive spectral estimation and time-series forward prediction. IEEE Transactions on Biomedical Engineering 60, 753–762. 10.1109/TBME.2011.2109715 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Cole SR, Voytek B, 2017. Brain Oscillations and the Importance of Waveform Shape. Trends in Cognitive Sciences 21, 137–149. 10.1016/j.tics.2016.12.008 [DOI] [PubMed] [Google Scholar]
- Delorme A, Makeig S, 2004. EEGLAB: an open source toolbox for analysis of single-trial EEG dynamics including independent component analysis. Journal of Neuroscience Methods 134, 9–21. 10.1016/j.jneumeth.2003.10.009 [DOI] [PubMed] [Google Scholar]
- Dugué L, Marque P, VanRullen R, 2011. The Phase of Ongoing Oscillations Mediates the Causal Relation between Brain Excitation and Visual Perception. J. Neurosci 31, 11889–11893. 10.1523/JNEUROSCI.1161-11.2011 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Fingelkurts Alexander A., Fingelkurts Andrew A., 2015. Altered Structure of Dynamic Electroencephalogram Oscillatory Pattern in Major Depression. Biological Psychiatry, Cortical Oscillations for Cognitive/Circuit Dysfunction in Psychiatric Disorders 77, 1050–1060. 10.1016/j.biopsych.2014.12.011 [DOI] [PubMed] [Google Scholar]
- Hallett M, 2007. Transcranial Magnetic Stimulation: A Primer. Neuron 55, 187–199. 10.1016/j.neuron.2007.06.026 [DOI] [PubMed] [Google Scholar]
- Herring JD, Thut G, Jensen O, Bergmann TO, 2015. Attention Modulates TMS-Locked Alpha Oscillations in the Visual Cortex. J. Neurosci 35, 14435–14447. 10.1523/JNEUROSCI.1833-15.2015 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Hjorth B, 1980. Source Derivation Simplifies Topographical EEG Interpretation. American Journal of EEG Technology 20, 121–132. 10.1080/00029238.1980.11080015 [DOI] [Google Scholar]
- Hussain SJ, Claudino L, Bönstrup M, Norato G, Cruciani G, Thompson R, Zrenner C, Ziemann U, Buch E, Cohen LG, 2019. Sensorimotor Oscillatory Phase–Power Interaction Gates Resting Human Corticospinal Output. Cereb Cortex 29, 3766–3777. 10.1093/cercor/bhy255 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Ilmoniemi RJ, Kičić D, 2009. Methodology for Combined TMS and EEG. Brain Topogr 22, 233. 10.1007/s10548-009-0123-4 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Jacobs J, Kahana MJ, Ekstrom AD, Fried I, 2007. Brain Oscillations Control Timing of Single-Neuron Activity in Humans. J. Neurosci 27, 3839–3844. 10.1523/JNEUROSCI.4636-06.2007 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Karabanov A, Thielscher A, Siebner HR, 2016. Transcranial brain stimulation: closing the loop between brain and stimulation. Current Opinion in Neurology 29, 397. 10.1097/WCO.0000000000000342 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Keil J, Timm J, SanMiguel I, Schulz H, Obleser J, Schönwiesner M, 2013. Cortical brain states and corticospinal synchronization influence TMS-evoked motor potentials. Journal of Neurophysiology 111, 513–519. 10.1152/jn.00387.2013 [DOI] [PubMed] [Google Scholar]
- Krusienski DJ, McFarland DJ, Wolpaw JR, 2006. An Evaluation of Autoregressive Spectral Estimation Model Order for Brain-Computer Interface Applications, in: 2006 International Conference of the IEEE Engineering in Medicine and Biology Society. Presented at the 2006 International Conference of the IEEE Engineering in Medicine and Biology Society, pp. 1323–1326. 10.1109/IEMBS.2006.259822 [DOI] [PubMed] [Google Scholar]
- Lefaucheur J-P, André-Obadia N, Antal A, Ayache SS, Baeken C, Benninger DH, Cantello RM, Cincotta M, de Carvalho M, De Ridder D, Devanne H, Di Lazzaro V, Filipović SR, Hummel FC, Jääskeläinen SK, Kimiskidis VK, Koch G, Langguth B, Nyffeler T, Oliviero A, Padberg F, Poulet E, Rossi S, Rossini PM, Rothwell JC, Schönfeldt-Lecuona C, Siebner HR, Slotema CW, Stagg CJ, Valls-Sole J, Ziemann U, Paulus W, Garcia-Larrea L, 2014. Evidence-based guidelines on the therapeutic use of repetitive transcranial magnetic stimulation (rTMS). Clinical Neurophysiology 125, 2150–2206. 10.1016/j.clinph.2014.05.021 [DOI] [PubMed] [Google Scholar]
- Leuchter AF, Hunter AM, Krantz DE, Cook IA, 2015. Rhythms and blues: modulation of oscillatory synchrony and the mechanism of action of antidepressant treatments. Annals of the New York Academy of Sciences 1344, 78–91. 10.1111/nyas.12742 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Madsen KH, Karabanov AN, Krohne LG, Safeldt MG, Tomasevic L, Siebner HR, 2019. No trace of phase: Corticomotor excitability is not tuned by phase of pericentral mu-rhythm. Brain Stimulation 12, 1261–1270. 10.1016/j.brs.2019.05.005 [DOI] [PubMed] [Google Scholar]
- Mäkinen VT, May PJC, Tiitinen H, 2005. The use of stationarity and nonstationarity in the detection and analysis of neural oscillations. NeuroImage 28, 389–400. 10.1016/j.neuroimage.2005.06.004 [DOI] [PubMed] [Google Scholar]
- Mansouri F, Dunlop K, Giacobbe P, Downar J, Zariffa J, 2017. A Fast EEG Forecasting Algorithm for Phase-Locked Transcranial Electrical Stimulation of the Human Brain. Front. Neurosci 11. 10.3389/fnins.2017.00401 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Maris E, Fries P, van Ede F, 2016. Diverse Phase Relations among Neuronal Rhythms and Their Potential Function. Trends in Neurosciences 39, 86–99. 10.1016/j.tins.2015.12.004 [DOI] [PubMed] [Google Scholar]
- McFarland DJ, Wolpaw JR, 2008. Sensorimotor rhythm-based brain–computer interface (BCI): model order selection for autoregressive spectral analysis. J. Neural Eng 5, 155–162. 10.1088/1741-2560/5/2/006 [DOI] [PMC free article] [PubMed] [Google Scholar]
- McIntosh JR, Sajda P, 2019. Estimation of phase in EEG rhythms for real-time applications. arXiv:1910.08784 [eess, q-bio]. [DOI] [PubMed]
- Oostenveld R, Fries P, Maris E, Schoffelen J-M, 2010. FieldTrip: Open Source Software for Advanced Analysis of MEG, EEG, and Invasive Electrophysiological Data. Computational Intelligence and Neuroscience 2011, e156869. 10.1155/2011/156869 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Opitz A, Windhoff M, Heidemann RM, Turner R, Thielscher A, 2011. How the brain tissue shapes the electric field induced by transcranial magnetic stimulation. NeuroImage 58, 849–859. 10.1016/j.neuroimage.2011.06.069 [DOI] [PubMed] [Google Scholar]
- O’Reardon JP, Solvason HB, Janicak PG, Sampson S, Isenberg KE, Nahas Z, McDonald WM, Avery D, Fitzgerald PB, Loo C, Demitrack MA, George MS, Sackeim HA, 2007. Efficacy and Safety of Transcranial Magnetic Stimulation in the Acute Treatment of Major Depression: A Multisite Randomized Controlled Trial. Biological Psychiatry, Depression: New Perspectives on Treatment and Etiology 62, 1208–1216. 10.1016/j.biopsych.2007.01.018 [DOI] [PubMed] [Google Scholar]
- Polanía R, Nitsche MA, Ruff CC, 2018. Studying and modifying brain function with non-invasive brain stimulation. Nature Neuroscience 21, 174–187. 10.1038/s41593-017-0054-4 [DOI] [PubMed] [Google Scholar]
- Romei V, Brodbeck V, Michel C, Amedi A, Pascual-Leone A, Thut G, 2008. Spontaneous Fluctuations in Posterior α-Band EEG Activity Reflect Variability in Excitability of Human Visual Areas. Cereb Cortex 18, 2010–2018. 10.1093/cercor/bhm229 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Sauseng P, Klimesch W, 2008. What does phase information of oscillatory brain activity tell us about cognitive processes? Neuroscience & Biobehavioral Reviews 32, 1001–1013. 10.1016/j.neubiorev.2008.03.014 [DOI] [PubMed] [Google Scholar]
- Schroeder CE, Lakatos P, 2009. Low-frequency neuronal oscillations as instruments of sensory selection. Trends in Neurosciences 32, 9–18. 10.1016/j.tins.2008.09.012 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Schulz H, Übelacker T, Keil J, Müller N, Weisz N, 2014. Now I am Ready—Now I am not: The Influence of Pre-TMS Oscillations and Corticomuscular Coherence on Motor-Evoked Potentials. Cereb Cortex 24, 1708–1719. 10.1093/cercor/bht024 [DOI] [PubMed] [Google Scholar]
- Sockeel S, Schwartz D, Pélégrini-Issac M, Benali H, 2016. Large-Scale Functional Networks Identified from Resting-State EEG Using Spatial ICA. PLOS ONE 11, e0146845. 10.1371/journal.pone.0146845 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Thut G, Bergmann TO, Fröhlich F, Soekadar SR, Brittain J-S, Valero-Cabré A, Sack AT, Miniussi C, Antal A, Siebner HR, Ziemann U, Herrmann CS, 2017. Guiding transcranial brain stimulation by EEG/MEG to interact with ongoing brain activity and associated functions: A position paper. Clinical Neurophysiology 128, 843–857. 10.1016/j.clinph.2017.01.003 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Thut G, Miniussi C, Gross J, 2012. The Functional Importance of Rhythmic Activity in the Brain. Current Biology 22, R658–R663. 10.1016/j.cub.2012.06.061 [DOI] [PubMed] [Google Scholar]
- Zrenner B, Zrenner C, Gordon PC, Belardinelli P, McDermott EJ, Soekadar SR, Fallgatter AJ, Ziemann U, Müller-Dahlhaus F, 2019. Brain oscillation-synchronized stimulation of the left dorsolateral prefrontal cortex in depression using real-time EEG-triggered TMS. Brain Stimulation. 10.1016/j.brs.2019.10.007 [DOI] [PubMed] [Google Scholar]
- Zrenner C, Belardinelli P, Müller-Dahlhaus F, Ziemann U, 2016. Closed-Loop Neuroscience and Non-Invasive Brain Stimulation: A Tale of Two Loops. Front. Cell. Neurosci 10. 10.3389/fncel.2016.00092 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Zrenner C, Desideri D, Belardinelli P, Ziemann U, 2018. Real-time EEG-defined excitability states determine efficacy of TMS-induced plasticity in human motor cortex. Brain Stimulation 11, 374–389. 10.1016/j.brs.2017.11.016 [DOI] [PubMed] [Google Scholar]
- Rossi S, Hallett M, Rossini PM, Pascual-Leone A, Safety of TMS Consensus Group, 2009. Safety, ethical considerations, and application guidelines for the use of transcranial magnetic stimulation in clinical practice and research. Clin Neurophysiol 120, 2008–2039. 10.1016/j.clinph.2009.08.016 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Stanfield CT, Wiener M, 2019. State-dependent differences in the frequency of TMS-evoked potentials between resting and active states. bioRxiv 614826. 10.1101/614826 [DOI] [Google Scholar]
- Schaworonkow N, Triesch J, Ziemann U, Zrenner C, 2018. EEG-triggered TMS reveals stronger brain state-dependent modulation of motor evoked potentials at weaker stimulation intensities. Brain Stimulation. 10.1016/j.brs.2018.09.009 [DOI] [PubMed] [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
