Skip to main content

Real-Time BCI Setup

This page owns hardware and acquisition setup: how EEG gets from an amplifier into embedding or feature chunks that Nimbus can consume. For SDK streaming APIs, see Streaming Inference Configuration, Python Streaming Inference, and Julia Streaming Inference.
Online encode path: amplifier → preprocess → frozen trunk encode → embedding chunks → Personalizer / streaming session → BrainState.
Classical path: amplifier → preprocess → CSP/bandpower chunks → head / streaming session.

Real-Time Pipeline

Nimbus expects embedding or feature chunks, not raw EEG. Your acquisition loop should filter, clean, window, and either encode or extract features before calling the SDK.

Acquisition Options

Setup Checklist

  1. Confirm amplifier sampling rate and channel order.
  2. Synchronize event markers with EEG samples.
  3. Apply artifact handling and feature extraction in the same way as calibration.
  4. Emit chunks with stable shape: (n_features, chunk_size).
  5. Use the same normalization parameters from training.
  6. Measure latency around preprocessing and SDK inference separately.
  7. Add rejection thresholds for low-confidence or high-entropy decisions.

LSL Pattern

Use LSL when you need synchronized EEG and marker streams.

BrainFlow Pattern

Use BrainFlow when you want one API across supported EEG boards.

Latency Budget

Profile each stage separately. If latency is high, the bottleneck is often acquisition buffering or feature extraction rather than model inference.

Production Guardrails

  • Warm up model and preprocessing code before the session starts.
  • Use fixed-size buffers to avoid unbounded memory growth.
  • Reset streaming sessions between trials.
  • Log per-stage latency, confidence, entropy, and rejection decisions.
  • Keep calibration preprocessing and online preprocessing identical.

Next Read

Streaming Inference Configuration

Choose chunk sizes and aggregation methods.

Python Streaming Inference

Use StreamingSession in Python.

Julia Streaming Inference

Use init_streaming, process_chunk, and finalize_trial in Julia.

Preprocessing Requirements

Prepare feature-space inputs correctly.