top of page
Search
  • kenta.morris

Step Detection: Algorithm Design and Testing

The usefulness of the algorithm lies in its ability to segment different states (eg. stance, push-off, swing, foot-down) of the gait cycle and extract useful metrics from the data. The entire step detection process is a finite state machine. Among each state, a unique detection algorithm is used to determine the validity of the state. If the detection algorithm fails at any point, the step is considered invalid. Only when the finite state machine successfully passes each state is when a step is considered valid. The picture shows a state transition diagram that outlines the possible paths of each state.


Push-off Detection: Using the average push-off times taken from the clinical gait bouts, similar signals are found with the use of cross correlation coefficient (CCC). The CCC calculation is done across the entire signal and produces a time series array of CCC values. Then, a peak detection algorithm is applied to the CCC values in order to find values greater then an absolute threshold of 0.85. Due to the normalized nature of the CCC values, if any part of the detected push-off is not within the mean +/- standard deviation of the average push-off signal, the push-off is declared invalid. A final check is then done to verify that this push-off does not overlap with any previous steps determined as valid. If all criteria is met, the finite state machine transitions to the swing-phase detection.


Swing phase detection: As mentioned in the signal description, the swing phase begins with a downwards acceleration followed by an upwards acceleration. This property produces a peak during the mid-swing. The mid-swing peak time (ms_time) is found using a peak detection algorithm that adapts to the mean and standard deviation swing phase times found in the clinical gait bouts. The peak detection was performed on a small section of the signal after the ms_time based on the swing_len described in Equation X. Once a peak is found a CCC calculation compares the swing down length (sd_len) and the portion of time 0.1 seconds after the ms_time with a -1 and +1 slope respectively. If the CCC value of both calculations are greater than 0.65, the finite state machine transitions to the foot down phase.


swing_len = sd_len_mean + sd_len_std + su_len_mean + su_len_std


Foot down detection: As outlined earlier, the start of the footdown phase can be identified through the sharp changes in acceleration from the heel strike. Thus, the derivative on the accelerometer signal was calculated with 3 consecutive points (a_t’ = (a_t+1 - a_t-1 ) / 2t). If a value with an (a_t`) < -5 was found within the hs_detect_len described in Equation Y, the foot detection was considered successful.

hs_detect_len = 0.5 + su_len_mean + 2 * su_len_std


Stance Detection: Since the transition from foot down to stance cannot be detected from the accelerometer signal, a delay of 0.1 seconds was added to represent that transition time. After the 0.1 second delay, the step was marked as complete.

Putting together these methods we have a complete algorithm for step detection. This was implemented in Python and tested on test data generated from wearing the prototype device on one foot with the pressure sensors and IMU. Pictured is an example of our algorithm detecting the step states on the test data.



11 views0 comments

Recent Posts

See All
bottom of page