| 1 |
<html><head><meta name="robots" content="index,follow"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 2 |
<title>CC: To DTW...</title> |
| 3 |
<style> |
| 4 |
td { padding-left: 5pt; padding-right: 5pt; } |
| 5 |
th { padding-left: 5pt; padding-right: 5pt; } |
| 6 |
code { white-space: pre-wrap; } |
| 7 |
dd { white-space: pre-wrap; } |
| 8 |
</style> |
| 9 |
</head><body bgcolor="#FFFFFF"> |
| 10 |
|
| 11 |
<table border=0 cellpadding=0 cellspacing=0><tr><td bgcolor="#CCCC00"><table border=4 cellpadding=9><tr><td align=middle bgcolor="#000000"><font face="Palatino,Times" size=6 color="#999900"><b> |
| 12 |
CC: To DTW... |
| 13 |
</b></font></table></table> |
| 14 |
<p>You can choose this command after selecting two objects with cepstral coefficients (two <a href="MFCC.html">MFCC</a>'s or <a href="LFCC.html">LFCC</a>'s). With this command you perform dynamic time warping. </p> |
| 15 |
<h2>Algorithm</h2> |
| 16 |
<p>First we calculate the distance matrix <i>D</i> of all the distances between the cepstral frames of the two objects. This matrix has <i>n</i><sub>1</sub> rows, the number of frames in the first object, and <i>n</i><sub>2</sub> columns, the number of frames in the second object.</p> |
| 17 |
<p>The elements of <i>D</i> are the distances <i>d</i><sub><i>ij</i></sub> between frame <i>i</i> (from the first object) and frame <i>j</i> (from the second one). The <i>d</i><sub><i>ij</i></sub> are composed of three parts:</p> |
| 18 |
<table width="100%" style="white-space:pre-wrap"><tr><td align=middle><i>d</i><sub><i>ij</i></sub> = <i>w</i><sub>1</sub> · <i>d</i><sub>1</sub> + <i>w</i><sub>2</sub> · <i>d</i><sub>2</sub> + <i>w</i><sub>3</sub> · <i>d</i><sub>3</sub>,</table> |
| 19 |
<p>where <i>w</i><sub>1</sub>, <i>w</i><sub>2</sub> and <i>w</i><sub>3</sub> are user-supplied weights and </p> |
| 20 |
<dl> |
| 21 |
<dt><i>d</i><sub>1</sub> = ∑<sup>N</sup><sub><i>k</i>=1</sub> (<i>c</i><sub><i>ik</i></sub> - <i>c</i><sub><i>jk</i></sub>)<sup>2</sup>), |
| 22 |
<dd>the sum of the squared distances between the <i>N</i> cepstral coefficients of the two frames. </dd> |
| 23 |
<dt><i>d</i><sub>2</sub> = (c<sub><i>i0</i></sub> - c<sub><i>j0</i></sub>)<sup>2</sup> |
| 24 |
<dd>the difference between the average 'power' of the two frames.</dd> |
| 25 |
<dt><i>d</i><sub>3</sub> = ∑<sup>N</sup><sub><i>k</i>=1</sub> (<i>r</i><sub><i>ik</i></sub> - <i>r</i><sub><i>jk</i></sub>)<sup>2</sup>), |
| 26 |
<dd>in which <i>r</i><sub><i>ik</i></sub> is the regression coefficient of the cepstral coefficient <i>k</i>, calculated from the frames within a time span of <i>T</i> seconds, the <i>regression window length</i>, around the centre of frame <i>i</i>.</dd> |
| 27 |
</dl> |
| 28 |
<p>After calculation of all the frame distances <i>d</i><sub><i>ij</i></sub>, we find the optimal path through the distance matrix <i>D</i> with a Viterbi-algorithm.</p> |
| 29 |
<h3>Links to this page</h3> |
| 30 |
<ul> |
| 31 |
<li><a href="DTW.html">DTW</a> |
| 32 |
</ul> |
| 33 |
<hr> |
| 34 |
<address> |
| 35 |
<p>© djmw 20221114</p> |
| 36 |
</address> |
| 37 |
</body> |
| 38 |
</html> |