Golden-tested DSP
Every number is checked against a numpy/scipy reference oracle
Filtering, Welch PSD, the six band powers, frontal alpha asymmetry, the Hilbert phase-locking value, the complexity measures: every one has a numpy/scipy counterpart. Production code has to reproduce the oracle’s output, not merely something plausible. If a change moves a value, the tests go red.
That is a narrower claim than an accuracy figure, and much harder to fake: the arithmetic between the electrode and the band power is not something you have to take on trust.
- 4th-order Butterworth
- 0.5–49.9 Hz
- 50 Hz notch
- zero-phase
- 1024 samples/channel
- median ± MAD
- 6.0 robust sigma
- 2% bad-sample flag
Six bands, and beta cut in two
Low beta (13–18 Hz) and high beta (18–30 Hz) are kept apart. Averaged into one beta figure they cancel: settled, alert attention and restless agitation end up reported as the same number.
Published state profiles, not a trained model
Malipeddi et al., 2024 · N = 103
Band powers are scored by closed-form Gaussian likelihood against profiles from that paper. No learned model anywhere in the analysis path, and no per-user calibration: the arithmetic on the thousandth sitting is the arithmetic on the first.
Refusal
When it declines to answer
Two things can stop an epoch before it is given a state, and they are checked in that order. Two others once did, and no longer do.
First the spectrum, and only where it is arithmetically impossible rather than merely unusual. An epoch the transform could not turn into band powers at all has nothing to score, and a relative band below 4 Hz that is exactly empty is a broken integration rather than a quiet brain.
A third rule used to sit here: relative gamma above 0.350, on the grounds that 30–50 Hz power that high is jaw and brow muscle rather than cortex. The physiology is real — on temporal and frontal electrodes muscle runs roughly a hundred to one over genuine high-frequency neural activity, and the brow muscle’s own peak sits at 30–40 Hz, inside the band. The threshold was not. It was the 99th percentile of a laboratory recording made with wet electrodes and a clinical amplifier, and this product runs on a dry headband worn on a real head, where that band is never clean at any level. Published comparisons of the two find the consumer band’s gamma barely relates to the research amplifier’s at all — and disagree even about which direction it is wrong in. A number that unreliable can lower a confidence. It should not be allowed to withhold a reading, which is the strongest thing this system can say. Elevated gamma now discounts every state instead, and where an epoch really is unreadable, the distance rule below catches it on a threshold that was derived rather than borrowed.
Then the distance. Each state is a Gaussian in five coordinates, so it is possible to ask how far an epoch sits from the nearest one in units of that state’s own spread — and to refuse an epoch that is further out than the state itself would plausibly reach.
distance > 2.17 σ per coordinate → no reading
That threshold is derived rather than picked. It is the 99.9th percentile of the scoring statistic under the classifier’s own model, so at most one genuine epoch in a thousand is declined on distance — a false-refusal rate stated in advance instead of discovered afterwards. Change one of the five weights and the threshold moves with it; it is a consequence of the model, not a dial.
The epochs that are read carry a ceiling on what may be claimed for them. At a perfect fit that ceiling is 0.84, and it falls to 0.50 at the distance where the reading is refused altogether — the point where, by construction, “this state” and “nothing I recognise” are a coin flip.
The 0.84 is borrowed, not measured. This judgement has no ground truth, so its accuracy cannot be tested; what can be quoted is how well trained experts agree with each other on the nearest comparable task, scoring graded drowsiness from EEG. Their agreement on the easiest, most clear-cut cases in that literature works out at 0.84 across five categories, and it collapses to chance in the grey zone. Four seconds of four-channel dry-electrode EEG is not entitled to claim more than the best two humans manage on an easier question.
That ceiling is also where the third check went. Every channel is still screened on its own — for a flat trace, for saturation against the amplifier’s limit, for a frozen stream, for a slow drift that has swamped everything else, and for an amplitude no scalp produces — and absolute amplitude is still the only thing that separates signal from nothing here, because relative band power is scale-free and pure noise divides into a perfectly respectable looking spectrum. None of that detection has changed: the verdict, the list of failing checks and the signal-quality figure are all still computed, still stored and still on the wire. What changed is what is done with them. A broken electrode no longer refuses the epoch. It discounts what may be claimed about it.
confidence ×= floor + (1 − floor) × signal quality
The floor is not a dial either. It is the ratio of the two anchors already in this section — 0.50, what the reject class forces at the refusal boundary, over 0.84, the ceiling at a perfect fit — which is 0.5952…. An epoch read off a signal with nothing usable left in it may claim the same fraction of the admissible ceiling as an epoch sitting exactly on the refusal boundary; both are statements that the evidence has run out, and it would be arbitrary for them to disagree. Quality is graded per channel, so on a four-channel band a clean epoch is untouched, one dead electrode of four (quality 0.75) costs 10% of the claim, and a wholly unusable epoch costs 40%. It is never zero, and that is the requirement rather than a softening: a zero empties every probability bar and puts back the blank panel, which cannot be told apart from nothing having arrived yet.
So the defects are reported beside the reading instead of in place of it — “Read from an imperfect signal”, what failed, the signal quality as a percentage, and that reseating the band usually helps — while the state, the five probabilities and the guṇa balance all stay on screen. A caveat is actionable and a blank panel is not: a state, its confidence, and “a channel is drifting” beside them tells the wearer both what was measured and what to fix, where the blank panel told them only the second — and told them it every four seconds.
The drift check was recalibrated in the same pass, from a trend ratio of 6.0 to 12.0, and it is measured from both sides. From below, on real EEG: across the 140-epoch, 560-channel PhysioNet eegmmidb fixture the per-channel trend ratio runs median 0.77, p95 3.68, p99 5.00, max 7.10 — so 6.0 sat inside the distribution of ordinary awake wet-electrode lab signal and fired on 3 of those 140 epochs, 2.1% of them, while 12.0 fires on 0 of 140. From above, by adding a linear ramp to the same real waveforms and re-running the whole shipped pipeline: at a trend ratio of 6 the worst-case change in the reported confidence is 0.0017 and the winning state never moves, 0 times in 20. The first ratio at which drift shifts the displayed confidence by even one percentage point is 30. The reason is upstream of the screen — the pipeline’s own first step is a 0.5–50 Hz zero-phase band-pass, which removes a DC ramp before any feature is computed.
That same band-pass is why the two absolute-amplitude checks — under 1.0 µV is a dead contact, over 250 µV is not a scalp — are now taken on the baseline-removed channel, a least-squares linear detrend, rather than on the raw MAD. That was a bug being fixed rather than a rule being loosened: a disconnected electrode drifts, and the drift inflated its raw MAD to between 18 and 222 µV, so it passed the flatline floor that exists to catch it.
The gamma discount was recalibrated in the same spirit and now has the same floor, for the same reason. It used to begin at 0.12 — below the level the profile table itself measures for an ordinary person doing a cognitive task, so a state was being docked a quarter of its confidence for carrying the very gamma that defines it — and to fall all the way to zero. A zero is worse there than anywhere else: it names a state and then empties every bar behind it, which is a blank panel with a label on top. It now begins where gamma exceeds anything any measured state carries, ends three standard deviations further out, and bottoms at the same 0.5952 the signal screen uses. The two discounts multiply, so an epoch that is both full of muscle and read off a broken electrode is charged twice.
The withheld probability is left visibly unclaimed rather than redistributed, so the five states on screen do not sum to one. A sitting has long stretches where the signal genuinely does not separate two states, and naming one anyway would be the wrong kind of confident. A system that always has an answer is not more capable, only less informative about which answers to believe.
Corroboration
Western neuromarkers sit underneath the Sanskrit label
- Signals agree
- Mixed signals
- Signals in tension
Under every state reading is a second layer: neuromarkers from the same epoch, read as signed evidence for or against it. It emits real caveats, such as low neural complexity that resembles drowsiness rather than genuine absorption. When the evidence dissents, the reading is downgraded rather than defended.
The rest of what an epoch carries
Band power is not all four seconds of signal will tell you. Each epoch also carries measures of how structured and how connected it is, which is what the corroboration layer reads.
- Lempel-Ziv complexity
- Higuchi fractal dimension
- sample entropy
- permutation entropy
- aperiodic 1/f fit · 2–40 Hz
- wSMI connectivity
- individual alpha frequency
Fixed properties
What one sitting is made of
None of these are results. They are the fixed dimensions of the pipeline: the rate it reads at, the window it reasons over, and the vocabulary it has to describe what it finds.
256 Hz
Samples a second, per channel
Muse S runs at 256 Hz and BrainBit at 250. Four channels either way, streamed into the browser over Web Bluetooth.
~4 s
One epoch
1024 samples per channel. A state reading lands roughly every four seconds, from raw signal to classified result.
40+
Metrics kept per epoch
Stored for replay and exportable as TXT, CSV or JSON, laid out for hand-annotation rather than for a dashboard.
- 5Chitta Bhūmi statesKṣipta · Vikṣipta · Ekāgra · Niruddha · Mūḍha
- 6Frequency bandsDelta through gamma, with low and high beta kept apart
- 14Practices in the vocabularyDhyāna, Trāṭaka, Nāḍī Śodhana, Yoga Nidrā and ten more
Developed alongside yogis in India
Tested with dozens of practitioners
Tested across a wide range of age groups
What we don’t claim: Delve is not a medical or diagnostic instrument and makes no health claims. Four channels give a whole-head average, not a per-electrode map of the brain.
