4.33333

4.3 | 3 ratings Rate this file 19 Downloads (last 30 days) File Size: 6.78 KB File ID: #12319

Constrained Dynamic Time Warping Distance Measure

by Dave DeBarr

 

19 Sep 2006 (Updated 19 Sep 2006)

This MEX function computes the constrained dynamic time warping distance between two time series.

| Watch this File

File Information
Description

This is the C source code for a Matlab executable (MEX) function named cdtw_dist(). This function returns the Constrained (by Sakoe-Chiba band) Dynamic Time Warping distance between two time series. This function has 3 input parameters and 1 return value: "distance = cdtw_dist(query_vector, candidate_vector, radius);". The distance value is the square root of the minimum sum of squared differences divided by the number of comparisons. If radius == Inf, distance is the unconstrained dynamic time warping distance. Both the time and space complexity of this function are O(mn), where m is the length of the query_vector and n is the length of the candidate_vector. This MEX function was tested using Matlab (R14SP1) for Windows with Matlab's Lcc C (v2.4). These Matlab commands were used to compile this function: "mex -setup; mex cdtw_dist.c;".

Acknowledgements

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

MATLAB release MATLAB 7.0.1 (R14SP1)
Other requirements This function was written in C to make it run faster. This source code requires a C compiler to generate a MEX file.
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (7)
15 Mar 2007 xu ning

Good Work!But the variable 'DBL_MAX' is not definded in the file.

24 Aug 2007 viram mishra  
28 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.

29 Apr 2009 Ahmed

who can solve this problem : variable 'DBL_MAX' is not definded in the file

01 Jun 2009 Ahmed

# include "float.h"

i add the above line because 'DBL_MAX' is defined in it. The algorithm work without erros. good work

23 Aug 2010 Nandha

may I ask what is DBL_MAX variable for ?

22 Feb 2011 Doug

DBL_MX is not a variable it is a constant. It documents the maximum size of a DBL word on the machine where you compile the C code.

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
audio processing Dave DeBarr 22 Oct 2008 08:40:00
video processing Dave DeBarr 22 Oct 2008 08:40:00
dtw Dave DeBarr 22 Oct 2008 08:40:00
constraint Dave DeBarr 22 Oct 2008 08:40:00
distance Dave DeBarr 22 Oct 2008 08:40:00
time series Dave DeBarr 22 Oct 2008 08:40:00
dtw Robert Reijntjes 16 Aug 2011 06:56:23

Contact us at files@mathworks.com