Skip to main content
. 2022 Mar 3;22(5):1984. doi: 10.3390/s22051984
Algorithm 1 HRV filtering procedure
  • 1:

    for each RRi < 0.3 s do

  • 2:

     Compute RRr=RRi+RRi+1, ERr (Equation (4)), ERl (Equation (5)) and Etotr (Equation (7))

  • 3:

     

  • 4:

    if RRr< 1.3 s and ERlE10 and ERrE10 then

  • 5:

      Right merge: Replace RRi+1 by RRr and delete RRi and its timestamp

  • 6:

     

  • 7:

    else Compute RRl=RRi+RRi1, and ELr (Equation (4)), ELl (Equation (5)) and Etotl (Equation (7))

  • 8:

       if RRl< 1.3 s and ELlE10 and ELrE10 then

  • 9:

       Left merge: Replace RRi by RRl and delete RRi1 and its timestamp

  • 10:

     

  • 11:

      else if RRr > 1.3 s and RRl > 1.3 s then

  • 12:

       Delete both RRi and RRi+1

  • 13:

     

  • 14:

      else if RRr < 1.3 s and RRl > 1.3 s then

  • 15:

       Replace RRi+1 by RRr and delete RRi and its timestamp

  • 16:

     

  • 17:

      else if RRr > 1.3 s and RRl < 1.3 s then

  • 18:

       Replace RRi1 by RRl and delete RRi and its timestamp

  • 19:

     

  • 20:

      else if Both RRl and RRr < 1.3 s but errors Etotr and Etotl are higher than 0.4 then

  • 21:

       Keep the one with the smaller error

  • 22:

      end if

  • 23:

    end if

  • 24:

    end for