Skip to content

deanna-spinks/eeg_demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EEG Demo

Reproducible EEG streaming demo: simulated multi-band signals (delta/theta/alpha/beta), ring buffer with backpressure, REST + SSE API, and live canvas visualization.

Run

pip install -r requirements.txt
uvicorn app.main:app --reload

Open http://localhost:8000 for the UI; API at http://localhost:8000/api/.

Docker

docker build -t eeg-demo .
docker run -p 8000:8000 eeg-demo

API

Endpoint Description
GET /api/signals One EEG snapshot (timestamp + channels).
GET /api/stream Server-Sent Events stream of snapshots.
POST /api/config Update channels and sample rate (JSON body).
GET /api/status Buffer size, capacity, dropped sample count.
GET /api/health Liveness check.

Tests

pytest tests/ -v

Run from the eeg_demo directory.

Architecture

  • ServiceEEGService: multi-band signal generation, ring buffer (fixed capacity), drop count when full. Background asyncio task produces at sample rate.
  • API — FastAPI: polling (/api/signals), SSE (/api/stream), config and status.
  • Frontend — Single HTML/JS canvas; EventSource for stream, fallback to polling; scrolling traces per channel.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors