# Improving the Robustness of DTW to Global Time Warping Conditions in Audio Synchronization
## 4 Discussion
However, as the global time warping factor \(\frac{M}{N}\) increases, the downsampling variants show a significant decrease in runtime compared to the baseline, while the upsampling variants show a significant increase in runtime. This makes sense: when \(N=\) 10,000 and \(M=\) 40,000, the downsampling variants will perform DTW on a 10,000 \(\times\) 10,000 pairwise cost matrix while the upsampling variants will perform DTW on a 40,000 \(\times\) 40,000 pairwise cost matrix. The adaptive weighting schemes (green) show similar performance to the baseline, with a decrease in runtime for the variant that only has two allowable transitions. Interestingly, the systems with non-uniform transition patterns (red) show a significant increase in runtime compared to the baselines. While in theory these methods require fewer transition possibilities to be considered, in practice the implementation of non-uniform transition patterns requires additional logic within the nested loops, which results in an increase in runtime. The main takeaway from our runtime analysis is this: the downsampling sequence normalization methods are the clear winner. They have the best alignment accuracy across all global time warping conditions, and they also have the best runtime characteristics. The runtime of these methods roughly matches standard DTW when \(N\approx M\), and it substantially reduces the runtime under more extreme global time warping conditions. The second analysis is a sanity check. We have performed extensive experiments under carefully controlled global time warping conditions, and we have found a clear winner: sequence length normalization with downsampling. But the real question is this: does this method help in practice under real conditions? To answer this question, we compared the performance of the best standard DTW configurations (DTW1, DTW2) with their corresponding sequence normalized methods (DTW1-downsampleNN, DTW1-downsampleLin, DTW2-downsampleNN, DTW2-downsampleLin) on the original Mazurka Dataset. Table 5 compares the error rates of these six systems at three different error tolerances: 100 ms, 200 ms, and 500 ms. There are two things to notice about Table 5. First, we see that sequence normalization consistently improves alignment accuracy. This improvement holds across different weighting schemes (DTW1, DTW2) and across all error tolerances. This suggests that the sequence normalization method may be useful as a general best practice, and not just when there is extreme global time warping. Second, we observe that the improvement is more pronounced for larger error tolerances. For example, when applying sequence normalization to DTW2, the error rate at a 100 ms tolerance decreases from 14.1% to 13.2% (a 6.4% reduction in errors), and at a 500 ms tolerance decreases from 3.6% to 2.6% (a 27.8% reduction in \begin{table}
\begin{tabular}{l c c c} \hline \multirow{2}{*}{**System**} & \multicolumn{3}{c}{**Error Tolerance**} \\  & **100 ms** & **200 ms** & **500 ms** \\ \hline DTW1 & 17.5\% & 8.8\% & 3.6\% \\ DTW1-downsampleNN & 17.1\% & 8.1\% & 2.7\% \\ DTW1-downsampleLin & 17.1\% & 8.2\% & 2.6\% \\ \hline DTW2 & 14.1\% & 7.3\% & 3.6\% \\ DTW2-downsampleNN & 13.2\% & 6.3\% & 2.6\% \\ DTW2-downsampleLin & 13.1\% & 6.3\% & 2.6\% \\ \hline \end{tabular}
\end{table} 
Table 5: Comparing the error rates of the best standard DTW configurations and the best sequence length normalization methods on the original Chopin Mazurka dataset. Numbers in the table indicate error rate at three different error tolerances. errors). Intuitively, we do not expect that downsampling a sequence will greatly improve its fine-grained alignment accuracy since downsampling throws away fine-grained information. But the main effect we are observing here is that sequence normalization reduces the likelihood that the ground truth alignment path will exceed a maximum allowable time warping factor (imposed by the selected set of allowable transitions). This results in a substantial improvement in alignment accuracy at mid- and coarse-level error tolerances.