Automatic recognition of altered gait using wearable inertial sensors