SoftwareX (Feb 2024)
PeakSwift: Mobile Detection of R-peaks in Single Lead Electrocardiograms
Abstract
The computational detection of R-peaks in an electrocardiogram (ECG) is particularly important for assessing vital signs in ambulatory settings. Algorithmic approaches are mainly open source and available for research purposes, primarily in the Python environment on stationary computers. This motivates the need for more support of mobile environments and their particular demands, such as context awareness and their limited computational resources.PeakSwift is a comprehensive Swift package designed for detecting R-peaks in single-lead ECG, tailored for the iOS environment. Its core functional features include on-device R-peak detection algorithms, quality assessment, and context-aware algorithm selection. PeakSwift is lightweight, extensible and modular. To evaluate its performance, a dedicated iOS application was developed, and a set of experiments was conducted using over 10,000 single-lead ECGs.The results demonstrated that PeakSwift achieves high reproducibility in detecting R-peaks compared to NeuroKit. In addition, its computational runtime was competitive.