EEG for Beginners GitHub
EEG · Signal processing · Neurofeedback · HRV

EEG for BeginnersTwo weeks, real signals.

From zero to reading a raw trace, telling brain from artifact, and running a basic analysis in Python. Every figure and exercise uses real recordings you can open in the browser or in MNE.

16modules, Markdown first
13real EDF recordings
9runnable Python labs
21figures drawn from the data
InteractiveSignal LabOpen any course EDF, or your own, in the browser. Filter, re-reference, and read the spectrum live.InteractiveElectrode mapThe 10-20 system as a clickable head, with a naming quiz.EcosystemOpen-source projectsEEGEdu, BrainFlow, EEG-ExPy, Brainstorm, OpenBCI docs and the lecture sets behind them.After week 2Project branchesHeart-brain coupling, ASR/ICA validation, and neurally controlled game design.
The modules

Sixteen modules, two weeks

00Week 1Start hereWhat this course is, how to work through it, how to set up Python, and the notes habit that makes the first supervisor meeting useful.15 min read, 20 min setup01Week 1Where the signal comes fromScalp EEG is the summed post-synaptic activity of millions of aligned cortical neurons, smeared by skull and scalp: tens of microvolts, millisecond timing, centimetre blur.30 min watch, 20 min read02Week 1Frequency bandsDelta, theta, alpha, beta, gamma: what each band is, where it shows up, what it is associated with, and why the edges are conventions rather than laws.25 min read03Week 1Electrodes and montagesThe 10-20 naming system, what a reference electrode is, referential versus bipolar montages, and why the reference changes what you see.20 min read, 10 min sketch04Week 1Reading a raw traceHow an EEG viewer is laid out, how to scroll and scale it in MNE, a first-look checklist for any new file, and how to spot eyes-closed alpha.20 min read, 15 min hands-on05Week 1Artifacts field guideBlinks, eye movements, muscle, heartbeat, line noise, electrode pops, sweat drift and movement: what each looks like, where it shows up, and how to tell it from brain.20 min watch, 25 min read, 15 min cheat sheet06Week 1Lab 1: find the alpha peakLoad real eyes-closed and eyes-open EEG, filter it, compute power spectra, and watch the 10 Hz alpha peak appear when the eyes close.60-90 min hands-on07Week 2FilteringHigh-pass, low-pass, notch: what each removes, what each costs, and why a recording with a million-fold 60 Hz hum can still be rescued.30 min read, 20 min hands-on08Week 2Re-referencingEvery EEG channel is a voltage difference. Change what it is measured against and the same brain looks different.20 min read, 10 min hands-on09Week 2Artifact handling: rejection, ICA and ASRThree families of tools for getting blinks, muscle and movement out of EEG, and what each one actually does to a real recording.35 min read, 25 min hands-on10Week 2Spectral featuresFrom a window of signal to the numbers neurofeedback protocols train on: Welch spectra, absolute and relative band power, ratios and the peak alpha frequency.30 min read, 15 min hands-on11Week 2Epochs and ERPsCutting continuous EEG into windows around events, rejecting bad ones, and averaging: the vocabulary of event-related potentials.20 min read, 10 min hands-on12Week 2Lab 2: clean a recording and measure alphaRemove the blink component with ICA, compare your result with the platform's own pipeline, and find which channels carry the most alpha, then explain what you did in three sentences.60-90 min hands-on13Week 2The neurofeedback loopHow everything in Weeks 1 and 2 becomes one real-time loop: measure, clean, compute a feature, compare to a threshold, give feedback.50 min: 30 min reading, 20 min hands-on14Week 2HRV basicsHeart rate variability: from R-peaks to RMSSD, SDNN, LF and HF, and why slow paced breathing changes the picture.40 min: 25 min reading, 15 min hands-on15Week 2Divergence orientationWhat to have ready before Alex walks you through the Divergence platform, and how the course samples connect to it.20 min to prepare, then the in-person walkthrough
About this course

A two-week self-onboarding course that takes new students from zero to "can read an EEG trace, explain what is in it, and run a basic analysis in Python" in about six hours, before the first supervisor meeting with Alex.

It is built around real recordings: thirteen anonymised EDF files from consumer and research headsets, chosen because each one shows something specific (a clean alpha rhythm, heavy line noise, blinks, the same recording before and after cleaning). Every figure in the course is drawn from them by code in this repo, and every lab runs on them.

Who it is for: students joining the Divergence projects with some programming background and no EEG background. Everything linked is free and publicly available. No licences, no sign-ups beyond a Python install.

How to use it #

  • Work through Week 1 before Week 2. Each session is 30-45 minutes; give the two hands-on sessions a dedicated 60-90 minute block.
  • Follow the day-by-day schedule. It says what to read, watch and run in each session; the resource library is the longer menu for when you want more.
  • Keep a running notes file in the project repo, starting from the notes template. Write down every term you had to look up and every question for Alex.
  • Pair up where it helps: one person drives, the other reads the docs.
  • Before the first meeting, go through the Checkpoints and mark anything you cannot do yet.

The two-week map #

flowchart LR
    subgraph W1["Week 1 · what EEG is"]
        M01["01 Signal origin"] --> M02["02 Bands"] --> M03["03 Electrodes"] --> M04["04 Raw trace"] --> M05["05 Artifacts"] --> L1["06 Lab 1<br/>alpha peak"]
    end
    subgraph W2["Week 2 · working with the signal"]
        M07["07 Filtering"] --> M08["08 Reference"] --> M09["09 Artifact handling"] --> M10["10 Spectral features"] --> L2["12 Lab 2<br/>clean and measure"]
        M10 -.-> M11["11 Epochs and ERPs"]
    end
    subgraph AP["Applied"]
        M13["13 Neurofeedback loop"] --> M14["14 HRV"] --> M15["15 Divergence orientation"]
    end
    L1 --> M07
    L2 --> M13

The Week 2 pipeline is the same one, in the same order, that nearly every EEG tool runs, including the Divergence platform: filter, re-reference, remove artifacts, then compute features.

Modules #

# Module Week · session Time What you will be able to do
00 Start here 1 · 1 15 min read, 20 min setup Set up, know the plan
01 Where the signal comes from 1 · 1 30 min watch, 20 min read Explain what scalp EEG measures and its limits
02 Frequency bands 1 · 2 25 min read Name the bands and what each is associated with
03 Electrodes and montages 1 · 2 20 min read, 10 min sketch Place 10-20 sites; explain references and montages
04 Reading a raw trace 1 · 3 20 min read, 15 min hands-on Read a multichannel plot and spot alpha
05 Artifacts field guide 1 · 4 20 min watch, 25 min read, 15 min cheat sheet Tell blinks, muscle, line noise and drift from brain
06 Lab 1: find the alpha peak 1 · 3 60-90 min hands-on Load EDF, plot spectra, see alpha appear with eyes closed
07 Filtering 2 · 5 30 min read, 20 min hands-on Choose high-pass, low-pass and notch settings and know their costs
08 Re-referencing 2 · 5 20 min read, 10 min hands-on Apply and compare references
09 Artifact handling 2 · 6 35 min read, 25 min hands-on Reject, run ICA, understand ASR
10 Spectral features 2 · 5 30 min read, 15 min hands-on Compute Welch spectra, band power, ratios
11 Epochs and ERPs 2 · 6 20 min read, 10 min hands-on Know the event-related vocabulary
12 Lab 2: clean and measure 2 · 6 60-90 min hands-on Remove a blink with ICA and measure alpha per channel
13 The neurofeedback loop 2 · 7 50 min: 30 min reading, 20 min hands-on Explain protocols, thresholds and why artifacts matter online
14 HRV basics 2 · 8 40 min: 25 min reading, 15 min hands-on Compute and interpret RMSSD, SDNN, LF, HF
15 Divergence orientation 2 · 8 20 min to prepare, then the in-person walkthrough Arrive at the platform walkthrough ready

Beyond the course #

  • Open-source projects: the open tools and lecture sets around this course (EEGEdu, BrainFlow, EEG-ExPy, Brainstorm, OpenBCI docs, Kothe's BCI lectures and more), what each is good for, and a ten-minute way to try it.
  • Project branches: the next layer after the two weeks: heart-brain correlation, ASR/ICA validation, and neurally controlled game design.

Reference pages: Schedule · Checkpoints · Resources · Glossary · Notes template · Sample recordings

Quick start #

bash
git clone <this repo>
cd EEG_For_Beginners
python -m venv .venv
source .venv/bin/activate          # Windows: .venv\Scripts\activate
pip install -r code/requirements.txt
python code/labs/lab1_alpha_peak.py

Use VS Code or JupyterLab, whichever you already know. The labs are plain Python scripts that also work cell by cell in a notebook. See the MNE install guide if pip install mne gives you trouble.

Repository layout #

text
EEG_For_Beginners/
├── README.md                 this page
├── schedule.md               day-by-day plan, 8 sessions
├── open-source.md            open-source projects and no-login lecture sets
├── project-branches.md       what to do after the two weeks, per project
├── checkpoints.md            self-assessment before the first meeting
├── resources.md              the full resource library
├── glossary.md               every term, A-Z
├── notes-template.md         copy this to start your notes file
├── AUTHORING.md              how the Markdown is written (for contributors)
├── modules/                  00-15, one Markdown file per module
├── assets/figures/           every figure, generated from the samples
├── data/
│   ├── README.md             what each sample recording is for
│   └── samples/              13 anonymised EDF files (17 MB)
├── code/
│   ├── requirements.txt
│   ├── eeg101/               small helpers: load_sample(), BANDS, montage
│   ├── labs/                 runnable lab and module scripts
│   └── figures/make_figures.py   regenerates assets/figures/
└── site/                     static site builder (HTML version of the course)

Regenerating the figures #

Every PNG in assets/figures/ is drawn from the sample recordings by one function in code/figures/make_figures.py:

bash
python code/figures/make_figures.py                      # all figures
python code/figures/make_figures.py artifact_gallery     # just one

About the data #

The samples in data/samples/ are real recordings with their EDF header patient and recording fields blanked and the start date set to 01.01.85 (the EDF convention for anonymised files). The signals are unchanged. See data/README.md for what each file shows and how to load it.

The website #

The same content is published as a static site. To build it locally:

bash
pip install -r site/requirements.txt
python site/build.py --serve   # builds site/dist and serves it on http://localhost:8000

The site adds two interactive pages that only exist in HTML: the Signal Lab (open any course EDF, or your own, in the browser; filter, re-reference and read the spectrum live) and an electrode map with a naming quiz. It is fully static, so it deploys anywhere; vercel.json is set up for Vercel, and pointing a subdomain at the project is all that is left. Details in site/README.md.

Credits and licence #

The course structure and reading list come from the EEG Self-Onboarding Map - Two Weeks syllabus (Oct 15, 2026, Alex Ni). The linked lectures, decks, tutorials and papers belong to their authors and are linked, not copied. Hands-on material leans on MNE-Python and NeuroKit2.

License: TBD. Pick one before publishing. A common split is CC BY 4.0 for the written content and figures, and MIT for the code in code/ and site/.