Algorithm 2.
1: function SEGMENT(fz, filtered) |
2: filtered(i) = filtered(i+1) for i = 1:lag−1 |
3: fz = 1 if fz>1 and fz=0 if fz < 0 |
4: if fz == mean(filtered) then |
5: pext = 0 // swing phase |
6: filtered(lag) = fz |
7: else |
8: if ft>Fth then |
9: pext = 1 // stance phase |
10: else if ft≥ mean(filtered) then |
11: // increasing vertical load |
12: pext = 1 // stance phase |
13: else |
14: pext = 0 // swing phase |
15: end if |
16: filtered(lag) = influence·fz+(1−influence)·filtered(lag−1); |
17: end if |
18: return pext, filtered |
19: end function |