Details
ai / research
Brain Signal Processing Game
A research neurofeedback system that turns OpenBCI EEG beta activity into a real-time Pygame aircraft feedback loop through Lab Streaming Layer.
Live 3D architecture
The scene beside this panel is this system's architecture. Drag to rotate, scroll panel to read on.
Problem
The project needed a complete closed loop: acquire EEG safely from OpenBCI, process noisy neural signals in near real time, extract the beta rhythm used by the research protocol, and turn that signal into a readable game interaction for adult ADHD attention-training experiments.
Contribution
Built the Python signal-processing path and game-facing integration pieces: LSL stream handling, buffered EEG windows, band-feature extraction, marker output, Pygame trial flow, stimulus timing, aircraft feedback behavior, and experiment-friendly local execution.
Architecture
The system is split into acquisition, processing, transport, and game layers. OpenBCI GUI captures EEG from 8 electrodes and streams floating-point data through LSL. A Python processing server buffers 3 second windows, applies 60 Hz notch and 4-100 Hz bandpass filtering, transforms the data with Welch power spectral density, extracts frequency-band features with beta emphasized, then publishes a marker stream. The Pygame layer consumes that marker, maps beta activity to aircraft movement, controls baseline and active phases, shows a focus cue, and ends sessions with positive feedback.
Technical decisions
Tradeoffs
Outcome
A concrete brain-computer interaction artifact: EEG acquisition, signal processing, asynchronous data transport, and an interactive neurofeedback game connected into one reproducible research software loop.
Signal-processing layer
The processing server is the bridge between raw EEG and game behavior. It waits for stable stream data, buffers samples into experiment-sized windows, cleans the signal, and emits a simple marker that the game can consume without knowing anything about EEG acquisition.
Game layer
The Pygame interface was designed as a feedback instrument rather than a normal game. It keeps the screen calm, uses a clear focus target, maps beta activity to aircraft movement, and separates baseline, active trial, and feedback states.
Research context
The article frames the work as software for adult ADHD neurofeedback research, where beta-rhythm feedback supports attention-training protocols and the implementation makes future replication easier.
Stack and domains
- Python
- OpenBCI
- Lab Streaming Layer
- pylsl
- NumPy
- SciPy
- Welch PSD
- Pygame
- EEG
- neurofeedback