Segmental dynamic time warping