View full-text article in PMC Sensors (Basel). 2020 Dec 25;21(1):91. doi: 10.3390/s21010091 Search in PMC Search in PubMed View in NLM Catalog Add to search Copyright and License information © 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/). PMC Copyright notice Algorithm 1 Dynamic Time Warping DTW⇐array[0…n,0…m] fori=0…ndo DTW[i,0]⇐infinity end for forj=0…mdo DTW[0,j]⇐infinity end for DTW[0,0]⇐0 fori=0…ndo for j=0…m do cost⇐||(s[i]−t[j])|| DTW[i,j]⇐cost+min(DTW[i−1,j],DTW[i,j−1],DTW[i−1,j−1]) end for end for returnDTW[n,m]