Interactive Digital Textbook

EEG Explorer — The Electrical Brain

Nara Labon Computational Cognition
Rekhi Foundationfor Happiness
MIND LabChandigarh University
ChandigarhUniversity
23 / 23 built
Fundamentals · 01

What EEG actually measures

An EEG electrode reads a voltage at the scalp — but that voltage is not a single neuron talking. It is the faint, summed echo of millions of cells, and it only becomes visible when they line up and fire together.

The signal does not come from action potentials. Those spikes are too fast and too small, and they fire at scattered times, so they cancel out from a distance. What an EEG actually picks up is the slower postsynaptic potential — the gentle voltage shift across a neuron's membrane when it receives input.

Even those are tiny. A single neuron produces a field measured in nanovolts at the scalp — far below the noise floor. The reason EEG works at all is summation: cortical pyramidal neurons are stacked in parallel, all pointing the same way, like a palisade. When a large population is active at the same moment, their little fields add into something measurable — tens of microvolts.

So two conditions must hold for a scalp signal to appear. Drag the controls and watch the summed trace climb out of the noise.

10%
How tightly the population fires in time. Low = scattered, high = in lockstep.
Parallel cells add up. Randomly pointed cells cancel — even when perfectly synchronized.
Single-neuron field
~30 nV
Summed scalp signal
3 µV
Active neurons
~1.2M
Detectable at scalp?
No
Why this matters: EEG is biased toward synchronized, parallel sources. A small, deep, or randomly oriented population can be intensely active and still be nearly invisible — which is exactly why EEG sees cortical surface activity well and deep structures poorly.

This single idea — that EEG measures synchrony, not raw activity — quietly explains almost everything that follows: why alpha waves appear when the cortex idles in unison, why a seizure produces such huge deflections, and why "more brain activity" does not always mean a bigger signal.

Section 01 of a planned 23. Built as a self-contained, offline-capable HTML explorer. All visuals are SVG; no external libraries.
Fundamentals · 02

Volume conduction

The signal doesn't reach the electrode in a straight line. It spreads outward through brain, skull, and scalp — so by the time it arrives at the surface, a pinpoint source has become a broad, blurry smudge.

A patch of active cortex behaves like a tiny current dipole. That current doesn't stay put: it flows through every conductive path available — brain, cerebrospinal fluid, skull, scalp. This is volume conduction, and it means a single source is "seen" by a wide swath of electrodes at once.

The skull makes it worse. Bone has very low conductivity, so it acts as a spatial low-pass filter — it smears the pattern sideways and shrinks its amplitude. Two more things shape what reaches the surface: depth (deeper sources are weaker and broader) and orientation (a dipole pointing straight out makes one focal peak; one lying flat makes a two-lobed +/− pattern).

Drag the dipole. Push it deep, pull it to the surface, flip its orientation, toggle the skull — and watch what the ring of electrodes actually records.

Radial points straight out at the scalp; tangential lies flat, like cortex folded into a sulcus.
The skull blurs the scalp pattern sideways and weakens it. Turn it off to see the "true" field.
Source depth
cm
Peak scalp signal
%
Scalp spread (FWHM)
cm
Spatial blur
Why this matters: this smearing is why EEG has poor spatial resolution, and why you can't read a source's location straight off the scalp. Many different sources can produce nearly the same scalp map — the core difficulty of the inverse problem (Section 23).

Notice that a tangential source (folded into a sulcus) produces a split positive/negative pattern whose peaks sit beside the source rather than over it — one reason scalp maps can be so misleading about where the activity really is.

Section 02 of a planned 23. Drag the dipole to move it; the field is recomputed live. Self-contained, offline-capable, no external libraries.
Fundamentals · 03

The 10–20 system & montages

Before you can compare two recordings, the electrodes have to go in the same places — and the readings have to be wired up the same way. The 10–20 system is the shared map; a montage is the wiring diagram laid on top of it.

The name is literal. Electrode positions are set as steps of 10% and 20% of the distance along lines drawn between bony landmarks — the nasion (bridge of the nose), the inion (bump at the back of the skull), and the two preauricular points in front of the ears. Because the steps are percentages, the same layout scales to any head.

Names encode location. A letter gives the region — Fp (pre-frontal), F (frontal), C (central), P (parietal), O (occipital), T (temporal) — and a number gives the side: odd on the left, even on the right, z down the midline.

Click any electrode to inspect it. Raise the density, and switch montages to watch the same electrodes get rewired into the channels a reader actually scans.

Explore in 3D
Higher-density systems (10–10, 10–5) add electrodes between the standard sites for finer spatial sampling.
A montage is a recipe for turning electrodes into channels. The referencing math itself comes in Section 04.
Reveals the nasion–inion midline and the coronal line, with their 10% / 20% spacing.
Selected electrode
Region
Hemisphere
Channels in montage
Why this matters: standard placement is what makes EEG a shared language — an "F3" beta burst means the same thing in any lab in the world. And the montage is not a cosmetic choice: a bipolar montage emphasises local differences and helps localise sharp events, while a referential montage preserves the broad shape of slow activity. The same brain, wired two ways, can look like two different recordings.

Notice that bipolar chains plot the difference between neighbours, so a sharp focus shows up as a phase reversal — two channels pointing at each other — which is exactly how clinicians pinpoint a spike. You'll see why once referencing is on the table in the next section.

Section 03 of a planned 23. The 19 labelled electrodes are placed at standard 10–20 positions; higher-density dots illustrate added coverage. Self-contained SVG, no libraries.
Fundamentals · 04

Referencing schemes

There is no such thing as the voltage at one electrode. EEG only ever measures a difference between two points — so every number you see depends on what you compared it against. The reference isn't a detail; it's half the measurement.

Because the reference is subtracted from every channel, whatever the reference electrode is picking up gets injected — inverted — into the entire recording. Put the reference somewhere quiet and the map stays honest; put it on top of an active source and that source smears across every channel at once.

The same recording can be re-referenced after the fact, and each scheme tells a different story: common (one shared reference), average (subtract the mean of all electrodes), bipolar (each channel is a neighbour minus neighbour), and the Laplacian (an electrode minus its surrounding ring). Below, one fixed brain — a focal spike plus a widespread rhythm — is shown through all four.

Re-reference the very same data and watch the channels change character.
Only used by the common scheme. Move it onto the focus to see contamination.
C3
Where the sharp source sits along the front-to-back chain.
A rhythm shared by all electrodes — a common-mode signal the difference schemes reject.
Channels
Reference
Common-mode rhythm
Focus localization
Why this matters: two labs can record the identical brain and publish maps that look nothing alike simply because one used linked-ears and the other an average reference. There is no "true" reference — only trade-offs. Difference-based schemes (average, bipolar, Laplacian) reject signals common to all electrodes and sharpen local ones; a common reference is simplest but drags its own activity into everything.

Watch the bipolar scheme with the focus mid-chain: the channel just above the source deflects one way and the channel just below deflects the other — a phase reversal that points straight at the source. That, not a single big trace, is how a focal spike is localised on a real EEG.

Section 04 of a planned 23. One simulated source is re-referenced live; amplitudes are illustrative. Self-contained canvas, no libraries.
Fundamentals · 05

Sampling, impedance & gain

The brain's signal is smooth and continuous; a computer can only store numbers. Three steps bridge that gap — and each one can quietly wreck the data if you get it wrong: how often you sample, how cleanly the electrode touches the scalp, and how you amplify and digitize what's left.

An EEG signal is measured in microvolts, far smaller than the noise around it, so it must be amplified and then turned into discrete numbers by an analog-to-digital converter. Sampling rate sets how many snapshots per second you take; impedance is how good the electrode-to-skin contact is; and gain & bit-depth set how finely the amplified voltage is sliced into numbers.

Pick a topic and push the controls to their limits to see each failure mode appear.

Each topic is a separate failure mode of turning brain voltage into stored numbers.
20 Hz
The real rhythm in the brain (here, one clean sine).
128 Hz
Drop it below twice the signal frequency and the wave aliases into a false slow rhythm.
5 kΩ
Labs aim for under ~5 kΩ. High impedance invites 50 Hz mains hum and noise.
12 bits
Fewer bits = coarser voltage steps = a visible staircase.
1.0×
Too much gain pushes the signal past the converter's rails and clips it flat.
Why this matters: these are the silent killers of a recording. Aliasing is irreversible — a 60 Hz muscle artifact under-sampled can masquerade as a 6 Hz brain rhythm you'll never untangle. That's why amplifiers apply an anti-aliasing filter before sampling, why technicians fuss over impedance for so long, and why modern EEG uses 16–24 bit converters: enough headroom for big artifacts and enough resolution for tiny brain signals at once.

A useful rule of thumb: sample at least 3–4× the highest frequency you care about (not just the bare 2× Nyquist minimum), keep impedances low and balanced across electrodes, and leave amplifier headroom so a blink or movement doesn't clip.

Section 05 of a planned 23. Signals are illustrative single tones; mains shown at 50 Hz. Self-contained canvas, no libraries.
The signal in frequency · 06

Frequency bands

An EEG trace looks like a single wiggly line, but it's really many rhythms layered on top of one another. By long convention those rhythms are grouped into five bands, and the mix between them is a fingerprint of brain state — from deep sleep to intense focus.

The bands run slow to fast: delta (under ~4 Hz, deep sleep), theta (4–8 Hz, drowsiness and memory), alpha (8–13 Hz, relaxed wakefulness with eyes closed), beta (13–30 Hz, active thinking and movement), and gamma (above ~30 Hz, high-level cognition). The recorded signal is simply their sum.

Toggle each band on and off and drag its strength. Watch the individual rhythms add up into the composite trace, and read off which state the mixture resembles.

Active bands
Dominant band
Peak frequency
Resembles
Why this matters: clinicians and researchers rarely read raw voltage — they read the balance of bands. Excess slow theta/delta while awake can flag injury or drowsiness; a strong posterior alpha that vanishes on eye-opening is a sign of a healthy relaxed brain; beta dominates during alertness and is boosted by some medications. The bands aren't fundamental physics, but they're an enormously useful shorthand.

The boundaries are conventions, not hard walls — labs differ slightly on where alpha ends and beta begins, and "gamma" can mean anything from 30 to 100+ Hz. What's real is the underlying continuum of frequencies, which the next section pulls apart properly with the Fourier transform.

Section 06 of a planned 23. Each band is rendered as a representative rhythm; the composite is their live sum. Self-contained canvas, no libraries.
The signal in frequency · 07

Time ↔ frequency

The single most important idea in signal analysis: any wiggle in time, however complicated, is exactly equal to a sum of plain sine waves. The Fourier transform is the machine that finds them — turning a wave you read left-to-right into a spectrum you read by frequency.

These are two views of the same thing. The time domain shows voltage moment by moment; the frequency domain shows how much of each rhythm is present. A pure tone becomes a single spike in the spectrum; mix two tones and you get two spikes — each peak's height is that component's strength.

Build a signal on the left and watch its spectrum on the right. Then try the presets: a sharp spike spreads across all frequencies, a square wave reveals a ladder of harmonics, and the EEG-like signal shows the 1/f slope and alpha bump real brains produce.

Manual lets you stack sine tones; the presets show classic time↔frequency pairs.
0%
Broadband noise lifts the whole spectral floor.
Nyquist
Freq resolution (Δf)
Dominant peak
Spectral character
Why this matters: almost everything done to EEG happens in the frequency domain — band power, filtering, spectrograms, connectivity. The Fourier view is also where the limits bite: a short window gives coarse frequency resolution (Δf = sampling rate ÷ number of samples), and you can't have sharp timing and sharp frequency at once. That trade-off drives the spectrogram in the next section.

One subtlety worth seeing: the transform throws away nothing — it also stores the phase of each sine (when its peaks land), which is why the spectrum is unchanged if you slide the waveform sideways. Magnitude tells you what frequencies; phase tells you where they line up.

Section 07 of a planned 23. A real 512-point FFT runs live on the synthesized signal (fs = 128 Hz, Hann-windowed). Self-contained, no libraries.
The signal in frequency · 08

The alpha rhythm & Berger effect

When Hans Berger made the first human EEG recordings in the 1920s, one thing leapt out: close your eyes and relax, and a steady ~10 Hz rhythm swells over the back of the head. Open them, or start thinking hard, and it vanishes. That on-off behaviour — the Berger effect — is the easiest brain rhythm to see for yourself.

This is alpha (8–13 Hz). It is strongest over the occipital and parietal scalp — the visual areas — and it is largely absent at frontal sites. It appears with relaxed wakefulness and eyes closed, and is blocked (desynchronized) by visual input or mental effort. Its presence is a quick sign of a healthy, awake, resting brain.

Close and open the eyes below, switch the recording site, and try a mental-arithmetic state — and watch the alpha rhythm and its power rise and fall.

Alpha appears at rest with eyes shut; eye-opening and mental effort both block it.
Alpha is posterior-dominant — strong at the back, weak at the front.
Alpha amplitude
Peak frequency
Brain state
Alpha reactivity
Why this matters: alpha reactivity is one of the first checks in any EEG reading. A strong posterior alpha that blocks on eye-opening confirms the recording is working and the brain is healthy and awake. Its frequency matters too — slowing of the alpha peak (say from 10 Hz toward 8 Hz) can be an early marker in dementias and other conditions.

The blocking is technically desynchronization: at rest, large pools of occipital neurons idle in synchrony at ~10 Hz (recall Section 01 — synchrony is what makes a signal visible). Engage the visual system and those neurons break step to do independent work, so the summed rhythm collapses even though the cortex is more active.

Section 08 of a planned 23. Alpha and background activity are modelled; the topography and reactivity follow the real posterior-dominant pattern. Self-contained canvas, no libraries.
The signal in frequency · 09

Spectrograms

A single Fourier spectrum tells you which frequencies are in a recording — but not when. Brain activity is rarely steady: alpha comes and goes, a seizure builds, a spindle flickers past. The spectrogram solves this by running the FFT over and over on a sliding window, stacking the results into a picture of frequency changing through time.

Read it like a map: time runs left to right, frequency bottom to top, and colour shows power — cool where a rhythm is weak, hot where it's strong. A steady tone is a horizontal stripe; a rising chirp is a diagonal; a sharp spike is a vertical streak smeared across all frequencies at one instant.

The catch is the window. Drag it short for crisp timing but fuzzy frequency, or long for crisp frequency but smeared timing — you cannot sharpen both at once. The window box sweeping across the trace shows exactly which slice each column is built from.

Each signal shows a different spectrogram signature.
64 samp · 500 ms
Short = sharp time, blurry frequency. Long = sharp frequency, blurry time.
Window
Freq resolution (Δf)
Time resolution (Δt)
Trade-off
Why this matters: the spectrogram is the workhorse view for non-stationary EEG. Sleep staging reads the parade of spindles and slow waves; seizure onset shows as a sudden organized band climbing in frequency; and event-related desynchronization (Section 16) appears as a dip in band power locked to a movement. The window choice (Δf × Δt ≈ 1) is a hard limit, not a setting to perfect — you pick which axis matters for the question you're asking.

This is the time–frequency uncertainty principle in practical form: a brief event is sharp in time but inherently broad in frequency (the spike's vertical streak), while a long steady rhythm is sharp in frequency but its on/off edges blur. Wavelet methods tackle this by using short windows for high frequencies and long windows for low ones — adapting the trade-off across the spectrum.

Section 09 of a planned 23. A real sliding-window FFT (fs = 128 Hz, Hann window) is recomputed as you drag. Self-contained, no libraries.
Artifacts & cleaning · 10

The artifact zoo

Brain signals at the scalp are only tens of microvolts — so almost everything else the body does is bigger. A blink can be ten times the size of the rhythm you're hunting. Most of the skill in EEG is learning to recognise these intruders on sight, because each one has a tell-tale shape, location, and rhythm.

The give-aways are spatial and spectral. Eye artifacts shout at the frontal electrodes; muscle lives at the temporal sites and the fast end of the spectrum; mains hum sits at exactly 50 Hz everywhere; the heartbeat ticks at about 1 Hz; and an electrode coming loose produces a sharp jump on a single channel. Knowing where to look is half the battle.

Switch each intruder on and watch where and how it corrupts the four channels. The legend tracks what's active, and the worst-hit channel is highlighted.

Active artifacts
Worst-hit channel
Main offender
Data quality
Why this matters: an artifact mistaken for brain activity is one of the most common — and most consequential — errors in EEG. A frontal blink can masquerade as a delta wave; jaw muscle can look like fast "activity"; mains hum can mimic a rhythm. The first job in any analysis is identification, then removal by filtering (Section 11) or decomposition (Section 12) — never by quietly hoping it's signal.

A useful instinct: if something is far larger than everything around it, perfectly periodic, or confined to one channel or the very front of the head, distrust it. Real cortical rhythms are modest in amplitude, spatially smooth (Section 02), and rarely metronomic.

Section 10 of a planned 23. Clean EEG and each artifact are modelled with their characteristic shape, topography, and frequency. Self-contained canvas, no libraries.
Artifacts & cleaning · 11

Filtering

Once you can name the intruders, the first tool for removing them is the filter: keep the frequencies you want, attenuate the rest. Three filters do most of the work — a high-pass to kill slow drift, a low-pass to kill fast muscle, and a narrow notch to kill mains hum.

A high-pass passes frequencies above its cutoff, so a 0.5–1 Hz high-pass flattens baseline wander while leaving brain rhythms intact. A low-pass passes frequencies below its cutoff, so a 40 Hz low-pass removes muscle fuzz. Together they form a band-pass. A notch carves out a narrow slice — at 50 Hz, exactly where the mains lives.

But filters are not free. Push the high-pass too high and you erase real slow activity; push the low-pass too low and you blunt sharp events. Drag the cutoffs and watch both the waveform and its spectrum respond.

0.5 Hz
Removes everything below it — drift, sweat, DC. Set to 0 to disable.
40 Hz
Removes everything above it — muscle and high-frequency noise.
A narrow band-stop at the mains frequency.
Passband
Removed
Notch
Result
Why this matters: filter settings are reported in every methods section because they change the result. A 1 Hz high-pass is gentle; a 5 Hz one can fabricate artificial waves around sharp transients (filter "ringing"). The community standard for routine EEG is roughly a 0.5–1 Hz to 40–70 Hz band-pass plus a notch — but the right answer always depends on the signal you're after.

Filtering is reversible only in the sense that you keep the raw data — the act itself discards information. Anything inside the stop-band is gone, including any brain activity that happened to live there. That's why heavier artifact problems are often better handled by decomposition, which can subtract an artifact without sacrificing a whole frequency range — the subject of the next section.

Section 11 of a planned 23. Real zero-phase filtering via FFT (fs = 128 Hz); the response curve is the exact gain applied. Self-contained, no libraries.
Artifacts & cleaning · 12

ICA artifact removal

Filtering removes a whole frequency range — but a blink and a brain rhythm can overlap in frequency, so a filter can't separate them. Independent Component Analysis can. Instead of filtering by frequency, it filters by spatial pattern: it learns how each hidden source spreads across the electrodes, then pulls the sources apart.

Every electrode records a mixture of sources — brain rhythms plus artifacts like blinks and heartbeat. ICA estimates a set of independent components, and each arrives as a pair: a fixed scalp map (where it projects) and a time course (what it does). To rebuild a channel you add the components back up, each weighted by its map — so if you drop a component first, its contribution simply disappears from every channel at once.

That is the whole trick, and it differs from a frequency filter: removing the blink subtracts only its spatial pattern, leaving overlapping brain frequencies fully intact. Watch it directly below. Each channel's recorded trace (grey) is broken into the cleaned result (blue) plus a coloured layer for every component you remove — so recorded = cleaned + the artifacts taken out. The height of each coloured band follows that component's scalp map, which is why a blink towers over the frontal channels and all but vanishes at the back.

The components ICA separated — each with its scalp map, time course, and colour. Click a card to keep or remove; removed components fade out of the channels above and reappear as coloured layers.
Components
Removed
Variance removed
Outcome
Why this matters: ICA is the standard way to clean blinks, eye movements, heartbeat, and even some muscle from EEG without gutting the spectrum. Its power is also its danger — remove a component that contains real brain activity and you have silently deleted data. Good practice is conservative: remove only components whose map and time course clearly scream "artifact."

The catch worth remembering: ICA assumes the sources are statistically independent and mix linearly, and it needs enough channels to separate them (you can't pull four sources cleanly out of two electrodes). It also can't label components for you — that judgement, by topography and time course, is still the human's job, though automated classifiers increasingly help.

Section 12 of a planned 23. Sources are mixed by a fixed matrix and reconstructed from the kept components; the topomaps interpolate each component's true scalp projection. Self-contained, no libraries.
Artifacts & cleaning · 13

Epoching & rejection

A raw recording is one long stream. To study the brain's response to an event, you cut that stream into short segments — epochs — time-locked to each stimulus, clean up their baselines, and throw out the ones ruined by artifacts.

Every event (a flash, a beep, a button press) leaves a marker in the recording. An epoch is a window around each marker — here −200 ms to +800 ms. The 200 ms before the event is the baseline: nothing has happened yet, so it should sit near zero. Slow drifts mean it often doesn't, so each epoch is baseline-corrected by subtracting its own pre-stimulus mean.

Then comes the ruthless part. A single blink can be 100 µV — five times the brain signal — and if it lands inside an epoch it will dominate everything computed from it. So any epoch whose amplitude exceeds a rejection threshold is discarded before it can do damage. Slide the threshold below and watch epochs flip between ✓ keep and ✕ reject; the blink-contaminated ones (E2, E5, E7) are the first to go.

±80 µV
On
Off
Total epochs
8
Kept
Rejected
Threshold
±80 µV
Why this matters: epoching plus rejection is the gate every event-related analysis passes through. Reject too little and one blink poisons the average; reject too much and you throw away real data and lose statistical power. The threshold is a genuine trade-off, not a setting with a "correct" value — and it should be chosen before you look at the results, not tuned until they come out the way you hoped.
Section 13 of a planned 23. The recording is synthetic; epochs are extracted, baseline-corrected, and thresholded live. Self-contained, no libraries.
Event-related potentials · 14

Why averaging works

A single trial is almost all noise — the brain's response to one stimulus is buried under spontaneous activity ten times larger. Averaging many trials rescues it, because the response is the same every time while the noise is different every time.

Line up many epochs on the stimulus and add them together. The event-related potential (ERP) is time-locked: the same bumps appear at the same delays in every trial, so they reinforce. The background EEG is random relative to the stimulus, so across trials it partly cancels. The signal survives; the noise erodes.

The payoff is precise. Signal adds up in proportion to the number of trials N, but random noise grows only as √N — so the signal-to-noise ratio improves by √N. Four times the trials, half the noise; a hundred trials, a tenfold cleaner waveform. Watch the average below sharpen onto the true ERP (dashed) as trials accumulate.

1
20 µV
Trials averaged
1
Noise / trial
20 µV
Noise in average
20 µV
SNR gain
Why this matters: averaging is the single most important trick in ERP research, but it buys cleanliness with two assumptions — that the response is identical on every trial, and that the noise is unrelated to the stimulus. Neither is perfectly true: real responses jitter in latency and habituate over trials, and any stimulus-locked artifact (a reflexive blink, a muscle twitch) survives averaging exactly as the ERP does. The maths only rewards the noise that is genuinely random.
Section 14 of a planned 23. Trials are the same synthetic ERP plus fresh random noise each time; the bold trace is the live running average. Self-contained, no libraries.
Event-related potentials · 15

The component zoo

Once you have a clean average, its peaks and troughs are not random wiggles — each recurring deflection is a named ERP component with a characteristic timing, polarity, scalp location, and psychological meaning.

A component is defined by four things: when it peaks (latency), which way it goes (positive or negative), where on the scalp it is largest (topography), and what it responds to (its functional role). Naming follows a simple code — a letter for polarity and a number for latency — so N170 is a negativity around 170 ms and P300 a positivity around 300 ms.

Early components (P1, N170) are sensory: they track the physical stimulus and sit at the back of the head. Later ones (P300, N400, P600) are cognitive: they depend on meaning, attention, and expectation, and shift forward over parietal cortex. Pick a component below, or press play to tour the zoo.

Latency
Polarity
Maximal at
Class
Why this matters: components are inferences, not objects. The same scalp bump can be produced by different brain configurations, latencies jitter with task difficulty, and neighbouring components overlap in time and sum together — so isolating one often needs a difference wave (e.g. deviant minus standard for the MMN). Treat a peak as a useful label for a measurement window, not as a little organ that lights up.
Section 15 of a planned 23. Waveform and topographies are schematic canonical values, not a single recording. Self-contained, no libraries.
Oscillations & connectivity · 16

ERD / ERS

Not every response is a peak in the average. Many events change the power of an ongoing rhythm rather than adding a fixed waveform — the mu rhythm over motor cortex collapses when you move, then rebounds afterwards. These are event-related desynchronization and synchronization.

An ERP is phase-locked: the same wave appears at the same delay every trial, so averaging the raw signal reveals it. ERD/ERS are induced: they are time-locked to the event but their phase is random from trial to trial. Average the raw signal and they cancel to nothing — the only way to see them is to average power, not voltage.

ERD (desynchronization) is a drop in band power: the neurons stop idling in unison and get to work. ERS (synchronization) is a rise above baseline — most famously the beta "rebound" after a movement ends. Both are expressed as a percentage change from a pre-event reference. Watch below: the single trials clearly lose amplitude around the event, the phase-locked average stays flat, yet the power curve dives (ERD) and overshoots (ERS).

Mu (8–13 Hz)
Beta (13–30 Hz)
20
Rhythm
Mu
Peak ERD
Peak ERS
Phase-locked avg
≈ 0
Why this matters: ERD/ERS is how EEG studies motor control, attention, and memory through oscillatory dynamics rather than evoked peaks — and mu/beta ERD is the engine behind most motor-imagery brain–computer interfaces (Section 21). The crucial habit: decide in advance whether your effect is phase-locked (average the signal → ERP) or induced (average the power → ERD/ERS), because each analysis is blind to the other.
Section 16 of a planned 23. Trials share an amplitude envelope but carry random phase; both averages are computed live from them. Self-contained, no libraries.
Oscillations & connectivity · 17

Phase, coherence & PLV

Two brain regions can oscillate at the same frequency without meaning anything — unless their rhythms keep a consistent phase relationship. Measuring that consistency is how EEG infers functional connectivity: which areas are talking to each other.

Every oscillation has an instantaneous phase — where it is in its cycle. Take two signals and look at their phase difference Δφ moment by moment. If Δφ stays roughly constant, the two are phase-locked: knowing one tells you the other. If Δφ drifts randomly, they are independent, however similar their frequencies.

The phase-locking value (PLV) turns this into a number. Plot each Δφ as a unit arrow on a circle; if they all point the same way they add up to a long resultant (PLV → 1); if they scatter they cancel (PLV → 0). Raise the coupling below and watch the cloud of arrows tighten and the PLV climb.

55 %
60°
PLV
Mean Δφ
Coupling
55 %
Verdict
Why this matters: phase synchrony is a leading model of how distant regions coordinate ("communication through coherence"), and PLV/coherence maps underpin much of network neuroscience. Two cautions live in every such analysis: volume conduction (Section 02) can make one source appear at two electrodes with zero phase lag, faking connectivity — which is why methods that ignore near-zero-lag coupling (imaginary coherence, PLI) exist — and high synchrony shows only that two signals are related, never which one drives the other.
Section 17 of a planned 23. Signal B tracks A's phase with a jitter set by the coupling slider; PLV is computed live from the phase-difference history. Self-contained, no libraries.
Oscillations & connectivity · 18

Cross-frequency coupling

Rhythms of different speeds are not independent. A slow wave can act as a conductor for a fast one — the phase of theta deciding when gamma is allowed to be loud. This phase–amplitude coupling is a candidate mechanism for how the brain packages information.

The idea is simple and striking: gamma bursts (~40 Hz) do not fire evenly through time. They cluster at a preferred point in the slower theta cycle (~6 Hz) — riding on its crests, say, and falling silent in its troughs. The slow rhythm's phase gates the fast rhythm's amplitude.

To see it, extract theta's phase and gamma's amplitude, then ask: how does gamma amplitude depend on theta phase? Bin gamma amplitude by theta phase and plot it. Flat means no coupling; a peak means gamma prefers one phase. The height of that peak is summarised by the Modulation Index. Raise the coupling and pick a preferred phase below.

70 %
Coupling
70 %
Preferred phase
Modulation index
Verdict
Why this matters: theta–gamma coupling is a leading model for working memory and for ordering items in a sequence — each gamma burst a slot, the theta cycle the frame that holds them. But PAC is delicate to measure: sharp non-sinusoidal waveforms and edge artifacts can manufacture spurious coupling, and a high Modulation Index shows a statistical relationship, not that one rhythm causes the other. Rigorous studies compare against phase-shuffled surrogates before believing a peak.
Section 18 of a planned 23. A theta rhythm gates a gamma burst whose amplitude follows the coupling and preferred-phase sliders; the histogram and MI are accumulated live. Self-contained, no libraries.
Brain states & applications · 19

Sleep staging

Sleep is not one state but a nightly journey through several, and EEG is how we read the map. Each stage has an unmistakable electrical signature — from the big slow waves of deep sleep to the spindles and K-complexes that punctuate lighter sleep.

A night is scored in 30-second epochs into Wake, N1, N2, N3, and REM. As you descend, the EEG slows and grows: fast low-amplitude wake activity gives way to theta, then to spindles and K-complexes, then to towering delta waves. REM is the twist — its EEG looks almost like wakefulness, yet the body is paralysed and the eyes dart.

Plotting the stage against time gives a hypnogram, the shape of a night. Deep N3 dominates the early cycles; REM periods lengthen toward morning. Press play to travel through the night, or pick a stage to inspect its signature.

Stage
Dominant activity
Hallmark
Amplitude
Why this matters: the hypnogram is the backbone of sleep medicine — sleep-onset latency, time in deep sleep, REM fragmentation, and arousals all read off it, and disorders from insomnia to narcolepsy to sleep apnoea leave characteristic marks. Scoring by these rules is also being automated; the hallmark features here (spindles, K-complexes, slow waves) are exactly what both human scorers and algorithms hunt for in each 30-second window.
Section 19 of a planned 23. The hypnogram and each stage's signature waveform are schematic but rule-faithful. Self-contained, no libraries.
Brain states & applications · 20

Seizures & epileptiform

Epilepsy is a disorder of synchrony gone wrong — populations of neurons that should fire independently instead discharge together, and EEG sees it with brutal clarity. It remains the single most important test in epilepsy.

Between seizures the EEG can still betray an irritable brain through interictal discharges: brief spikes (under 70 ms) and sharp waves (70–200 ms), often followed by a slow wave. Their location points to the epileptogenic zone. During a seizure — ictal — the record transforms into rhythmic, evolving, high-amplitude activity.

Two distinctions organise everything: focal (starting in one region, sometimes spreading) versus generalized (whole brain at once, bilaterally synchronous), and the seizure's evolution — onset, build-up, slowing, and the flat postictal suppression that follows. Pick a pattern below; press play to watch the seizures evolve and spread.

Pattern
Distribution
Signature
Phase
Why this matters: EEG localises the seizure focus for surgery, distinguishes epileptic events from fainting or psychogenic spells, and classifies syndromes that dictate which drug to use — the 3 Hz spike-and-wave of childhood absence, for instance, responds to very different medication than a focal temporal-lobe seizure. A caution runs through it all: interictal spikes can occur in people who never seize, and a normal routine EEG never rules epilepsy out — the brain may simply not have misfired during the recording.
Section 20 of a planned 23. Waveforms are schematic teaching models of each pattern, not clinical recordings. Self-contained, no libraries.
Brain states & applications · 21

Brain–computer interfaces

A brain–computer interface turns EEG into commands — letting someone spell, move a cursor, or steer a wheelchair with no muscles at all. Every one is built on a signal you have already met in this guide.

The engineering trick is always the same: find a neural signal the user can control or that a stimulus reliably evokes, measure it in real time, and classify it into a choice. Three paradigms dominate, each borrowing a phenomenon from earlier sections — the P300 oddball response, motor-imagery ERD, and the steady-state response to flicker.

Pick a paradigm below and interact with it — click a letter to spell, imagine a hand, or look at a flickering target — then press play to watch the system gather evidence and decode your intent.

Paradigm
Neural signal
Decoded
Detail
Why this matters: for people with locked-in syndrome or severe paralysis, a BCI can be the only channel to the outside world. The trade-offs are real: the P300 speller needs no training but is slow; SSVEP is fast and accurate but demands gaze and tires the eyes; motor imagery is hands-free and continuous but needs practice and works poorly for some users ("BCI illiteracy"). All are limited by EEG's modest signal-to-noise — which is exactly why averaging, filtering, and artifact rejection from the earlier sections matter so much here.
Section 21 of a planned 23. Each paradigm is a schematic real-time simulation: responses and decoding are modelled, not recorded. Self-contained, no libraries.
Brain states & applications · 22

Anesthesia & consciousness

General anesthesia is a reversible, drug-induced coma — and EEG is the window onto how deep it goes. As consciousness fades, the electrical signature changes in an orderly, readable way that anesthesiologists increasingly watch in real time.

The progression is stereotyped for drugs like propofol. Awake EEG is low-amplitude and fast. With sedation, activity briefly speeds up, then a striking frontal alpha rhythm appears alongside large slow (delta) waves — the classic signature of surgical anesthesia. The eyes-closed alpha of wakefulness lives at the back of the head, but under anesthesia alpha migrates to the front — a shift called anteriorization.

Push deeper and the EEG fractures into burst-suppression: seconds of activity separated by near-flat silence, with the silent fraction growing until the trace goes isoelectric. Monitors condense all this into a single depth index (BIS-like, 100 awake → ~40–60 surgical → 0 flat). Drag the depth below, or press play to run a whole anesthetic from induction to emergence.

45 %
State
Depth index
Burst-suppression
Dominant
Why this matters: too light risks intraoperative awareness; too deep is linked to hypotension and, in vulnerable patients, worse outcomes — so reading the EEG helps titrate the dose to the brain rather than to body weight. Two cautions: depth indices are proprietary black boxes that lag and can be fooled (ketamine, which adds gamma, and dexmedetomidine, which mimics N2 spindles, both break the usual number), and a low index measures cortical dynamics, not the presence or absence of experience — consciousness itself remains only indirectly inferred.
Section 22 of a planned 23. The waveform, index, and band powers are a schematic propofol-like model of depth, not a monitor readout. Self-contained, no libraries.
Spatial vs temporal · 23

Source localization

EEG measures voltages at the scalp, but the questions we ask are about the brain: where did this activity come from? Answering that means running the physics backwards — and running it backwards is where EEG meets its hardest limit.

Going forwards is easy and unique: given a source (a current dipole at some location and orientation) and a model of the head's conductivities, the scalp potentials are fully determined. Going backwards — from scalp map to source — is the inverse problem, and it is fundamentally ill-posed. Because of volume conduction (Section 02), infinitely many source configurations produce almost the same scalp pattern, so the answer is never unique.

Methods cope by adding assumptions: dipole fitting (a few point sources), or distributed estimates like minimum-norm and sLORETA (a smooth current image). All share the same weaknesses — estimates blur over centimetres and bias toward the surface, worsening for deep sources. Drag the dipole below to watch the scalp map form and the estimate smear; then switch to the resolution trade-off that defines EEG's place among brain-imaging methods.

8
16
32
64
15 %
Source depth
Scalp pattern
Localization blur
Sensors
Why this matters: source localization lets EEG estimate where a seizure or an evoked response begins, guiding epilepsy surgery and cognitive research — but its answers are hypotheses constrained by a head model, not photographs. This closes the guide's throughline: EEG trades spatial precision for unmatched speed. Everything you have seen — montages, referencing, filtering, artifact rejection, averaging, the frequency and connectivity measures — exists to squeeze reliable information out of a signal whose sources can never be seen sharply, only inferred.