The voltage from a few small discs on the scalp is read by how fast it wobbles. Watch the share of power near 10 Hz rise below while the eyes are closed, and the windows that hold a blink get thrown out.
Alpha rises when the eyes close
A synthetic EEG, 256 Hz, 30 s: pink background, a 10 Hz rhythm that grows from 10 to 20 s, four blinks.
30 s of synthetic EEG: a background, a 10 Hz rhythm and four blinks.
Describe this picture
A synthetic EEG, 256 Hz, 30 s: pink background, a 10 Hz rhythm that grows from 10 to 20 s, and four blinks. Two stacked panels share the time axis, 0 to 30 s. The first, the EEG, runs from −80 to 120 µV: the record is a thin solid trace, a dotted level at each of ±75 µV marks the reject limit, and a light shading covers 10 to 20 s, eyes closed. The second, the relative band power, runs from 0 to 100 % with one point per window, at the window’s centre. Alpha’s points are dots joined by a solid line, delta’s are squares joined by a dashed line, and a rejected window gets an open cross at its delta share instead, where both lines break. The readouts are the span, and alpha’s and delta’s shares, each averaged over the kept windows that lie wholly inside the span. There is no control. The 14 s clip opens on 30 s of EEG: a background, a 10 Hz rhythm and four blinks. From 2.5 s a box slides along the EEG, marking the 2 s window being measured, and each window’s points appear when the box reaches its centre. At 5.5 s, with the eyes closed, alpha’s share has risen to 72 % of the power over 10 to 15 s, with delta at 15 %. At the end, with the eyes open again, alpha falls back to 22 % over 20 to 30 s, with delta at 28 %, and the 10 windows touching a blink, with 75 % of their power in delta, are rejected.
Alpha rises when the eyes close
Put a few small metal discs on someone’s scalp and connect them to a very sensitive amplifier. You see a voltage that wobbles by a few tens of microvolts. It is the summed electrical activity of large groups of brain cells, seen through the skull and scalp. This is the electroencephalogram, or EEG.
Each disc, an electrode, gives one channel, and a clinical recording uses about twenty. On this page I use one channel.
The first thing people ask of an EEG is how fast it wobbles. The answer is sorted into frequency bands, each with a Greek name: delta from 1 to 4 Hz, theta from 4 to 8, alpha from 8 to 13, beta from 13 to 30 and gamma from 30 to 45. These edges are a convention, and books move them by a hertz or two. Gamma reaches higher too, but this page stops at 45 Hz.
The best-known rhythm is alpha, a wave near 10 Hz, strongest at the back of the head. Close your eyes and relax, and it grows. Open them, and it shrinks again. Hans Berger, who recorded the first human EEG, reported this in 1929.
Key idea
Every signal on this page is synthetic, built from the formulas below and the site’s seeded random generator. It is a teaching model, not a clinical tool: its numbers show how the methods work and say nothing about anyone’s brain.
The record
The record lasts 30 s at Hz, which is 7680 samples, in microvolts (µV). It adds three parts.
The background is the pink noise of “White, pink, brown” in Power spectral density (24.4). White Gaussian draws from seed 312 go through J. O. Smith’s filter. I run the filter on 2000 extra draws first and drop them, so the record starts settled. Then I scale the rest to an RMS of 10.00 µV.
Pink noise is a common stand-in for the background of an EEG, whose power also falls with frequency. The filter’s coefficients are those of 24.4. At 256 Hz it falls 2.95 dB per octave from 1 to 32 Hz, close to pink’s 3.01.
The alpha rhythm is , with in seconds. Its height is 15 µV from 10 to 20 s, while the eyes are closed, and 3 µV before and after. The change is a straight ramp lasting 0.5 s, centred on 10 s and on 20 s.
Then four blinks. The eye holds a small voltage between its front and back, and a blink changes the field that the electrodes near the eyes pick up: a large, slow bump. Each blink here is
in µV, the bell of “A Gaussian keeps its shape” in Transforms of common signals (8.3), with half-width 0.1 s. Its centre comes from seed 3121: 3.04, 6.99, 21.74 and 23.11 s, two before the eyes close and two after they open.
Without the blinks, the record stays within ±47.7 µV. With them, it spans −46.3 to 111.5 µV.
Band power, window by window
One Welch estimate of the whole 30 s would mix the eyes-open and eyes-closed parts. “Short window or long window” in Spectrograms & the STFT (15.5) shows the way out: cut the record into short windows, and estimate each window’s PSD.
Each window here is 2 s long, 512 samples, and the next starts 1 s later. That gives 29 windows, centred at 1, 2, …, 29 s.
In each window I use Welch’s method of Averaged periodograms: Bartlett and Welch (25.2): Hann segments of 1 s with half overlap, which gives 3 segments per window. As SciPy’s welch does by default, each segment’s mean is removed first.
The result is the one-sided density of Reading a spectrum: scaling and units (15.4), in µV²/Hz. Its bins are Hz apart.
A band’s band power is the power of the part of the signal that lies in the band, in µV². As in “Getting a tone’s power from a PSD” of 15.4, I add the density over the band’s bins and multiply by the bin spacing. I write it for alpha, for delta, and so on.
Each band takes its bins from its lower edge up to, but not including, its upper edge. For alpha, I add the estimate at 8, 9, 10, 11 and 12 Hz and multiply by 1 Hz. The bin at 13 Hz belongs to beta.
So the five bands share out the bins from 1 to 44 Hz, each bin to exactly one band, with no gaps. Each bin stands for the 1 Hz strip that starts at it, so together the bands cover 1 to 45 Hz.
The relative band power of alpha is divided by the same sum taken over all bins from 1 to 44 Hz, in percent. That sum is also the sum of the five band powers, so the five shares add up to 100 %. A share does not change when the whole recording gets louder or quieter.
Blinks fake delta
A blink is a slow bump. By 8.3, its spectrum is a bell too, with half-width rad/s, which is 1.6 Hz. So its energy sits at low frequencies: of the part between 1 and 45 Hz, 99.9 % lies in delta.
A window that holds a blink therefore shows a large delta share that has nothing to do with the brain. A part of a recording that does not come from the brain is an artefact.
The simplest defence is to throw such windows away, which is called rejection. A blink here reaches about 100 µV, and the rest of the record stays within ±47.7 µV. So I reject a window if any of its samples goes beyond ±75 µV.
Watching the shares
The picture at the top of the page works like a sound-level meter set to one octave band, watching one instrument of an orchestra enter and leave. It draws the record and then each window’s band shares.
Notice the alpha readout: 72 % in the first closed-eye windows, 22 % after the eyes open again. Over all nine kept windows with the eyes closed, centred 11 to 19 s, alpha’s share averages 73 %.
The windows centred at 10 and 20 s straddle a change of the eyes. Their alpha shares, 58 % and 61 %, lie in between, and no span counts them.
Now look at the crosses. The ten rejected windows are exactly those that hold a part of a blink above the limit. On average 75 % of their power sits in delta, against 19 % in the windows kept. The kept windows hold no visible part of a blink: the largest blink value inside one is about µV.
Average the trials, keep the response
Some brain responses are tied to an event: a sound, a flash, a letter on a screen. The voltage that follows an event and is caused by it is an event-related potential, or ERP.
A well-known one is the P300, a positive wave some 300 ms or more after an event the person was waiting for, such as a rare tone among common ones.
The trouble is size. The response on this page peaks at 5 µV, while the background is 10 µV RMS, so one trial hides it. The cure is to repeat the event many times, cut out the stretch of record after each one, and average.
Epochs and their average
Each stretch is an epoch, or trial: here 1 s, 256 samples, starting at the event. The index counts samples after the event.
I write trial as , the notation for a realisation in Random processes (24.2). Each trial is one realisation, and averaging trials sample by sample is the average across the ensemble of “Across the ensemble, along a realisation”. The average of the first trials is
The hat means “estimated”, as in 24.1: estimates the ensemble mean at each .
Each trial is the response plus that trial’s background. The response is the same every time, so the average keeps it whole. The backgrounds differ, and if they are unrelated to each other, “A longer average: less noise, more delay” of Simple smoothing filters (18.2) applies: averaging of them divides their RMS by .
With 10 µV of background, 100 trials should leave about µV.
The synthetic trials
The response, with in seconds after the event and the result in µV, is
It is a bell of 5 µV at 300 ms, shaped like a P300, and an earlier dip of 3 µV at 100 ms. On the 256 Hz grid its peak is 5.00 µV, at 301 ms.
The background is a fresh pink stream from seed 3120, made as before: the same filter, 2000 dropped draws, scaled to 10.00 µV RMS over its 25 600 samples. I cut it into 100 epochs, one after another, as if the events came once a second.
One second of pink noise holds more or less of its slow parts, so the epochs differ in size: their RMS runs from 6.92 to 15.09 µV.
Averaging works like stacking many photographs of the same face, taken with a shaky camera: the face sharpens, and the shake blurs away.
Average the trials, keep the response
100 synthetic 1 s epochs: a 5 µV response at 300 ms in 10 µV pink background (seed 3120).
One trial: the 5 µV response is lost in background of 12.3 µV RMS.
Describe this picture
100 synthetic 1 s epochs: a 5 µV response at 300 ms in 10 µV pink background (seed 3120). One panel, from −20 to 40 µV against time after the stimulus from 0 to 1000 ms. The average is a solid line and the true response a dashed line. The readouts are the number of trials, the noise left, the RMS of the average minus the response in µV, and . There is no control. The 13 s clip opens on one trial: the 5 µV response is lost in background of 12.3 µV RMS, against 10.0 µV predicted. From 3 s the picture changes to the average of 10: the noise falls to 2.2 µV, against 3.2, and a bump near 300 ms begins to show. From 8 s it changes to the average of 100: 1.1 µV left, against 1.0, and the response stands clear, its peak at 293 ms.
Watch the solid average close in on the dashed response as the trials pile up. Its noise left is the RMS of the average minus the response, and 18.2 predicts µV for it.
Notice the last frame. After 100 trials the noise left is 1.1 µV, against 1.0 µV for . The peak of the average is 6.09 µV at 293 ms, so the noise left still lifts it by 1.09 µV and moves it 8 ms early.
Why the noise left is not 1.0
The rule assumes that the trials’ backgrounds are unrelated. These are cut one after another from one stream, and pink noise’s slowest parts last longer than a second. A sample and the one a second later have a correlation coefficient of 0.11.
So neighbouring trials do not cancel fully. Counting that correlation, the square root of the expected noise power after 100 trials is 1.14 µV, not 1.0.
One record also scatters about that value. For 2000 other random streams made the same way, the noise left after 100 trials fell between 0.7 and 1.8 µV in 94 % of cases, so 1.1 µV is ordinary.
At ten trials this record was lucky. Its 2.2 µV is below the 3.2 µV of , and only 1.6 % of those 2000 streams did better. So tells you the trend, not the value for one record.
What the average assumes
The average rests on two assumptions. The response must be the same in every trial, at the same delay after the event. The background must be unrelated to the event, so that it does not repeat from trial to trial.
If the response wanders in time, the average smears it. Suppose the P300’s delay varies from trial to trial, as a Gaussian draw with a spread of 30 ms. Averaging over many trials adds that spread to the bell’s own, and for bells the squares add, as the variances of independent draws do in Random variables for signals (24.1).
The bell’s half-width becomes ms, and its peak falls to µV. Real P300s do wander, so an averaged P300 is lower and wider than the response in each trial.
If something outside the brain repeats with the event, it survives the average, as the response does. A person who blinks after every flash adds a blink to every trial at the same delay, and the average keeps it.
The maths behind it · projections and eigenvectors
With many electrodes, a blink makes a fixed pattern across the scalp: large at the front, small at the back. Collect the channels’ values into a vector at each instant. Artefact removal can then project out the direction of the blink’s pattern. That direction can be found as an eigenvector of the channels’ covariance matrix, or by independent component analysis, which this page does not cover.
The maths behind it · standard error and testing
The trial average is the sample mean at each instant, and its standard error falls as . Whether a response is really there is a hypothesis test across trials: is the mean at 300 ms different from zero, given how much the trials scatter?
Worked example
1. Averaging gain. One hundred trials divide unrelated noise by : 10 µV becomes 1 µV in theory. This record measured 1.1 µV, and the correlation of neighbouring trials predicted 1.14 µV. To halve the noise left again you need four times as many trials, 400.
2. Band edges in bins. Segments of 1 s at 256 Hz have bins Hz apart. Alpha, 8 to 13 Hz, takes the bins at 8, 9, 10, 11 and 12 Hz, so it is 5 bins wide.
Segments of 2 s would give bins 0.5 Hz apart and 10 alpha bins. But a 2 s window then holds only one segment, : the raw periodogram, with the full scatter of 25.2.
3. Predicting alpha’s share. In the nine kept windows with the eyes closed, the background’s five band powers add up to about 50 µV² on average, and its alpha band holds about 4 µV². So only about half of its 100 µV² falls in the bands: pink noise keeps much of its power below 1 Hz, 40 % of it.
The rhythm of height 15 µV has power µV². Its Hann lobe covers 9 to 11 Hz, so all of it lands in alpha. Alpha’s share should be about
That is close to the 73 % of all nine closed windows. The measured value averages the windows’ own shares, which is not quite the share of the averages. With the eyes open again, from 20 to 30 s, the 3 µV rhythm adds 4.5 µV². The same sum, with that span’s background, gives 20 % against the readout’s 22 %.
Where you’ll meet this
Sleep laboratories score a night in 30 s epochs, reading the EEG’s rhythms together with eye and muscle signals. Deep sleep is marked by slow, large delta waves. A lighter stage is marked by sleep spindles: bursts of 11 to 16 Hz that last half a second or more.
Neurofeedback systems show a person the power in one band as it changes, often alpha, and ask them to raise or lower it.
Hearing tests for newborns use averaged responses. Clicks play through a small earphone, and the device averages the EEG after each click to find the response of the brainstem’s hearing pathway. That response is well under 1 µV, so the device averages thousands of clicks.
A brain–computer interface can use the P300 to spell. Letters flash in rows and columns while the user counts the flashes of the wanted letter. Those flashes bring a P300, and averaging over several rounds finds the row and column that did.
The heart’s signal is processed with filters and a detector instead, in ECG processing (31.1). Band power over short windows returns for machines in Vibration and machine monitoring (32.1).
For more, see M. X Cohen, Analyzing Neural Time Series Data (2014), ch. 11 and 18; S. J. Luck, An Introduction to the Event-Related Potential Technique (2nd ed., 2014), ch. 1 and 8; and L. Sörnmo and P. Laguna, Bioelectrical Signal Processing in Cardiac and Neurological Applications (2005), ch. 3 and 4.
Reference card
| Quantity | Formula | Notes |
|---|---|---|
| Bands | delta 1–4, theta 4–8, alpha 8–13, beta 13–30, gamma 30–45 Hz | a convention; books differ a little |
| Band power | sum of the band’s PSD bins × bin spacing, e.g. | Welch on short windows; bins from the lower edge up to, not including, the upper edge |
| Relative power | band ÷ the same sum over 1–45 Hz | equals the five bands’ total; the shares add to 100 % |
| Artefact rejection | drop windows that go beyond ±75 µV | blinks |
| Trial average | noise ÷ if the trials’ noises are unrelated |