dtw1m

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

Contents

Syntax

Description

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

[minDist, dtwPath, dtwTable] = dtw1m(...) 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] = dtw1m(vec1, vec2);
dtwPathPlot(vec1, vec2, dtwPath);

See Also

dtwPathPlot, dtwBridgePlot, dtw1, dtw2, dtw3.


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