An optimal procedure for stride length estimation using foot-mounted magneto-inertial measurement units