Altervative algorithm to dynamic time warping for registering signals?

12 views (last 30 days)
I have 2 signals that vary temporally and measure the same variable. I'm attempting to register the 2 signals and the challenge is that these signals are temporally misaligned and the amplitudes differ at some points. I have had moderate success using dynamic time warping to align the signals but the alignment is not as good as I would have hoped. I think the main reason for this is the differences in amplitude between the 2 signals. Can anyone suggest an algorithm to use for registration of 2 signals given temporal and amplitude differences?
Thanks David

Answers (1)

Matt Cohen
Matt Cohen on 31 Jul 2015
Hi David,
I understand that you are trying to use Dynamic Time Warping (DTW) to temporally align two signals, and the issue you are having appears to be caused by amplitude differences between the signals.
For the task of time-aligning signals, DTW seems like a good option for you. There are many other variants of the DTW algorithm that exist in literature, but these likely require more time and effort to implement and may not benefit you much more in the long run. Your best bet is to try to normalize the signals before aligning them with DTW. This might help with reducing undesirable amplitude spikes and variations.
There are many different options for normalizing the signals, and the effect of each on the outcome likely depends on the type of signal being used. It might be best to start off with the sup-norm normalization. For your signal, this likely means to just divide each of the signal's elements by the maximum of the absolute values. You can also try normalizing by the signal's norm and seeing if this provides any different results.
Depending on the type of signal, there might also be a better way of constructing the pairwise distance matrix. For example, when using DTW for time-aligning speech signals, frequency-based features, such as the short-time Fourier transform or Mel-Frequency Cepstral Coefficients (MFCCs), are typically used instead of the samples of the signals. These features are compared using some distance metric, and these distances are used in the alignment process.
If normalization does not help your DTW results and none of the variants seem useful, you could also try using a simple cross-correlation based approach to signal alignment. Correlation is maximum when the two signals are maximally correlated or aligned, so this provides a way to determine how shifted and misaligned the signals are and how to correct them. You can use MATLAB's "xcorr" function to implement the cross-correlation method. DTW should outperform cross-correlation for your purposes, but if the signals do possess very similar structure, this might produce decent results. Normalization could be beneficial here, too.
I hope this helps.
Matt

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!