Hi all and thank you for taking time to read this.

When I read the general literature about dynamical time warping (and the vignette for the $\texttt{R}$ package $\texttt{dtw}$), the time series seem to be given at the same time index. They are not of the same length, and I do know you can do a warping that does not require the beginning and ending of the series to match, but it seems to me, that the time distance between measurements is always the same. I might be reading it all wrong, but as I see it I need two time series complying to the following in order to compare them: $$X = (X_t)_{t \in \{1,\dots n\}}$$ and $$Y = (Y_t)_{t \in \{1,\dots m\}}$$ where the time between observations $X_t$ and $X_{t+1}$ is the same as between $Y_h$ and $Y_{h+1}$ $\forall (t,h) \in \{1,\dots n\}\times\{1,\dots m\}$ (namely index 1).

However I have two time series looking like this: $$X = (X_{t_i})_{t_i \in \{t_1,\dots t_n\}}$$ and $$Y = (Y_{h_j})_{h_j\in \{h_1,\dots h_m\}}$$ where $d(t_i,t_{i+1})\neq d(h_j,h_{j+i})$ (just plain euclidean distance $d$). You could think of them both as independently randomly sampled in time. Now it seems to me that what I should do is to do some kind of interpolation of each time series separately, extract series $X'_t$ and $Y'_t$ and warp these? I can of cause (if I do not care about calculation time) make the smallest set of equidistantly sampled time points which include all my actually sampled time points - but that could be somewhat cumbersome. I guess my question is - what do you usually do? Just low key practical handling of the issue?


So you are right that the sampling frequency needs to be constant and the same for both signals, according to the literature, https://ieeexplore.ieee.org/document/1163055. You're also right that the signals do not need to be the same length, and the ends do not need to match.

I also agree that resampling / interpolating to a smaller sampling frequency could be combersome. I have previously suggested to someone that you could convert these signals to a cumulative sum which would then be easier to interpolate to some common sampling frequency, but I don't know the result of this, and might perhaps be worth trying.

Edit: full reference for the paper added after comment request - H. Sakoe, and S. Chiba, IEEE Transactions on Acoustics, Speech, and Signal Processing, Volume 6, Issue 1, 1978

  • 1
    $\begingroup$ please provide full reference of the paper you cite in case your link dies $\endgroup$ – Antoine 12 hours ago
  • $\begingroup$ Thanks for the comment @Antoine, added in the main text $\endgroup$ – Steven Thomas 5 hours ago

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.