Vous êtes sur la page 1sur 12

DYNAMIC TIME WARPING

(Application in Pattern Recognition)

Presented by

Dr Khurram Khurshid

DTW

Compare 2 sequences varying in time (speech)

Different sizes
Extended in time

00110011110

00011100011111110

Using DTW
1

y5

y4

y3

y2

y1
x1
( 0

x2

x3

x4

x5

x6

x7

1)

DTW

Steps:

D (1,1) = d (x1,y1)

For m = 2 to 7

D (m,1) = D (m-1, 1) + d (xm,y1)

For n = 2 to 5

D (1,n) = D (1, n 1) + d (x1,yn)

DTW
D(i, j 1)
D (i , j) =
D (i-1, j-1)

min

D(i-1, j)

d (xi,yi)

Here for d (xi , yi), we can just use the Euclidean distance.

d (xi , yi) =

(x i,k - y j,k)2
K=1

Using DTW
1

y5

y4

y3

y2

y1

x1
( 0

x2

x3

x4

x5

x6

x7

1)

STRING COMPARISON

ISSUES
Scale Invariance

Translation Invariance

EDIT / LEVENSHTEIN DISTANCE

Given strings s and t


Distance is shortest sequence of edit commands
that transform s to t, (or equivalently t to s).
Simple set of operations:
Copy character from s over to t (cost 0)
Delete a character in s (cost 1)
Insert a character in t (cost 1)
Substitute one character for another (cost 1)

EDIT / LEVENSHTEIN DISTANCE

10

EDIT / LEVENSHTEIN DISTANCE


Distance between SATURDAY and SUNDAY?

11

EDIT / LEVENSHTEIN DISTANCE

12

Vous aimerez peut-être aussi