Skip to main content
. 2025 Dec 19;26(1):15. doi: 10.3390/s26010015
Algorithm 1. Porr algorithm snippet performing peak detection.
for i in range (1, lenght_of_ECG_record):                        (1)
   if mwa[i-1] < mwa[i] and mwa[i + 1]<mwa[i]: # if True -> peak is detected   (2)
        if mwa [i] > threshold_I1 and (peak-signal_peaks[−1]) > 0.3·fs:      (3)
        # second condition checks if previous
        # peak is more than 108 samples
        # earlier (300 ms refractory blanking).
        # if True -> peak is R peak (algorithm
        # label)
# if False -> peak is a noise peak