Aperiodic Explorer
Adjust offset, exponent, optional knee and peaks on real resting PSDs; the model and residual update live, a quick fit and a precomputed specparam reference are shown, and two subjects or conditions can be compared side by side.
1 claim on this page is 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.
Modes: fit · compare — the widget below runs in fit. Use Share state to put the exact view in the URL.
What it does
Spectral parameterization by hand, on real data. The widget loads precomputed Welch PSDs (2-s Hann segments, 50% overlap, 0.5–60 Hz, on the raw run) of the eyes-open and eyes-closed baselines at O1 for twelve ds-eegbci subjects (S001–S012), each with a specparam fit over 1–40 Hz computed offline. In fit mode you drag the aperiodic offset and exponent (and an optional knee), add peaks with a centre frequency, power and bandwidth, and watch the model and the residual over the real PSD on log-log axes; an “auto-fit” button runs a simple in-browser quick fit (a linear regression of log power on log frequency outside the peaks) and the precomputed specparam fit is drawn as the reference, with the individual alpha frequency read from the alpha peak. In compare mode two subjects, or eyes open versus eyes closed for one subject, sit side by side with their two parameter sets.
Controls
| Control | What it sets |
|---|---|
| Subject / condition | Which PSD to fit (eyes open or eyes closed, per subject) |
| Offset, exponent | The aperiodic line in log-log space |
| Knee | Optional; bends the line at a chosen frequency |
| Peaks | Add or remove; centre frequency (Hz), power above the aperiodic line (log10 units), bandwidth (Hz) |
| Quick fit | In-browser fit of the aperiodic line outside the peaks; labelled as a quick fit |
| Reference | Show or hide the precomputed specparam fit and its settings |
| Flattened spectrum | PSD minus the aperiodic line — where peaks live |
| Residual | PSD minus model |
| Band-power table | Power in conventional bands for the data and the model, updating as you move the sliders |
Compare (compare mode) | Two panels: subject A vs B, or EO vs EC for one subject, with both parameter sets |
What to look for
fit
- On log-log axes the background is close to a straight line; the exponent tilts it and the offset shifts it.
- Peaks sit above the line; a bump that disappears when the line is set correctly was slope, not rhythm.
- The residual is flat and small when both components are right; a tilted residual means the exponent is wrong, a bump means a missing peak.
- The quick fit and the specparam reference differ mostly where peaks pull the simple line; that is why the joint fit exists.
- The individual alpha frequency is the centre of the alpha peak, and it differs between subjects by a couple of hertz.
compare
- Eyes closed versus eyes open in one subject differs mainly by the alpha peak; the aperiodic parameters change less (check whether they change at all).
- Two subjects can differ in exponent with no peak difference, and their band powers then differ in every band together.
- Read both parameter sets before saying which spectrum “has more” of any band.
Used in
- L1.7 Aperiodic and periodic components (
fit) - L4.6 Is it really an oscillation? (
compare; Phase 3)
Data provenance
psds.json is a JSON-only asset generated by data/scripts/extract_p1_widgets.py: per-subject Welch PSDs (µV²/Hz; Hann, nperseg 320, noverlap 160, 0.5–60 Hz, whole raw run) of the ds-eegbci R01 (eyes open) and R02 (eyes closed) baselines at O1 for subjects S001–S012, none of which is among the documented defective subjects (S088, S089, S092, S100, excluded by rule), each with a specparam 2.0.0rc4 fit over 1–40 Hz in fixed mode (max 6 peaks, peak width 1–8 Hz, minimum peak height 0.1, peak threshold 2.0) with offset, exponent, peaks, R² and error. ds-eegbci was recorded with no hardware filters (ODC-By 1.0 on PhysioNet, CC0 on the OpenNeuro mirror). The asset is listed in data/manifest.json with SHA-256 and size and carries dataset, generated_by, generated_at, license and source_doi at the top level; fits are label_source: algorithmic until the author reviews them.
Open the code
site/src/components/widgets/w-aperiodic-explorer/ — Widget.svelte, index.ts, README.md. Repository link: TODO(confirm) (GitHub org/repo, §13 item 3).