1 of 13

Neural Signal Processing Workshop

Electroencephalograms (EEGs)!

2 of 13

Overview

Today we will be learning how to:�

  • Use Python MNE to analyze EEGs
  • Visualize EEG signals
  • How to understand Power Spectral Density (PSD) plots
  • Resampling & Filtering
  • Epoching
  • Annotate events
  • Analyze & compare 2 stimulatory groups

3 of 13

Today’s Dataset

  • Athinoula A. Martinos Center Biomedical Imaging (Mass. General Hospital, MIT, & Harvard Med School)
  • Participants were presented with a checkerboard pattern in their left & right eyes
  • Tones would periodically be played in their left or right ear
  • A smiley face would occasionally appear, and participants were asked to press a button to test reaction speed
  • We’ll be looking at the difference between auditory and visual stimuli responses

4 of 13

Google Colab

  1. Please copy the URL below into a browser to access the notebook

https://tinyurl.com/UH-EEG

5 of 13

Google Colab

2. Save a copy to your drive

1.

2.

6 of 13

Visualizing EEG Signals

  • Displays electrical activity across various electrodes (EEG Channels) over time
  • Real-time brain activity
  • Each line represents voltage changes measured in microvolts (μV)
  • Temporal variation is shown along the x-axis in seconds

7 of 13

Visualizing EEG Signals (PSD)

  • Power spectral density (PSD) plot
  • Power decreases after 20 Hz (typical for EEG data)
  • Prevalence of lower frequency activity suggests EEG was recorded during a state of low-cognitive load
  • Delta: 0-4 Hz (Sleep)
  • Theta: 4-8 Hz (Deeply relaxed)
  • Alpha: 8-13 Hz (Relaxed, passive attention)
  • Beta: 13-30 Hz (Active external attention)

8 of 13

Resampling & Filtering

  • Resampling: Recordings are typically at high sampling rates (1000 Hz), makes recordings precise but takes up memory
  • Downsampling saves computation time where highly precise timing isn’t needed

Filtering Types:

  • High-pass: attenuates frequencies below a certain cutoff frequency
  • Low-pass: attenuates frequencies above a certain cutoff frequency
  • Notch (Band Stop): combination of both low-pass and high-pass filters

9 of 13

Epoching

  • STIM channels record voltages (DC pulses) that are time-locked to experimental events (stimulus or button press)
  • DC pulses may be all on one STIM channel
  • One channel that records a weighted sum of the other STIM channels, in such a way that voltage levels on that channel can be decoded as particular event types
  • Older: STI 014
  • Newer: STI 101

10 of 13

Epoching

  • Event dictionaries are used when epoching continuous data

  • Each annotated stimulus event is made into an epoch

  • Plot shows an n-number of events per stimulus in relation to time

11 of 13

Epoching

  • We pool left/right stimulus groups to compare auditory vs. visual responses
  • To avoid biasing signals left or right, we equalize first to randomly sample epochs from each condition to match the number of epochs present in the condition with the fewest good epochs
  • Delete unnecessary epochs not important in analysis

12 of 13

Epoching

  • Mu wave (8-12 Hz) is associated with motor activity
  • Both signals show a clear increase in amplitude after the onset (time 0), representing the brain’s response to the stimuli
  • Auditory stimulus shows a stronger peak in amplitude shortly after stimulus onset compared to the visual stimulus, suggesting a more rapid neural response

13 of 13

Thank You!