Illustration of the concept of dynamic time warping (DTW). The upper panel shows two time series x (black) and y (gray), as well as a mapping (red lines) of the time points in x into those in y. This mapping is optimal with respect to the step pattern "symmetric2", meaning the sum of all incorporated local distances (represented by lengths of the red lines) is minimal, given the constraints from the step pattern. The lower panel shows all local distances between time points in x and y in a contour plot, where the red path is associated with the lowest value of the cumulative distance (optimal alignment path).
Hempel et al. BMC Bioinformatics 2011 12:292 doi:10.1186/1471-2105-12-292