EEG State Simulator
A lead-field based generator of synthetic multichannel EEG for arousal states.
The trace scrolls: new signal arrives at the right-hand edge and older signal leaves at the left, as on a paper chart. Drag the slider to scrub — that pauses. Changing µV/mm is not autoscaling: the scale is stated, and it is the same for every channel and every state, so the amplitude difference between N3 delta and waking alpha survives.
The pink bands mark injected events — the ground-truth spindles, K-complexes and slow oscillations, at the exact times the generator placed them. Mains adds 60 Hz interference with a per-channel phase and gain, so it cannot be removed by changing the reference.
Below the heavier rule sit respiration (belt displacement) and ECG. They are not EEG and are not in the montage: each is scaled to its own lane and states its full-scale range, because an ECG R wave is around 1000 µV and would be 14 cm tall at the scale above. Watch the heart rate rise on inspiration and fall on expiration — that is respiratory sinus arrhythmia, driven from the same respiratory phase that drives the EEG coupling in Demo 1.
State
A new seed is a new subject, not a new setting: every parameter is unchanged and only the random draws differ. The number stays editable so a seed can be written down and returned to — determinism is only useful if you can act on it.
Reference montage
Referencing is a linear operator on the data, not a display preference — average reference removes exactly one dimension by construction, and a Laplacian is a spatial high-pass. Watch the effective rank below change as you switch.
Filter panel
Drag the HP and LP handles on the spectrum. The faint curve is the raw signal, the dark curve is what survives the filter, and the dashed line is the filter's own response computed from its coefficients — not from the ratio of the two, so it can disagree with them.
Zero-phase runs the cascade twice, forwards then backwards, so it has no phase distortion but the stopband of double the order. Causal is what an acquisition system actually does and it distorts phase near the cutoff. A higher order rolls off faster and rings longer — Demo 3 below shows the ringing.
Alternatives to high-pass filtering exist — robust detrending (de Cheveigné & Arzounian) fits and removes a slow polynomial instead. It is a Tier 1 addition. High-pass filtering trades a known artifact for a known distortion; it is not a mistake.