Skip to main content
. 2020 Oct 5;20(19):5683. doi: 10.3390/s20195683
Algorithm 1 Algorithm for PAC/PVC Detection on AF Windows
Input: θ123:= degrees of included angle for ‘1-2-3’ pattern
  θ645:= degrees of included angle for ‘6-4-5’ pattern
  n123:= number of ‘1-2-3’ pattern
  n645:= number of ‘6-4-5’ pattern
  rzero:= ratio of zero quadrants.
Output: Arrhythmia type as NSR, PAC/PVC, or AF.
  1: if (n123+n645)3 then
  2: Calculate std123 and std645, the standard deviation of θ123 and θ645, respectively.
  3: if n6451 then
  4:  Set std645=0.
  5: end if
  6: if n1231 then
  7:  Set std123=0.
  8: end if
  9: if std12310 && std64510 then
10:  Arrhythmia=PAC/PVC.
11: else
12:  if rzero<0.13 then
13:   Arrhythmia=AF.
14:  else
15:   Arrhythmia=NSR.
16:  end if
17: end if
18: else
19: if rzero<0.5 then
20:  Arrhythmia=AF.
21: else
22:  Arrhythmia=NSR.
23: end if
24: end if
25: return Arrhythmia