Key result
Novel automated framework integrates cyclic alternating pattern scoring and HRV analysis into one synchronized pipeline.
Why the study?
Multimodal sleep analysis requires separate EEG and ECG pipelines, limiting temporal alignment, reproducibility, and scalability of CAP scoring and HRV analysis.
This open-source framework successfully synchronizes automated CAP A1 detection and HRV analysis, lowering the engineering barrier for investigating brain-heart coupling during sleep.
May facilitate integrated CAP-HRV sleep research; leaves open prospective validation before clinical adoption.
Background Multimodal sleep analysis typically requires separate processing pipelines for electroencephalography (EEG) and electrocardiography (ECG), which complicates joint investigation of sleep microstructure and autonomic regulation. Cyclic alternating pattern (CAP) scoring and heart rate variability (HRV) analysis are routinely performed in different software environments, limiting temporal alignment, reproducibility, and scalability. Methods We present an open-source MATLAB framework that integrates rule-based CAP A1 detection and HRV feature extraction within a single, time-synchronized workflow. The pipeline performs standardized EEG and ECG preprocessing, rule-based CAP A1 detection during slow-wave sleep (SWS) implementing the Terzano scoring criteria, R-peak detection via the Pan–Tompkins algorithm, and computation of time-domain, frequency-domain, and nonlinear HRV features by calling the open-source PhysioZoo/mhrv toolbox directly. CAP annotations are aligned with 5-minute ECG epochs through the shared polysomnography (PSG) time base. The complete code is released as an open-source repository to support reuse and extension. Results Because HRV features are computed by calling the PhysioZoo/mhrv toolbox directly, the pipeline introduces no reimplemented HRV routine and inherits that toolbox’s validated feature definitions. CAP A1 detection is provided as a rule-based implementation of published criteria and has not yet been benchmarked against expert manual scoring. A worked example on the OSAD+ subgroup (n = 18) demonstrates pipeline output across CAP and non-CAP epochs, and a healthy-sleep A1-event HRV reference is reported from the public CAP Sleep Database (15 controls, 785 A1 epochs) as a descriptive cross-database reference. Conclusion The framework provides a reproducible, rule-based, and modular tool for integrated EEG–ECG analysis of sleep microstructure and autonomic dynamics. By enabling synchronized CAP–HRV feature extraction in a single environment, it lowers the engineering barrier to brain–heart coupling research during sleep and provides a foundation for future extensions, including validated CAP detection, a matched-control study, a Python port, and cloud-based deployment.
No takes yet. Share an insight, caveat, or question.
Shukir et al. (2026) studied Obstructive Sleep Apnea and sleep microarchitecture (n=59). Automated EEG-ECG framework for CAP-HRV analysis was evaluated on Development and demonstration of a single, time-synchronized workflow for rule-based CAP A1 detection and HRV feature extraction. An automated, open-source MATLAB framework successfully integrated cyclic alternating pattern scoring and heart rate variability analysis into a single time-synchronized pipeline without the need for manual alignment.
Synapse has enriched 5 closely related papers on similar clinical questions. Consider them for comparative context: