Course / Tutorials / Week 3 / Q-8
Quick tutorial Q-8 · Week 3 · about 15 min · Core
Speed from positions, and what noise does to it
Compute speed and acceleration from a flight's noisy positions by central differences, compare them with the known truth, and see why a faster camera makes derivatives noisier.
- 1Gather
- 2Statistics (used)
- 3Visualize (used)
- 4Cleanse
- 5Features (used)
- 6Balance
- 7Scale
- 8Split
- 9Deploy
- Ask
- Collect
- Check (this week)
- Interpret (this week)
- Coach
- Reassess
Download notebook ·Python file ·Read as Markdown ·Data folder ·Chapter 3 (sections 3.2)
Every cell runs in this page; the first run downloads Python (about 30 s). Nothing you load leaves your browser. Helpful first: Q-7 The angle from three points.
The decision
A coach wants the athlete's takeoff speed and peak acceleration from video. Before reporting either, find out how much keypoint jitter each one can survive.
The raw data
raw/noise_flight.csv: hip height through one flight at 60 samples a second, with 5 mm of added jitter, the true height and speed, and the book's derivatives (synthetic; heights in cm). Data-Driven Athletics, Chapter 3, Section 3.2.4 (data/noise_flight.csv, made by the chapter'scode/make_data.py; a parabola with known noise, no real person).
Try it
Positions in, speed out
Video gives positions, one per frame. Speed (velocity) is the change of position per unit of time, so it has to be computed, and the usual way is the central difference: the positions on either side of a frame, divided by the time between them (Section 3.2.1):
v_i ≈ (y_(i+1) − y_(i−1)) / (2 Δt)
The file holds the height of Jordan's hips through one flight, 60 samples a second, with 5 mm of made-up keypoint jitter added to a perfect parabola (the book's synthetic example of Section 3.2.4). Because it is synthetic, the true height and speed are in the file too, so you can see exactly what the jitter does.
Type a prediction to enable Run.
Show the expected result without running
33 samples, dt = 16.7 ms; position error sd 5.6 mm speed error: sd 0.22 m/s (theory sigma/(sqrt(2) dt) = 0.21)
Five millimeters of jitter becomes about 0.2 m/s of error in speed, close to the theory of Section 3.2.4: the difference of two independent errors is √2 times bigger, and dividing by the short time 2Δt magnifies it. Take the difference once more and you get acceleration.
Show the expected result without running
acceleration: mean -6.4 m/s², sd 50 m/s² (truth: -9.81, sd 0) 30 fps: speed noise 0.11 m/s, acceleration noise 11 m/s² 60 fps: speed noise 0.21 m/s, acceleration noise 44 m/s² 120 fps: speed noise 0.42 m/s, acceleration noise 176 m/s² 240 fps: speed noise 0.85 m/s, acceleration noise 705 m/s² a parabola fitted to the whole flight: acceleration -9.82 m/s²
The raw acceleration swings by about 50 m/s² around a mean that is not even gravity. And a faster camera makes it worse: halving Δt doubles the speed noise and quadruples the acceleration noise. Fitting one parabola to the whole flight, which uses the physics as well as the data, recovers gravity almost exactly (Q-9 does this on a real jump).
One chart
Show the expected result without running
largest speed error 0.55 m/s; largest acceleration 140 m/s²

The speed is usable: it follows the true line with a scatter you can state. The acceleration is not, without smoothing or a model. That is why the apps smooth keypoints before they differentiate them, and why a takeoff speed read from two frames carries an error band.
For the athlete: "Your takeoff speed from video is good to about 0.2 m/s; we'll compare sessions by speeds and heights, not by accelerations read frame to frame."
With your own data
Take the hip-midpoint height from a keypoint table of your own jump (CS-1 writes one), convert it to meters with your scale, and run the same two cells on the frames in the air. Report the speed with its noise; do not report a frame-to-frame acceleration.
Check yourself
Positions carry 5 mm of independent noise at 120 frames per second. What is the speed noise of the central difference, in m/s?
Doubling the frame rate does what to the noise of a second-difference acceleration?
Why does a parabola fitted to the whole flight recover gravity when the second difference cannot?
References
- Data-Driven Athletics, Chapter 3, Describing Motion: Position, velocity and acceleration from samples, and What noise does to a derivative (Section 3.2).
Built 2026-11-30 with Python packages numpy 2.5.5, pandas 3.1.1, matplotlib 3.11.2. In the browser the same code runs on Pyodide, so the last digit can differ.