← Back to Course Home

Simultaneous EEG-fMRI Artifact Decontamination Workbench

Experience the electromagnetic challenge of recording microvolt (μV) brain potentials inside a 3 Tesla MRI scanner: progressively apply Average Artifact Subtraction (AAS) to eliminate millivolt gradient switching spikes, Optimal Basis Sets (OBS) to remove cardiac ballistocardiogram (BCG) pulses, and trial averaging to recover the clean Visual P100 Evoked Potential.

Decontamination Pipeline:
Continuous Stream (0 – 3.0 s): EEG Lead O1 · Scanner TR Clock · ECG Lead I
Processed EEG (O1)
Scanner Trigger Clock (TR)
Concurrent ECG (QRS)
Stimulus-Locked ERP (-50 to +300 ms): P100 Waveform Recovery
Recovered ERP
Ground Truth P100 Wave
Pipeline Stage
Raw Signal
Peak Artifact Voltage
20,000 μV
Signal-to-Noise (SNR)
-66.0 dB
Artifact Attenuation
0.0 dB (None)
P100 Peak Detected
Hidden in Noise

Physical Foundations of Simultaneous EEG-fMRI Decontamination:

1. Imaging Gradient Switching Artifacts (Faraday's Law): During fMRI acquisition, spatial encoding gradients switch rapidly (dB/dt ∼ 100 T/m/s). According to Faraday's Law of Induction (Ε = −dΦB/dt), any wire loop formed by electrode leads captures the changing magnetic flux, inducing massive voltage spikes of 10 to 50 millivolts (up to 5,000 times larger than brain potentials!).

2. Average Artifact Subtraction (AAS): Because the gradient sequence repeats with exact microsecond timing governed by the scanner clock, we synchronize the EEG recording amplifier to the scanner master clock. By computing a moving average of the artifact across consecutive TR cycles and subtracting it, AAS attenuates the gradient artifact by over 50 dB (99.7% reduction), revealing the underlying biological signals.

3. The Ballistocardiogram (BCG) Artifact: In static 3T fields, the cardiac cycle creates a prominent biological artifact. Pulsatile blood ejection into the aortic arch vibrates the skull, and pulsatile expansion of scalp capillaries physically moves electrodes in the strong static B0 field. This generates a rhythmic cardiac artifact of 100–300 μV with a delay of ∼200 ms relative to the ECG R-peak.

4. Optimal Basis Sets (OBS) & PCA: Because heart rate varies dynamically (preventing simple periodic subtraction), Optimal Basis Sets uses the concurrent ECG channel to epoch BCG pulses and applies Principal Component Analysis (PCA) to extract and subtract the principal temporal components of the cardiac artifact without distorting true brainwaves.

5. Epoch Averaging & The Visual P100 Waveform: Once gradient and BCG artifacts are removed, the residual microvolt EEG contains background alpha rhythms and thermal noise. Time-locked averaging across repeated visual stimulus presentations cancels out non-phase-locked background noise, unmasking the classic P100 visual evoked response peaking at 100 milliseconds.