Professional Documents
Culture Documents
DTW Slides
DTW Slides
• To align two sequences under certain constraints, such that the distance
between these two sequences is as small as possible.
• Distance between Same-length Sequences
n
xi yi , p 1
1
i 1
n
p p
Lp norm( x, y ) xi yi n
i i , p 2
2
i 1 x y
i 1
max xi yi , p
i
x x1 , x2 , x3 , x4 , x5 , x6 , x7 , x8 , x9
y y1 , y2 , y3 , y4 , y5 , y6 , y7 , y8 , y9
x x1 , x2 , xm , y y1 , y2 , yn
We want to find an alignment path p , q , p , q , p , q
1 1 2 2 k k
(subject to the alignment constraints), such that the distance along the
path is minimized:
x
k 2
dist ( x, y ) min yqi ,
pi , qi , i 1 k
i 1
pi
Alignment path =
x1 x2 x3 x4 x5 1,1 , 2, 2 , 2,3 , 3, 4 , 3,5 , 4, 6 , 5, 7 , 5,8
y1 y2 y3 y4 y5 y6 y7 y8
Di, j
Di 1, j
x, y: input vector/matrix
Di, j 1 Local paths: 0-45-90 degrees
Di 1, j 1
j DTW formulation:
x(i-1) x(i) i