Real-Time Artifact Detection and Removal for Closed-Loop EEG-TMS

Matilda Makkonen*, Tuomas Mutanen, Johanna Metsomaa, Christoph Zrenner, Victor Souza, Risto Ilmoniemi

*Corresponding author for this work

Research output: Contribution to journalConference articleScientificpeer-review

233 Downloads (Pure)


Transcranial magnetic stimulation (TMS) combined with electroencephalography (EEG) is a non-invasive tool for studying brain connectivity and excitability. However, the EEG signals are often hindered by artifacts. Several signal-processing methods have been developed for correcting these artifacts offline. Yet, new promising EEG-TMS applications, such as closed-loop stimulation, would greatly benefit from artifact correction in real time. We present an algorithm for real-time attenuation of extracranial noise and removal of ocular artifacts from EEG-TMS data. Two established offline cleaning methods were implemented in a real-time setting: the source-estimate-utilizing noise-discarding (SOUND) algorithm and ocular-artifact removal with independent component analysis (ICA). This procedure cleans streamed raw data by multiplying every EEG sample with SOUND and ICA spatial filters, with a delay of less than 0.1 ms. The SOUND filter is constantly updated in a parallel process to react to changes in noise characteristics. In tests with pre-recorded EEG-TMS data, the proposed algorithm was fast enough for real-time use, removed ocular artifacts efficiently, and detected and cleaned contaminated channels automatically, leaving the noiseless channels intact. The algorithm can be used to detect and remove extracranial noise and ocular artifacts in real-time EEG and EEG-TMS experiments.
Original languageEnglish
Article number12
Pages (from-to)1-4
Number of pages4
JournalInternational Journal of Bioelectromagnetism
Issue number2
Publication statusPublished - Aug 2021
MoE publication typeA4 Conference publication
EventInternational Conference on Bioelectromagnetism - Virtual, Online
Duration: 26 May 202128 May 2021
Conference number: 13


  • transcranial magnetic stimulation
  • electroencephalography
  • artifact removal
  • Closed-loop stimulation
  • real-time signal processing


Dive into the research topics of 'Real-Time Artifact Detection and Removal for Closed-Loop EEG-TMS'. Together they form a unique fingerprint.

Cite this