dtw2m

Pure m-file implementation of DTW (dynamic time warping) with local paths of 0, 45, and 90 degrees

Contents

Syntax

Description

dtw2m(vec1, vec2, beginCorner, endCorner, plotOpt, distanceBound) returns the DTW distance between vec1 and vec2, assuming a local path constrains of 0, 45, and 90 degrees.

[minDist, dtwPath, dtwTable] = dtw2m(...) also return two extra results:

Note that this function is a pure m-file implementation which is slow but easy to customize.

Example

vec1=[71 73 75 80 80 80 78 76 75 73 71 71 71 73 75 76 76 68 76 76 75 73 71 70 70 69 68 68 72 74 78 79 80 80 78];
vec2=[69 69 73 75 79 80 79 78 76 73 72 71 70 70 69 69 69 71 73 75 76 76 76 76 76 75 73 71 70 70 71 73 75 80 80 80 78];
[minDist, dtwPath, dtwTable] = dtw2m(vec1, vec2);
dtwPathPlot(vec1, vec2, dtwPath);

See Also

dtwPathPlot, dtwBridgePlot, dtw1, dtw2, dtw3.


Top page   Next: dtw2.m   Prev:dtw3.m