Dynamic Time Warping (DTW) algorithm implementation for .NET C#