DTW Gait Analysis
Dynamic Time Warping for Gait Analysis · Also known as: DTW, Gait pattern matching, Temporal gait comparison
Dynamic Time Warping (DTW) is a sequence alignment algorithm that measures similarity between time series of different lengths by allowing flexible temporal matching. Applied to gait analysis, DTW enables comparison of walking patterns across subjects and conditions despite variations in cadence or stride length.
Read the full method
Sign in with a free account to read this section.
Method map
The neighbourhood of related methods — select a node to explore.
When to use it
Use DTW gait analysis when comparing walking patterns across subjects with different natural cadences, when detecting subtle gait abnormalities, or when classifying gait into diagnostic categories. It is valuable in clinical gait assessment, sports biomechanics, and robotics. Assumptions include that phase-based alignment is meaningful (gait cycles have defined start/end points) and that DTW distance is a meaningful measure of functional gait similarity.
Strengths & limitations
- Handles variable-length sequences naturally; no need for temporal normalization
- Robust to differences in walking speed and cadence
- Interpretable distance metric; DTW path shows which phases differ between gaits
- Well-established in time-series analysis; efficient algorithms available
- Computationally more expensive than Euclidean distance; O(n²) comparisons for n-sample sequences
- Choice of local distance metric (e.g., Euclidean in feature space) affects DTW results; must validate
- DTW may align sequences pathologically if no constraints are applied; windowing or slope constraints needed
- Sensitivity to feature choice (joint angles, marker positions, velocities) and preprocessing
Frequently asked
What is the DTW distance between identical gaits?
Zero, if gaits are truly identical in pattern (regardless of speed). In practice, small differences in phase transitions and noise produce small but non-zero DTW distances.
How do I choose the local distance metric for DTW?
Euclidean distance in the feature space (e.g., joint angles) is standard. Alternative metrics include correlation distance or Manhattan distance. Cross-validate to choose the metric that best discriminates your classes.
Can DTW handle multiple joints simultaneously?
Yes. Compute DTW in the multi-dimensional feature space (concatenate or stack angles from multiple joints). Alternatively, compute separate DTW distances per joint and average or weight them.
Sources
- Sakoe, H., & Chiba, S. (1978). Dynamic programming algorithm optimization for spoken word recognition. IEEE Transactions on Acoustics, Speech, and Signal Processing, 26(1), 43-49. DOI: 10.1109/TASSP.1978.1163055 ↗
- Wang, Z., Yan, W., & Oates, T. (2013). Time series classification from scratch with deep neural networks: A strong baseline. arXiv preprint arXiv:1611.06455. link ↗
How to cite this page
ScholarGate. (2026, June 3). Dynamic Time Warping for Gait Analysis. ScholarGate. https://scholargate.app/en/biomechanics/dtw-gait-analysis
Which method?
Set this method beside its closest kin and read them side by side — the library lays the books on the table; the choice is yours.
- Inverse DynamicsBiomechanics↔ compare
- Markerless Motion CaptureBiomechanics↔ compare
- Muscle Synergy AnalysisBiomechanics↔ compare