dynamic_time_warping Algorithm for calculating the distance between two arrays or time series with different length