Dynamic Time Warping and Similarity Measures

I have a multidimensional time series on which I would like to perform some clustering. I have been looking at DTW as a distance metric since my series are not always aligned in time. The problem I have is that while the one to many mapping of points along two series allows for their alignment in the event they are the same signal but just shifted in time, it also means that time series with different frequencies are treated as being similar. In this case, a different frequencey should result in a larger distance metric. I can impose some locality constrains using different warping windows but that does not really help. Is there such a time series similarity measure that aligns series that are shifted in phase but treats differences in frequencies between series as being different?

EDIT:

In this case the time series corrsoponds to small molecule vibrational motion. Each of the dimensions in the time series corrosponds to a different bond length or angle and they are inherently coupled. Below are two example 1D cuts of the higher dimensional time series (prior to Z-normalisation).

.

So far I have just been playing with a single dimension (the first plot above), and the standard symmetric step used in DTW results in a measure that is not physical for my system, for example different frequency vibrations are treated as being similar. Let us take several of the smaller amplitude and higher frequencey signals from the first plot as an example,

Using the symmetric step, the series labelled 0 and 2 are predicted to have a much lower alignment cost than the others. Here several of the points in the first peak of the querry value is matched to many points in the lower frequency signal. By allowing many horizontal/ vertical steps in the construction of the warping path, one ignores differences in frequency.

I then looked at different step patterns, and by restricting the freedom for horizontal/ verticle steps through one of the Rabiner Juang type patterns, I achieve a more sensible result,

here you can see that the one to many mapping of the points in the querry to the lower frequency series no longer exists. It seems that using such a step pattern enforces the warping behaviour I want - basically it just shifts the two signals along eachother as to optimally align them. When testing it on other combinations of signals from the series I have, it ranks them as one would expect now. My only concern now is the treatment of the end points. Perhaps I can allow some horizontal and vertical steps but restrict the number of succesive steps.

Another problem is Z-normalisation. Currently I perform this once for the time series, not for each sequence, else the ampltiude of the series shift with respect to eachother? In this case the amplitude of the raw signal matters and should be treated differently. Perhaps DTW is not the measure I need, within this application to physics different frequencies and ampltidues in the time series corrospond to the molecular system having different energies and being in a different state and therefore they must be treated differently.

• Please don't use "EDIT:". Instead revise the question so it reads well for someone who encounters this for the first time. See cs.meta.stackexchange.com/q/657/755. Please ask only one question per post.
– D.W.
Commented Aug 3, 2022 at 16:46
• Your signals seem essentially aperiodic, so why do you discuss frequencies ?
– user16034
Commented Aug 4, 2022 at 13:27
• What is your question, in fact ?
– user16034
Commented Aug 4, 2022 at 13:30

Minor point, you say "looking at DTW as a distance metric " DTW is not a metric, it is just a measure.

The answer to your question "Is there such a time series similarity measure that aligns series that are shifted in phase but treats differences in frequencies between series as being different" is Yes.

You can use phase invariant distance ([a] page 3). If you need speed, you can compute this in just O(nlog(n)).

Having said that, I am not convinced this is what you need.

Can you show examples of the data? That way I could advise you.

At a minimum, I recommend you read [a] and https://www.cs.unm.edu/~mueen/DTW.pdf

• Thanks for sharing these references and your help, I have provided some examples as an edit.
– Kyle
Commented Jul 4, 2022 at 13:11