Dynamic time warping algorithms