I want to calculate mean trajectory using Dynamic Time Warping.

19 vues (au cours des 30 derniers jours)
Sierra
Sierra le 28 Août 2022
x-axis is number of data point an y-axis is longitude.
I want to mean line from aligned singal. but it only returns dist 45.812772.
how can i use this number to calculate mean line?
and trajectory data concist of longitude, latitude.
In this example, I used only longitude data.
how to use both data while using DTW to get mean trajecotory?

Réponses (1)

Balavignesh
Balavignesh le 5 Oct 2023
Hi Sierra,
As per my understanding, you would like to plot mean trajectory using Dynamic Time Warping (DTW).
I assume that you have data points of trajectories consisting of latitude and longitude values.
I would suggest you to create an empty matrix 'distance' to store pairwise distances between all trajectories. You could iterate over all pairs of trajectories and compute their 'DTW' distance based on the latitude and longitude coordinates using the 'dtw' function and store in the 'distance' matrix.
% for i = 1:N
% for j = i+1:N
% dist(i, j) = dtw([lat(:, i), lon(:, i)], [lat(:, j), lon(:, j)]);
You could then compute the mean trajectory by finding the trajectory with the minimum average distance to all other trajectories by calculating the mean of each row in the 'distance' matrix and fincing the index of minimum mean distance.
Kindly have a look at the following documentation links to have more information on:
Hope that helps!
Balavignesh.

Catégories

En savoir plus sur AI for Signals dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by