This is an engineering-oriented repo for getting the whole pipeline running: serial acquisition → real-time visualization → CSV logging → basic plots + PDF report. Treat it as a starting point for protocol parsing + visualization + reporting, not as a polished product.
Stars, forks, issues, and PRs are welcome. If you can reproduce, diagnose, or improve the signal processing / band-power analysis, a PR would be greatly appreciated.
Disclaimer: for learning/research/engineering experiments only. Not for medical diagnosis. Make sure you have proper authorization and privacy compliance before collecting or sharing data.
Many scripts, UI strings, and notes in this repo are written in Chinese. Non-native speakers may need extra effort (or use a translator) when navigating the code and outputs.
I’m not sure whether this comes from my algorithms, the hardware, electrode contact/placement, or general noise. In my setup (single-electrode, single-channel EEG near Fp1), I’ve noticed the “usefulness/accuracy” can look very different across bands.
Intuitively, Alpha/Beta should show clearer changes between “focus” and “relaxation”, but in my recordings:
- Alpha and Beta fluctuate only slightly
- Theta changes more noticeably: around 2000–1200 during focus, and 500–800 during relaxation (these are the amplitude ranges from my current pipeline/device output, not standardized physiological units)
I don’t have a strong biology/neuroscience background, so I can’t confidently tell whether the problem is in acquisition, preprocessing, band computation, or the device itself. If you have the setup to validate this and can propose a fix, please open an issue or submit a PR.
- EEG (serial capture / CSV replay):
edupython/Main.py - ECG (serial capture / CSV replay):
edupython/ecg/ecg_main.py - TGAM-style parser (EEG):
edupython/tgam_parser.py - EEG visualizer:
edupython/visualizer.py - ECG visualizer:
edupython/ecg/ecg_visualizer.py - EEG report from CSV (plots + PDF):
edupython/ecg/eeg_report_generator.py
There are also older/experimental scripts (e.g. edupython/EEG_project/, edupython/eeg/, edupython/ECG.py). They are kept for reference and iteration, not promised as stable features.
From repo root:
pip install -r requirements.txtThis covers the core features (UI + capture + reports). The training/ball prototypes under edupython/eeg/ may require extra deps like torch, scikit-learn, joblib, depending on what you run.
Run from repo root.
python edupython/Main.py --port COM5 --baud 57600 --fs 512python edupython/Main.py --csv path/to/your.csv --replay-hz 64 --fs 512python edupython/ecg/ecg_main.py --port COM5 --baud 57600 --fs 512python edupython/ecg/ecg_main.py --csv path/to/ecg.csv --replay-hz 512 --fs 512 --duration 10- PDF example: EEG_20250610_154959_report.pdf
Preview images generated alongside the PDF:
My own hardware is single-channel (single-lead) for both EEG/ECG. If you use a multi-channel / multi-lead device, you will likely need to adapt:
- The parser / protocol mapping (per-channel fields)
- The CSV schema (multiple columns per channel)
- The visualizers and any filtering/feature logic (per-channel plotting and analysis)
AGPL-3.0 dual-licensing. See LICENSE. For commercial closed-source/proprietary use, contact: 1374552774@qq.com (WeChat: Akuri2133).



