4.5

4.5 | 4 ratings Rate this file 53 Downloads (last 30 days) File Size: 4.75 KB File ID: #16350
image thumbnail

Continuous Dynamic Time Warping

by Pau Micó

 

13 Sep 2007 (Updated 21 Apr 2008)

A version of the DTW algorithm. The CDTW calculates the similarity between 2 vectors

| Watch this File

File Information
Description

If you pass in 2 vectors it returns the unnormalized distance between the vectors, the accumulated distance between them, the length of the warping path (the normalizing factor), the warping path points and both warped input vectors.
You can plot the results too if select the pflag=1

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
Dynamic Time Warping

MATLAB release MATLAB 7 (R14)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (7)
30 Jan 2008 Darryl Wallace

It looks good. And the portion from the original dtw.m file by Timothy Felty works. But it stops for me at when calling the function 'div'. I'm not entirely certain what this will do so I have been reluctant to change it. But if I had to guess, would it be an integer division? i.e. div(11,2) => 11/2 = 5?

30 Jan 2008 Darryl Wallace

Ok yeah so I wrote a div function that is just

%% Start div function
q = div(num,den)
q = floor(num/den);
%% End div function.

and it appears to be working properly now.

25 Mar 2008 Ahmed Bderhman

I think this is a good working and had help me more.

I have this question: i like to change euclidean distance{d=(repmat(Test',1,N)-repmat(Ref,M,1)).^2;} with mahalanobis distance is it possipole? if yes how can i do that?

because i like to test the efficiency of my system when i use euclidean distance and when i used mahalnobis distance.

 

30 Mar 2008 jose tabora

Nice code, and nice demo.

Also thanks to Darryl Wallace for providing the needed correction to the div error.

28 Sep 2008 Harish Kumar

hi,

This refers to 2 vectors. What if this were to be used for polyline to polyline comparison?

Appreciate your replies. Thanks & Regards,
Harish

02 Aug 2011 Vlad Atanasiu  
05 Nov 2011 marco gomez

I don't understand the followig lines:

 w=[m n; w];

% warped waves
rw=r(w(:,1));
tw=t(w(:,2));

Could you explain to me? please.
Thanks

Please login to add a comment or rating.
Updates

demo included

21 Apr 2008

The reported problem with the 'div' function have been solved

Tag Activity for this File
Tag Applied By Date/Time
dsp Pau Micó 22 Oct 2008 09:26:48
time warping Pau Micó 22 Oct 2008 09:26:48
continuous dynamic time warping Pau Micó 22 Oct 2008 09:26:48
cdtw Pau Micó 22 Oct 2008 09:26:48
cdtw Vicky 25 Nov 2011 04:40:02
continuous dynamic time warping Vicky 25 Nov 2011 04:40:05
dsp Vicky 25 Nov 2011 04:40:08
time warping Vicky 25 Nov 2011 04:40:10

Contact us at files@mathworks.com