Dynamic Time Wrapping (DTW) is an algorithm for measuring similarity between two temporal sequences which may vary in time or speed. It allows sequences to be aligned non-linearly by warping the time axis, minimizing distance between them. DTW was originally used for automatic speech recognition but has since been applied to other time-series data mining tasks.