detectEcgWithAngle(​ecg, fSInHz, varargin): Heartbeat detection using sample-to-sample angle

Implementation of the R-peak detector using the angle between successive samples.

Download
Download

You are now following this Submission

Cite As

David J. Mack (2026). detectEcgWithAngle(ecg, fSInHz, varargin): Heartbeat detection using sample-to-sample angle (https://uk.mathworks.com/matlabcentral/fileexchange/63184-detectecgwithangle-ecg-fsinhz-varargin-heartbeat-detection-using-sample-to-sample-angle), MATLAB Central File Exchange. Retrieved .

Acknowledgements

Inspired by: Plot (Big)

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.4.0

[!!!] Detection results may have changed for sampling rates ~= 200 Hz.
[FIX] Reintroduced the DESIGNFILT call for sampling rates ~= 200 Hz to get the filter coefficient right.
[FIX] Crash when plotting detection results with only 1 peak.

Download
1.3.0

[FIX] Crash when plotting empty detection results.
[FIX] Crash when plotting data with all-normal rr intervals.
[ADD] New optional input 'minTStartInSec' to remove erroneous detections at the start of the recording.

Download
1.2.0

Forgot to mention another modification:
[MOD] The transfer function representation of the bandpass-filter is now to avoid calling the slow DESIGNFILT method every time. This also removes the according dependency.

Download
1.1.0

[FIX] Checks for optional dependencies now work properly.

Download
1.0.0

Download