Skip to main content
. 2021 Jul 5;21(13):4592. doi: 10.3390/s21134592
Algorithm 1: Gait cycle detection algorithm.
Input: Gait acceleration x-axis signal
Output: Start and end points of each gait cycle
  • 1 

    Use Equation (1) to obtain all the minimal values of the input signal P1

  • 2 

    Use Equation (2) to initial screening P1 to obtain P2 after remove the pseudo-minimal values

  • 3 

    Use Equation (3) to obtain the estimated step size of the gait signal L.

  • 4 

    α=14,β=34,γ=16,p=2

  • 5 

    while p<length(P2) do

  • 6 

       if position_of(p)position_of(p1)<αL then

  • 7 

       if acceleration_of(p)<acceleration_of(p1) then

  • 8 

          remove(p)

  • 9 

       else

  • 10 

          remove(p1

  • 11 

       end

  • 12 

       end

  • 13 

       else if position_of(p)position_of(p1)<βL then

  • 14 

        if position_of(p+1)position_of(p)<γL then

  • 15 

         remove(p)

  • 16 

        else

  • 17 

         remove(p+1)

  • 18 

        end

  • 19 

       end

  • 20 

       p=p+1

  • 21 

    end