Skip to main content
All three models share the same shape:
  • construct with new Model(sampleRateHz, channelCount)
  • call process(interleaved) with a Float32Array of interleaved samples ([s0_ch0, s0_ch1, …, s1_ch0, …]); getEegInterleavedSamples(frame) produces this from a headband frame
  • process returns a result object, or undefined until enough data has accumulated (min_samples() tells you how much)
  • call reset() to clear state
Because channelCount is only known once the first frame arrives, construct models inside your first-frame handler.

WasmAlphaBumpDetector

Detects alpha bumps: transient changes in alpha band power that indicate state transitions, such as eyes closing.
Tune with set_threshold(multiplier) and set_baseline_smoothing(alpha).

WasmAlphaPeakModel

Tracks the individual alpha peak frequency (typically 8 to 13 Hz), which varies from person to person.

WasmCalmnessModel

Computes a calmness score from the ratio of alpha to beta power. Higher alpha relative to beta generally indicates a more relaxed state.

AthenaWasmDecoder

Decodes raw Athena protocol packets from Muse S (Athena firmware) headbands. Used as a factory parameter for BleTransport:
The Athena decoder is typically not used directly. It is passed as a factory to BleTransport:

Next

Signal Processing

Band powers, FFT, spectrum analysis

Headband Transport

Frame schema and transport interface