Skip to main content
. 2021 May 16;21(10):3472. doi: 10.3390/s21103472
Algorithm 1: Determination of the start and end times.
  Input: amp, amp1, amp2,
   Output: v_Begin, v_End
   for n = 1: length(amp)
     switch status
     case {0, 1}
       If amp(n) > amp1
       Identify the entering and leaving stage;
       else if amp(n) > amp2
       May be the entering and leaving stage;
   else
           No one entering and leaving;
        End if
   case 2
        if amp(n) > amp2
      Keep entering and leaving stage;
        else
      entering and leaving stage will end;
        else
          End of entering and leaving stage;
         End if
   case 3
        Record the current stage and look for the next stage
     End switch
   end for