changing the reference sequence in DTW

조회 수: 4 (최근 30일)
Mahdi Khosravi
Mahdi Khosravi 2020년 1월 24일
댓글: Jo 2021년 7월 12일
Hello everyone,
I wanted to use Dynamic Time Warping to align one sequence with respect to the reference one (the time series are stretched or compressed). But, when using the command “dtw” in MATLAB, after finding the optimal path, both time series are stretched. Let me give you an example: the reference is x1 = [1 1 1 2 2 4 4 2 1 1 ], with 10 points (length=10), and the other sequence is x2 = [1 2 2 3 3 2 2 1 1], with 9 points. In addition, the warping path has 11 points, therefore, when MATLAB plot the aligning data show me two plots (in one figure) with 11 points.
1.jpgn the x
But, I don’t want my reference signal to stretch. I would really appreciate it if you help me to align x2 with respect to the reference signal without changing the reference signal. It is worth to note that as the procedure of DTW shows, the boundaries of warping path is “max(length(x1) and length(x2))<points of w< length(x1) + length(x2)-1”.
2.JPG
But as I have studied some papers, in all their figures the reference signal did not change (Please see figures below, the first one is related to the time series before alignment and the second one is related to the time series after alignment). as it can be seen the number of points are 596 in both figures.
3.JPG
4.JPG
Unfortunately, I confused. Does DTW change both sequences? If the answer is “No, it won’t change the reference one”, then why MATLAB software change it; and what does the warping path boundaries tell us; and how can I overlay the other sequence on the non-changed reference?
If the answer is “Yes”, why all the papers show us the result of DTW without changing the reference one. (If you need, I can introduce you some papers.)
Thanks guys. Every help will appreciate.
Yours sincerely,
  댓글 수: 1
Jo
Jo 2021년 7월 12일
Hi, I would be really interested if you found a way to not change your reference signal. I know that your post is old but may be you found out the solution.....thanks !

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by