Level 4 L4.4 judgment thread

Baseline normalization and ERD/ERS

Why raw TF power needs normalization, dB versus percent versus z baselines, choosing an edge-safe baseline, and computing ERD/ERS.

~60 min Widget: w-tf-baseline-explorer Notebook: nb-4-4-erd

Prerequisites: L4.2 · STFT and Morlet wavelets

2 claims on this page are unverified. TODO(confirm) marks a specific statement the author has not yet checked against a primary source. Everything else on this page has been reviewed. Treat a marked claim as provisional and go to the cited source rather than quoting the sentence.

Objectives

  • Explain why raw TF power needs normalization
  • Apply dB, percent and z-score baselines
  • Choose a baseline period that avoids edge effects and post-stimulus activity
  • Compute event-related desynchronization and synchronization

Why this matters

A raw time-frequency map is unreadable and a normalized one is a ratio — which means the number you report depends as much on the divisor as on the response. Move the baseline window a second later and an event-related decrease turns into an event-related increase before the event; move it into the first half-second of the epoch and an apparent desynchronisation appears at every frequency and every latency, including where nothing happened. The normalization is not a display step. It is part of the measurement, and it has to be reported like one.

Concepts

Why raw power cannot be read

Scalp EEG power falls off steeply with frequency (L1.7). On the epoch the widget serves, power at 4 Hz is hundreds of times the power at 20 Hz, so a map painted on a single linear scale is a picture of the 1/f background with the response invisible on top of it. Plotting the logarithm helps with the display and does nothing for the comparison: the quantity you want is this frequency now, against this frequency at rest, and that is a within-row ratio.

That framing has a consequence worth stating before any arithmetic: normalization makes every frequency row comparable to itself and to no one else. A normalized map can tell you that mu fell by half and beta by a third; it cannot tell you that mu is larger than beta, because that information was divided out on purpose.

The three normalizations

With m(f) the mean and σ(f) the standard deviation of power over the time points inside the baseline window, at frequency f:

dB       10 · log10( P / m )
percent  100 · ( P − m ) / m
z        ( P − m ) / σ
  • dB and percent are two readings of the same ratio, so they can never disagree about the sign or the location of an effect: −50 % is exactly −3.01 dB, +100 % is exactly +3.01 dB. dB is symmetric about zero, which suits a map with increases and decreases on it; percent is easier to read aloud but its scale is asymmetric (a decrease is bounded below by −100 %, an increase is unbounded), which makes a diverging colour scale awkward.
  • z divides by a spread rather than by a mean, so it is the only one of the three that is sensitive to how variable the baseline was. A short baseline, or an unusually quiet one, gives a small divisor and inflates every value on the map. A large z is a statement about the baseline as much as about the response.

Which spread the z uses has to be stated. There are two conventions and they are different quantities:

  • the spread of the baseline over its own time points, computed on a map that has already been averaged over trials — this is what the shipped asset supports and what mne.baseline.rescale’s zscore mode computes;
  • the spread of single-trial power across trials at each time point — a different and arguably more meaningful denominator, which cannot be computed from an averaged map at all.

The widget names the convention in full because a “z-scored time-frequency map” in a methods section could be either. TODO(confirm): shipping the across-trial z would need the single-trial maps (1.83 MB for this asset), which the data track ruled against; whether the lesson should instead teach the across-trial convention as the default is a question for the author.

ERD and ERS

Event-related desynchronization is a decrease in band power relative to a pre-event reference, and event-related synchronization is an increase; (Pfurtscheller, 1999) is the standard treatment. The names come from a mechanistic reading — desynchronization of a population that had been firing coherently — and that reading is a model, not a measurement. What is measured is a ratio of band power to baseline band power, and every warning in pf-band-power-slope applies: a band with no spectral peak in it has no rhythm to desynchronize, and a change in band power there is a change in the aperiodic spectrum (L4.6).

The canonical example, and the one this lesson uses, is the mu (8–13 Hz) and beta (13–30 Hz) decrease over sensorimotor cortex during movement or motor imagery, largest contralateral to the hand involved. That lateralization is what makes it useful for decoding (L5.7) and what the capstone tests.

The order of operations changes the answer

“Mu ERD was −48 %” can be computed two ways, and they do not agree:

  • band-first — average the raw power over the frequency band and over trials, then normalize that single time course against its own baseline;
  • cell-first — normalize every time × frequency cell against its own baseline, then average the normalized values over the band.

The mean of a ratio is not the ratio of means. Band-first lets the loud frequency rows dominate the band summary; cell-first weights every row equally. On the shipped C3 map the mu summary is −47.9 % band-first and −44.0 % cell-first; on C4 it is −10.5 % against −9.0 %. Neither is wrong and no tolerance can reconcile them, so a report that does not say which order it used is ambiguous. The widget shows both side by side and names which one the headline table is using.

The same question arises one level up, for single trials: normalize each trial against its own baseline and then average, or average the raw power and normalize once? (Grandchamp, 2011) treats this directly and it is worth reading before choosing; the single-trial route changes the weight each trial carries and interacts with how noisy each trial’s own baseline is.

Choosing the baseline window

Four constraints, in order of how often they are broken:

  1. Outside the edge-effect margin. The estimate within 5 σ_t of either end of the epoch is made partly of padding (L4.2), and at low frequencies it is usually inflated. A baseline there is a divisor the recording did not produce, and because it divides the whole map, the result is an apparent desynchronisation everywhere. This is pf-tf-edge-effects and it is the single most common way a TF map goes wrong.
  2. Before the event, with room to spare. The wavelet’s temporal smoothing reaches forward as well as back, so a baseline ending at t = 0 already contains post-event data smeared backwards by the temporal FWHM of the widest wavelet. End it early enough that it does not.
  3. Long enough to be a stable estimate. A baseline of a handful of samples has a noisy mean, and that noise is then spread across the whole map. It matters more for z, which also needs the spread to be estimated.
  4. Common across conditions unless you have a reason. A condition-specific baseline removes any pre-event difference between conditions — which is a legitimate choice when the difference is a nuisance and a catastrophe when it is part of the effect. If the conditions differ before the event, say so and show the un-normalized maps; that is the time-frequency form of pf-baseline-contamination.

The asset’s own default, [−1.5, −0.5] s, satisfies the first three by construction: the edge region ends at −1.903 s, so the window starts 0.403 s clear of it, and it ends 0.5 s before the cue.

The data behind this lesson

  • ds-eegbci, ODC-By 1.0, open access; 64 channels, 160 Hz, no hardware filters. The widget serves raw, un-normalized time-frequency power for C3 and C4, subject S001, runs R04 + R08 + R12, 22 right-fist motor-imagery trials (annotation code T2; 7 + 7 + 8), from −2.5 to +4.5 s around the cue at 40 Hz, 37 frequency rows from 4 to 40 Hz with n_cycles = max(3, f/2). The stored quantity is total power — the mean over trials of single-trial Morlet power — not the power of the trial average. Average-referenced over the 64 EEG channels offline. The imagery interval is 4.1 s, from the EDF’s own annotation.
  • Because the asset is un-normalized, every normalization is applied in the browser and the baseline window is genuinely live. The sidecar also carries the values the data script measured from this very asset with named windows, so the widget’s read-out can be checked rather than trusted.
  • The subject was selected, and the selection matters. Ten candidate subjects were run through the identical pipeline and ranked by C3 mu ERD; S001 is the most negative of them at −47.9 %. Across the ten the median is −23.1 % and the range runs from −47.9 % to +6.6 % — two of the ten show an increase at C3 — and only 6 of the 10 have C3 more negative than C4, which is the contralateral pattern the textbook describes. S001 is a teaching example chosen for legibility; nothing about the cohort follows from it, and the capstone is where the cohort question is actually asked.
  • Excluded from the candidate pool: S088, S089, S092 and S100 for inconsistent event timestamps, plus S038 and S104, which are also commonly dropped. TODO(confirm): ds-eegbci’s own online reference is not documented in the catalogue, so the offline average reference is this site’s choice; the sidecar records that the C3 mu ERD roughly doubles under it on every candidate subject measured.

Explore

Baseline explorer — move the baseline window and switch the normalization on raw, un-normalized time-frequency power

mode: default Open lab page →
Loading Baseline explorer — move the baseline window and switch the normalization on raw, un-normalized time-frequency power…

What to look for

Data: ds-eegbci , subject S001, run R04+R08+R12, -2.5–4.5 s · license ODC-By-1.0 · DOI 10.13026/C28G6P · labels: algorithmic · a cropped, re-referenced or filtered derivative of the source recording.

Start in raw power and try to read the response off the map; you cannot, and that failure is the argument for everything else. Switch to dB, then to percent, and confirm that the picture is identical and only the ruler changed. Then break it on purpose: drag the baseline forward into the response and watch the desynchronisation shrink while a mirror-image increase appears before the event; drag it into the shaded margin at the start of the epoch and watch an ERD appear everywhere at once. Switch to z with a short baseline and watch the values inflate while dB and percent barely move. Finally set the band summary to band-first, read the mu number, switch to cell-first and read it again.

Practice

Baseline normalisation and ERD/ERS: dB against percent against z, where the baseline goes, and the four averaging orders that give four different answers nb-4-4-erd

Level 4 ~5 min
notebooks/L4/nb-4-4-erd.ipynb

Downloads from ds-eegbci.

Open in Colab Download Read it here

The notebook computes mu and beta ERD for left- and right-hand imagery on ds-eegbci at C3 and C4, with the baseline, the window, the band, the cycle scheme and the averaging order all stated in one cell, and prints the numbers the exercises ask for.

Exercises

Use the widget’s default windows — baseline −1.5 to −0.5 s, active window 0.5 to 3.5 s — the mu band 8–13 Hz, percent change, and the band-first summary: average the raw, un-normalized power over the trials and over the band first, and normalize that one time course against its own baseline. (Do not normalize each time × frequency cell and then average the normalized values; that is the cell-first order and it gives a different answer.)

Exercise ex-4-4-mu-erd-c3

Numeric

Mean mu-band ERD at C3 over the active window, for right-fist motor imagery (percent change from baseline; a decrease is negative)

% change

Accepted within ±1.5 % change.

Exercise ex-4-4-mu-erd-c4

Numeric

Mean mu-band ERD at C4 over the same window, same trials, same order (percent change from baseline)

% change

Accepted within ±0.6 % change.

Exercise ex-4-4-baseline-placement

Multiple choice

You move the baseline window from −1.5…−0.5 s to 0.5…1.5 s — inside the imagery interval — and recompute the percent-change map. What happens, and why?

Options

Exercise ex-4-4-report-it

Free response

Write the methods sentences for the mu ERD result above, and then say what you would need before claiming that this subject shows the contralateral pattern.

Pitfalls

Pitfall

Time-frequency edge artifacts in the baseline

Symptom
Low-frequency power ramps at epoch edges; baseline inflated.
Cause

A time-frequency estimate at time t is a weighted sum of the signal over the estimator’s whole support around t. Near either end of the epoch part of that support falls outside the data, and the transform reads whatever the implementation puts there — zeros, a mirrored copy, the epoch’s own mean. The result is not random noise; it is a systematic distortion with a characteristic shape.

Detect
  • Compute the margin before you plot anything. From the cycle scheme and the lowest analysed frequency, work out the affected half-width, state which convention you used, and compare it with the distance from the epoch edge to the baseline window and to the reporting window. If the margin reaches either, you have the problem. - Transform the same window twice, from two epoch lengths. Cut a wide e…
Fix
  • Cut the epoch wider than the window you intend to report, transform at that length, and crop afterwards. The reporting window needs a clear margin at each end, computed from the widest wavelet in the analysis. This is the fix; the rest are mitigations. - Place the baseline entirely outside the margin, and end it early enough that the estimator’s forward smoothing has not already pulled post-eve…

Full entry with example →

Pitfall

Band power changes that are slope changes

Symptom
"More beta" with no beta peak; all bands shift together.
Cause

Band power is the area under the power spectrum in a frequency range, and the spectrum is a sum of two things: an aperiodic component, broadband and falling with frequency, described by an offset and an exponent; and whatever periodic peaks sit on top of it (L1.7). Integrating over a band adds both together and reports one number, so three physically different events are indistinguishable in it:

Detect
  • Fit the spectrum, per subject and per condition, and look at the peak list. If no peak has a centre frequency inside the band, do not name the band-power result after a rhythm. Report the fit range, the settings (peakwidthlimits, maxnpeaks, minpeakheight, peakthreshold), the aperiodic mode and the fit quality alongside. - Check whether the “peak” is at the detection floor. A peak whose fitted p…
Fix
  • Parameterize the spectrum and report the parameters — aperiodic offset and exponent (and knee where used), and every peak’s centre frequency, power and bandwidth, with the settings and the fit quality. Prefer the peak’s own parameters to band power wherever the question allows: “the alpha peak fell by 0.6 µV² and moved 0.4 Hz lower” is a claim about a rhythm; “alpha power fell” is not. - If the…

Full entry with example →

In other tools

In other toolsEEGLAB · FieldTrip — names only

The equivalents of what this lesson does, for a reader who works in another toolbox. Function names only: their own documentation is the place to learn how to call them.

EEGLAB

  • newtimef(baseline)EEGLAB

FieldTrip

  • ft_freqbaselineFieldTrip

Names checked 2026-09-18 against EEGLAB 2026.0.0 (plugins at the versions in EEGLAB’s own plugin list) and FieldTrip 20251218.

Reading

  1. Pfurtscheller & Lopes da Silva (1999). ERD/ERS. unverified
  2. Grandchamp & Delorme (2011). Single-trial normalization. unverified