DTW 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.
Key highlights
- 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
Intuition
This section is available to Pro members. Upgrade to Pro
How it works
This section is available to Pro members. Upgrade to Pro
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
Common pitfalls
This section is available to Pro members. Upgrade to Pro
Applications
This section is available to Pro members. Upgrade to Pro
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
- 1.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.
- 2.Wang, Z., Yan, W., & Oates, T. (2013). Time series classification from scratch with deep neural networks: A strong baseline. arXiv preprint arXiv:1611.06455.
You have read it. What now?
Cite this page
ScholarGate. (2026, June 3). DTW Gait Analysis. ScholarGate. https://scholargate.app/biomechanics/dtw-gait-analysis