A repository for the signal synchronization and fusion project.
This is the initial repo skeleton. It contains a Software Requirements Specification (SRS) describing the goals, functional and non-functional requirements, and a proposed Python API for aligning and merging electrophysiology time-series from two MEF recordings.
brainmaze_sigfusion is a Python utility intended to:
- Compute a time-varying synchronization map between two MEF3 recordings with different duration and sampling rates.
- Allow saving/loading of the computed alignment map to avoid re-computation.
- Provide a unified reader that presents a single, temporally-aligned data stream to downstream analysis code while preferring a designated source when overlapping data exists.
Key design points:
- Two-stage alignment: coarse global alignment (envelope-based) and fine, chunk-based local alignment to handle non-linear clock drift and periodic artifacts.
- Memory- and performance-conscious processing (streaming, downsampling, and vectorized operations where possible).
- Sampling-rate independent: the system will handle differing input sample rates and present data at a chosen target or preferred-source rate.
The full Software Requirements Specification (SRS) is in:
software_requirements/sw_req.md
Open that file for the detailed requirements and a minimal proposed Python API.
documents/sw_req.md— Software Requirements Specification (SRS).
docs/testing.md— Testing and pytest implementation guide.
Development dependencies are declared in pyproject.toml under the dev optional-dependencies group. To set up a development environment and run tests, see docs/testing.md.
- Implement a minimal
SynchronizationMapclass (save/load) and add unit tests. - Implement
BrainmazeSync.compute_alignmentusing envelope downsampling for coarse alignment and a chunk-based refinement loop. Usemef_toolsfor lazy reading of MEF data. - Implement
UnifiedMefReader.read_datawith preference/fallback logic and stitching across sources. - Add a small CLI or notebook demonstrating alignment on sample data.
If you want me to scaffold the initial implementation or add unit tests / CI, tell me which piece to start with and I'll create a small, runnable prototype and tests.