Automatic gait phase segmentation method using a Hidden Markov Model