Program for Dynamic Time Warping
* FOR LITTLE ENDIAN

usage: dtw [options...] [orgfile] [tarfile]
options:
        -shift shift[5.0]               : frame shift [ms]
        -start start[0.0]               : start length [ms]
        -end end[0.0]                   : end length [ms]
        -dim dim[40]                    : dimension
        -sdim sdim[0]                   : start dimension
        -ldim ldim[39]                  : last dimension
        -twffile twffile                : get time warping function file
        -twfdat twfdat                  : get time warping function plot file
        -intwf intwf                    : input time warping function file
        -dtwofile dtwofile              : get DTWed original file
        -dtwtfile dtwtfile              : get DTWed target file
        -dtwotfile dtwotfile            : get DTWed joint (org-tar) file
        -frmcdfile frmcdfile            : get frame CD file
        -fixed                          : fixed start and end points
        -getcd                          : calculate CD
        -notwf                          : calculate CD without DTW
        -dtworg                         : DTW original vectors
        -nmsg                           : no message
        -help                           : display this message

Two input files are binary files of original and target feature
sequences.

The number of dimensions is changed by -dim. A distance between
feature vectors for performing DTW is calculated with the [sdim]-th
through [ldim]-th coefficients, where [sdim] is changed by -sdim and
[ldim] is changed by -ldim.

A binary file of time-aligned original vectors is generated by
-dtwofile, and a binary file of time-aligned target vectors is
generated by -dtwtfile. A binary file of joint vectors constructed by
concatenating time-aligned original and target vectors is generated by
-dtwotfile.

A binary file of a time warping function is generated by
-twffile. This file has an especial format. A text file of the time
warping function is generated by -twfdat. You can see the time warping
function with GNUPLOT as follows:
% plot "output.twfdat" w l
The specific time warping function file can be used by -intwf.

Average of cepstral distortion is calculated by -getcd. A binary file
of frame-based cepstral distortion file is generated by -frmcdfile.

If -notwf is used, the distortion between feature sequences having the
same number of frames is calculated without DTW.

DTW is performed with the following path,
 Min{Dist(x(t-2), y(t-1)) + Dist(x(t-1), y(t)) + Dist(x(t), y(t)),
     Dist(x(t-1), y(t-2)) + Dist(x(t), y(t-1)) + Dist(x(t), y(t)),
     Dist(x(t-1), y(t-1)) + 2 * Dist(x(t), y(t))},
where a range of start points is changed by -start and a range
of end points is changed by -end. A frame shift is changed
by -shift. If -fixed is used, DTW is performed with the following
path,
 Min{Dist(x(t-1), y(t)) + Dist(x(t), y(t)),
     Dist(x(t), y(t-1)) + Dist(x(t), y(t)),
     Dist(x(t-1), y(t-1)) + 2 * Dist(x(t), y(t))},
where start and end points are fixed. When using these paths,
time-aligned original and target feature sequences are always
extended. If -dtworg is used, only original feature sequence is
modified by performing DTW with the following path
 Min{Dist(x(t-2), y(t-1)) + Dist(x(t), y(t)),
     Dist(x(t-1), y(t-1)) + Dist(x(t), y(t)),
     Dist(x(t), y(t-1)) + Dist(x(t), y(t))},
where a range of start points is changed by -start and a range
of end points is changed by -end.

Binary data has double-type format.

Some messages are printed while executing this program. If you
don't need those messages, use -nmsg.


<EXAMPLE>
% dtw \
	-shift 5 \
        -start 50 \
        -end 50 \
        -dim 25 \
        -sdim 0 \
        -ldim 24 \
        -twffile output.twf \
        -twfdat output.twfdat \
        -dtwofile output.dtworg \
        -dtwtfile output.dtwtar \
        -frmcdfile output.frmcd \
        -getcd \
        -nmsg \
	input.org \
	input.tar
 

Tomoki Toda (tomoki@ics.nitech.ac.jp)


==================================================
The current copyright is

/*********************************************************************/
/*                                                                   */
/*            Nagoya Institute of Technology, Aichi, Japan,          */
/*       Nara Institute of Science and Technology, Nara, Japan       */
/*                                and                                */
/*             Carnegie Mellon University, Pittsburgh, PA            */
/*                      Copyright (c) 2003-2004                      */
/*                        All Rights Reserved.                       */
/*                                                                   */
/*  Permission is hereby granted, free of charge, to use and         */
/*  distribute this software and its documentation without           */
/*  restriction, including without limitation the rights to use,     */
/*  copy, modify, merge, publish, distribute, sublicense, and/or     */
/*  sell copies of this work, and to permit persons to whom this     */
/*  work is furnished to do so, subject to the following conditions: */
/*                                                                   */
/*    1. The code must retain the above copyright notice, this list  */
/*       of conditions and the following disclaimer.                 */
/*    2. Any modifications must be clearly marked as such.           */
/*    3. Original authors' names are not deleted.                    */
/*                                                                   */    
/*  NAGOYA INSTITUTE OF TECHNOLOGY, NARA INSTITUTE OF SCIENCE AND    */
/*  TECHNOLOGY, CARNEGIE MELLON UNIVERSITY, AND THE CONTRIBUTORS TO  */
/*  THIS WORK DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,  */
/*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, */
/*  IN NO EVENT SHALL NAGOYA INSTITUTE OF TECHNOLOGY, NARA           */
/*  INSTITUTE OF SCIENCE AND TECHNOLOGY, CARNEGIE MELLON UNIVERSITY, */
/*  NOR THE CONTRIBUTORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR      */
/*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM   */
/*  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,  */
/*  NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN        */
/*  CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.         */
/*                                                                   */
/*********************************************************************/
/*                                                                   */
/*          Author :  Tomoki Toda (tomoki@ics.nitech.ac.jp)          */
/*          Date   :  June 2004                                      */
/*                                                                   */
/*-------------------------------------------------------------------*/
/*                                                                   */
/*  DTW                                                              */
/*                                                                   */
/*-------------------------------------------------------------------*/
