This alignment procedure may produce paths with high distortion subpaths.
we trim each path to retain the subpath with lowest average distortion and length at least L. More formally, given an alignment of length N , we seek to find m and n such that: We accomplish this by computing the length constrained minimum average distortion subsequence of the path sequence using an O(N log(L)) algorithm proposed by Lin et al (2002).