Welch Explorer
Welch parameters on real resting EEG — segment length, overlap, window, periodogram toggle and zero-padding — and a window mode that shows leakage on a pure tone plus real EEG.
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: welch · window — the widget below runs in welch. Use Share state to put the exact view in the URL.
What it does
A power-spectral-density estimator with every parameter exposed, running in the browser on two real 60-s single-channel recordings (ds-eegbci S001, O1, eyes open and eyes closed, 160 Hz). In welch mode you set the segment length, overlap and window, toggle the raw periodogram on and off, zero-pad the FFT, switch between log and linear axes, overlay eyes-open on eyes-closed, and read the resulting resolution (fs / nperseg), the number of segments and a variance proxy of the estimate (the split-half difference between the two halves of the recording), so the resolution–variance trade-off happens in front of you. In window mode a synthetic pure tone (a frequency you choose, deliberately off-bin) is added to the real trace, and switching windows shows the main lobe and side lobes; zero-padding shows interpolation, not resolution.
Controls
| Control | What it sets |
|---|---|
| Trace | Eyes open (EO) or eyes closed (EC); overlay both |
| Segment length | nperseg in seconds or samples; the readout shows the resulting resolution |
| Overlap | noverlap as a fraction; the readout shows the segment count |
| Window | Rectangular, Hann, Hamming, Tukey |
| Estimator | Welch average, or the single full-length periodogram for comparison |
Zero-pad (nfft) | Pad factor for the FFT grid |
| Axes | Log or linear power; frequency range |
Tone (window mode) | Frequency and amplitude of the added pure tone |
Second tone (window mode) | A second tone at a chosen separation, to test what resolves it |
What to look for
welch
- The periodogram is spiky and does not get smoother with more data; averaging segments does.
- Longer segments sharpen the alpha peak (finer resolution) but give fewer segments and a noisier estimate; shorter segments blur the peak into a hump.
- Going from no overlap to 50% overlap with a Hann window raises the segment count and steadies the estimate; beyond 50% the gains shrink.
- Eyes closed shows the alpha peak at O1 that eyes open lacks; read the peak frequency from the finest resolution the trace allows.
- The vertical axis is µV²/Hz; on a linear axis nothing above the alpha peak is visible, which is why the log axis is the default.
window
- An off-bin tone leaks: with a rectangular window its peak is flanked by high, slowly falling skirts; Hann widens the main lobe and drops the side lobes far below the peak.
- Leakage runs both ways: the real trace’s low-frequency power leaks upward under the tone with a rectangular window and much less with Hann.
- Zero-padding makes the curve smoother and lets you read the peak location more precisely, but the main lobe does not narrow.
- Two tones closer together than 1 / T stay one peak however much you pad; doubling the segment length separates them.
Used in
- L1.3 Power spectral density (
welch) - L1.4 Windowing, leakage and zero-padding (
window)
Data provenance
Both traces are 60-s single-channel derivatives (cropped; no other processing unless the sidecar says so) of ds-eegbci (O1; R01 eyes open and R02 eyes closed; 160 Hz; recorded with no hardware filters; ODC-By 1.0 on PhysioNet, CC0 on the OpenNeuro mirror), served from /data/widgets/w-welch-explorer/ and listed in data/manifest.json: subject S001, eo from R01 and ec from R02, both 0–60 s, written by data/scripts/extract_p1_widgets.py. The synthetic tone in window mode is generated in the browser. The frame’s provenance line reads each trace’s sidecar, which is the authoritative record if the assets are regenerated.
Open the code
site/src/components/widgets/w-welch-explorer/ — Widget.svelte, index.ts, README.md. DSP: Welch, FFT and windows from site/src/lib/dsp/. Repository link: TODO(confirm) (GitHub org/repo, §13 item 3).