Automated detection of gait initiation and termination using wearable sensors