Skip to main content
. 2020 Oct 5;20(19):5683. doi: 10.3390/s20195683
Algorithm 2 Algorithm for PAC/PVC Detection on Non-AF Windows
Input: θ123,θ645:= degrees of included angle for ‘1-2-3’ and ‘6-4-5’ pattern, respectively.
θ24,θ42,θ12,θ23,θ64,θ45:= degrees of slope angle for ‘2-4’,‘4-2’,‘1-2’,‘2-3’,‘6-4’,‘4-5’ pattern,
 respectively
n123,n645,n24,n42,n12,n23,n64,n45:= number of ‘1-2-3’,‘6-4-5’,‘2-4’,‘4-2’,‘1-2’,‘2-3’,‘6-4’‘4-5’ pattern,
 respectively.
rzero:= ratio of zero quadrants
noutside:= number of points outside cross demarcation
Output: Arrhythmia type as NSR, AF, or PAC/PVC.
  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:  Arrhythmia=AF.
13: end if
14: else
15: Calculate std24 and std42, the standard deviation of θ24 and θ42, respectively.
16: if min(n24,n42)5 && std2410 && std4210 then
17:  Arrhythmia=PAC/PVC.
18: else
19;  Calculate std12,std23,std64,std45, the standard deviation of θ12, θ23, θ64, and θ45, respectively.
20:  if min(n64,n45)3 then
21:   Set std64=0 and std45=0.
22:  end if
23:  if min(n12,n23)3 then
24:   Set std12=0 and std23=0.
25:  end if
26:  if max(std12,std23,std64,std45)10 then
27:   Arrhythmia=PAC/PVC.
28:  else
29:   if rzero<0.5||noutside5 then
30:    Arrhythmia=AF.
31:   else
32:    Arrhythmia=NSR.
33:   end if
34:  end if
35: end if
36: end if
37: return Arrhythmia