feat: multimodal BCI pipeline with real PhysioNet EDF validation#2
Open
feat: multimodal BCI pipeline with real PhysioNet EDF validation#2
Conversation
Add 8 Zig modules for brain-computer interface signal processing: - dsi24_parser: Wearable Sensing DSI-24 24ch dry EEG packet parsing - fnirs_processor: Modified Beer-Lambert Law (HbO/HbR/HbT from raw optical) - eyetracking: IVT fixation/saccade classifier with pupillometry - lsl_inlet: Lab Streaming Layer multi-modal temporal synchronization - pose_bridge: Body tracking joint angles → movement trit classification - edf_writer: EDF+ format writer for EEG archival - edf_reader: EDF/EDF+ parser validated against PhysioNet BCI2000 data - bci_integration_test: 11 end-to-end tests across all modalities Real-data validation using PhysioNet EEG Motor Movement/Imagery Dataset (S001R01.edf, 65ch, 160Hz, BCI2000). GF(3) conservation verified: eeg(0) + fnirs(+1) + eye(-1) = 0 mod 3 across all module boundaries. Python tools for LSL bridging, fNIRS mBLL, SNIRF/XDF export included. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
EDF reader now validates against 4 real-world EDF files: - fixture_2ch.edf (synthetic, 800B) - subsecond_starttime.edf (MNE testing, 4ch EDF+C, 17KB) - test_utf8_annotations.edf (MNE testing, 12ch synthetic waveforms, 48KB) - S001R01.edf (PhysioNet BCI2000, 65ch, 1.2MB, downloaded at test time) Additional format samples for future parsers: - minimal.xdf (XDF reference, 2 LSL streams, 2KB) - minimum_example.snirf (fNIRS HDF5, 14KB) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Connect fft_bands and propagator modules to integration tests. Test 12: EEG -> FFT -> BandPowers -> Cell -> neurofeedback_gate -> action. Test 13: Multi-modal lattice fusion with contradiction detection. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Zero-allocation multi-channel EEG classifier using ensemble averaging of spatially multiplexed reservoir states. Comptime-parameterized for DSI-24 (21ch), Cyton (8ch), and arbitrary channel counts. Features: - Heuristic weight init (works without training) - Uniform and entropy-weighted ensemble modes - Propagator cell integration via CellValue - Ring buffer for temporal smoothing (majority vote) - 9 unit tests + 2 integration tests (14-15) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Normalized LMS weight adaptation makes learning rate independent of feature scale (critical for FFT-derived band powers). Adds adapt() and adaptFromBandPowers() to ERC, plus 3 unit tests and 1 integration test (Test 16: zero-weight ERC learns correct trit classification from synthetic EEG → FFT pipeline in 200 epochs). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
New Modules
dsi24_parserfnirs_processoreyetrackinglsl_inletpose_bridgeedf_writeredf_readerbci_integration_testTest Fixtures
src/testdata/fixture_2ch.edf— 800-byte synthetic 2-channel EDF for embedded teststestdata/S001R01.edf— downloaded at test time from PhysioNet (1.2MB, gitignored)curl -sL -o testdata/S001R01.edf \ "https://physionet.org/files/eegmmidb/1.0.0/S001/S001R01.edf"Test plan
zig build test-bci— all 11 integration tests + per-module unit tests pass🤖 Generated with Claude Code