How slyhark-dev/qrs-detector-cyclone-v works
This repository implements a causal ECG QRS detector and heart-rate classifier for a Cyclone V FPGA, with MATLAB tooling to prepare MIT-BIH data and evaluate RTL results. The principal workflow runs from sampled ECG input through filtering, QRS detection, RR/rate classification, and board outputs. MATLAB’s documented batch workflow supplies vectors and annotations to RTL simulation, then compares and aggregates results. The README documents module roles and workflow, but no source excerpts were provided, so internal call details beyond those documented are not asserted.
Main entry points: generate_vhdl_vectors_batch.m Vector generation · tb_batch_ecg.vhd RTL batch simulation · qrs_detector.vhd QRS detector · download_mitbih_records.m Record download
Components 24
FPGA signal pipeline
- Input register
ecg_arrhythmia/ecg_input.vhd - Moving average
ecg_arrhythmia/ecg_filter.vhd - Bandpass filter
ecg_arrhythmia/ecg_filter_bp.vhd - QRS detector
ecg_arrhythmia/qrs_detector.vhd - RR calculator
ecg_arrhythmia/rr_calculator.vhd - Rate classifier
ecg_arrhythmia/classifier.vhd - Display outputs
ecg_arrhythmia/output_ctrl.vhd - ECG top entity
ecg_arrhythmia/top_ecg.vhd - Demo ECG memory
ecg_arrhythmia/ecg_rom.vhd
Data and validation
- MIT-BIH records
- Record download
ecg_matlab/download_mitbih_records.m - Vector generation
ecg_matlab/generate_vhdl_vectors_batch.m - RTL batch simulation
ecg_arrhythmia/tb_batch_ecg.vhd - Detection comparison
ecg_matlab/compare_vhdl_batch.m - Protocol reports
ecg_matlab/report_table3.m - Rate validation
ecg_matlab/validate_rate_classifier.m - BPM agreement
ecg_matlab/bland_altman_bpm.m
Analysis and ablations
- RTL emulation
ecg_matlab/emulate_rtl.m - Filter ablation
ecg_matlab/ablation_bandpass_v2.m - Parameter studies
ecg_matlab/sweep_floor_fixed_cal.m - ROM generation
ecg_matlab/generate_ecg_rom.m
Other components
- ECG samples
- DE1-SoC board
- PhysioNet
Connections 21
- ECG samples → Input register: supplies samples
README.md - Input register → Moving average: feeds samples
README.md - Moving average → QRS detector: filters signal
README.md - Bandpass filter → QRS detector: filters signal
README.md - QRS detector → RR calculator: provides peaks
README.md - RR calculator → Rate classifier: provides heart rate
README.md - Rate classifier → Display outputs: provides class
README.md - ECG top entity → DE1-SoC board: targets
README.md - ROM generation → Demo ECG memory: generates memory
README.md - Record download → PhysioNet: downloads records
README.md - Record download → MIT-BIH records: obtains records
README.md - MIT-BIH records → Vector generation: provides data
README.md - Vector generation → RTL batch simulation: supplies test vectors
README.md - RTL batch simulation → Detection comparison: writes detections
README.md - Detection comparison → Protocol reports: supplies counts
README.md - RTL batch simulation → Rate validation: validates classifier
README.md - RTL batch simulation → BPM agreement: supplies hardware rates
README.md - Vector generation → RTL emulation: supplies vectors
README.md - RTL emulation → RTL batch simulation: checks RTL output
README.md - Vector generation → Filter ablation: supplies vectors
README.md - Vector generation → Parameter studies: supplies vectors
README.md