DeviceMotion API — raw acceleration, magnitude envelope, step detection from vertical-axis peaks, and movement state classification.
X, Y, Z axes and vector magnitude. Walk around to see the rhythmic oscillation of a stride. Sitting still should produce a near-flat line at ≈9.8 m/s² (gravity — if including gravity) or ≈0 (if gravity-subtracted).
Steps are detected by finding peaks in the vertical-axis acceleration that exceed a threshold and are separated by at least 300 ms (minimum plausible stride interval). Each detected peak is marked with a tick.
mean + threshold and subsequently falls back below it. A refractory period prevents double-counting the same step.