Skip to main content

Configuration & Tuning

Parameters resolve as: Advanced Tuning (localStorage) > .env (VITE_*) > built-in defaults.

Environment Variables

cp .env.example .env
VariableDefaultDescription
VITE_EMA_ALPHA0.1EI EMA smoothing
VITE_ALERT_THRESHOLD0.3EI alert red line
VITE_INITIAL_UNRELIABLE30Warmup seconds
VITE_FOCUS_BASELINE15Baseline window
VITE_FOCUS_DECISION15Decision window
VITE_FOCUS_WARMUP30Pre-baseline wait

Must be prefixed with VITE_. Inlined at build time by Vite.

Tuning Scenarios

ScenarioEMA αAlertWarmup
Noisy hardware0.10.360s
Clean, fast0.350.620s
Default0.10.330s

Parameter Details

EMA Alpha: 0.05 (very smooth) → 0.5 (responsive). Default 0.1.

Alert Threshold: Also affects AI focus inference. 0.3 (loose) → 0.7 (strict).

Initial Unreliable & Focus Warmup: Must be kept in sync.

Advanced Tuning Panel

System page. Adjust → Apply & Reload. Reset to Defaults clears localStorage overrides.

Files Reference

  • src/config/eeg.ts — Global EEG constants
  • src/focus/config.ts — Focus parameters
  • .env.example — Env variable template
  • TUNING.md — Detailed tuning guidance