4.75

4.8 | 8 ratings Rate this file 33 Downloads (last 30 days) File Size: 4.75 KB File ID: #16350
image thumbnail

Continuous Dynamic Time Warping

by

 

13 Sep 2007 (Updated )

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

Dynamic Time Warping inspired this file.

MATLAB release MATLAB 7 (R14)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (11)
13 Sep 2013 Loïc  
25 Apr 2013 Jan Motl  
18 Nov 2012 Matthew

Hi! any one know how to modify the script if two vectors are in different length?

31 Oct 2012 Fatemeh Saki

very very helpful code thank you so much

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

02 Aug 2011 Vlad Atanasiu  
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

30 Mar 2008 jose tabora

Nice code, and nice demo.

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

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 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.

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?

Updates

demo included

Contact us