A robot's position trace looks quiet, yet velocity calculated from neighboring positions jumps noticeably. This can happen without a sudden physical change. Subtracting two measurements and dividing by a short time interval changes how their errors enter the result.
A shorter interval can describe changing motion over a narrower window. Under a specified position-noise model, it also converts the same position uncertainty into a larger velocity fluctuation. Those effects need separate explanations before a higher update rate is treated as an automatically better velocity measurement.
The calculations here concern an invented one-dimensional measurement stream with exact timestamps. They are not a robot experiment, a sensor specification, or a recommendation for a control-loop rate.
Define the difference and its time meaning
Let x_n be the true position at time t_n and let y_n = x_n + e_n be its measured value. The additive error is e_n. Assume equally spaced observations with positive interval delta_t.
Define a backward two-sample estimate:
v_hat_n = (y_n − y_(n−1))/delta_t.
NumPy's official diff documentation, version 2.3, defines first discrete differences as one array value minus the preceding value. That operation alone produces a position difference. Dividing by an appropriate time interval is the additional step that gives velocity units.
Without measurement error, this quotient is the average velocity over the interval between the two observations. It is not generally the instantaneous velocity at its ending timestamp. Those coincide for constant velocity, but need not coincide during changing motion.
A small position excursion becomes a visible velocity excursion
Imagine a stationary point whose true position is 100 mm. At times 0, 10, and 20 milliseconds, invent readings of 100.02, 99.98, and 100.02 mm.
The two-sample velocity estimates are −4 and +4 mm/s. The point did not move in this construction. The changes came from the assumed measurement errors.
If the same three invented readings instead occurred at 0, 2, and 4 milliseconds, the calculated velocities would be −20 and +20 mm/s. The numerator differences stayed at minus and plus 0.04 mm; the smaller denominator changed their velocity consequence.
This finite sequence illustrates the arithmetic but does not estimate a standard deviation. A statistical prediction requires a separate probability model rather than interpreting three chosen errors as a noise characterization.
Derive the variance under independent position errors
Now assume the position errors are zero-mean, mutually independent, and have equal variance sigma_x squared. Their statistics are assumed unchanged across the interval comparisons. Actual sensors need not preserve that assumption when acquisition settings change.
The error in the velocity estimate, relative to the noiseless interval-average velocity, is:
w_n = (e_n − e_(n−1))/delta_t.
Independence makes the variance of the numerator equal to two times sigma_x squared. Therefore:
var(w_n) = 2 sigma_x squared / delta_t squared.
Its standard deviation is sqrt(2) sigma_x / delta_t. NIST's uncertainty-combination reference describes how linear combinations depend on input variances and covariance. Here the expression follows exactly from the declared linear error model; it does not require a normal distribution.
Take sigma_x = 0.02 mm as an invented standard deviation. At a 0.010-second interval, the velocity-error variance is 8 mm squared per second squared and its standard deviation is approximately 2.82843 mm/s.
At a 0.002-second interval, the variance is 200 mm squared per second squared and the standard deviation is approximately 14.14214 mm/s. Reducing the interval by five multiplies this standard deviation by five, under the unchanged independent-noise assumption.
These are standard deviations, not guaranteed maximum errors. They describe uncertainty around the interval-average velocity, which is a different issue from assigning the result to an instantaneous timestamp.
A larger interval changes the motion quantity too
Suppose a hypothetical noise-free motion has position x(t) = 0.5 a t squared, with constant acceleration a = 100 mm/s squared. Its instantaneous velocity is at.
The backward difference ending at time t is at − 0.5 a delta_t. If labeled as the velocity at the ending time, it is below that instantaneous value by 0.5 a delta_t.
At t = 1 second and delta_t = 0.010 second, the quotient is 99.5 mm/s while endpoint velocity is 100 mm/s. At delta_t = 0.002 second, the quotient is 99.9 mm/s.
For this constant-acceleration motion, the quotient equals the instantaneous velocity at the interval's midpoint. That is a property of this specific trajectory, not a universal statement for all changing motion.
The longer interval reduced the independent-noise consequence in the previous model but increased the endpoint-label discrepancy in this one. Neither calculation selects a universally correct interval.
Adjacent velocity errors are related
Independent position errors do not produce independent neighboring velocity errors. The estimates w_n and w_(n+1) share e_n, with opposite signs.
Under the same equal-variance independent-position model, their covariance is −sigma_x squared/delta_t squared. Each velocity-error variance is twice that magnitude, so their correlation coefficient is −0.5.
A high error in one position sample pushes one calculated velocity upward and the next downward. This shared-sample structure helps explain a jagged alternating velocity trace without requiring actual direction reversals at every update.
It also matters when combining estimates. Adding consecutive position differences makes the interior samples cancel, leaving the last position minus the first. Treating the intervening velocity errors as independent would lose that cancellation structure.
When position errors are correlated, the earlier variance formula changes. With equal position-error variance and adjacent-error covariance C, velocity-error variance is (2 sigma_x squared − 2C)/delta_t squared. A perfectly shared constant offset cancels, while drift and other correlations need their own model.
Keep the measurement equation attached
The examples assume exact timing, correct position units, and ordinary signed arithmetic. Timestamp uncertainty, irregular observations, missing samples, and other measurement effects would add different terms. A nominal publishing rate does not establish the actual interval between two observations.
A derived velocity trace should consequently retain its difference rule, time interval, timestamp interpretation, and error assumptions. That record explains how quiet-looking position errors become velocity fluctuations, without confusing numerical differentiation with an independent observation of motion.
Sources and scope
NumPy, numpy.diff, official version 2.3 documentation:
https://numpy.org/doc/2.3/reference/generated/numpy.diff.html
NIST, Combining Uncertainty Components, official web reference as accessed; no page-specific revision date inferred:
https://physics.nist.gov/cuu/Uncertainty/combination.html
Sources checked October 23, 2026. All trajectories, errors, and numerical noise assumptions are hypothetical. No source examples or figures are reproduced.
Illustration note: The site-library concept image shows a wired sensor fixture on a metal table. It does not show recorded position noise, a measured velocity spectrum, or validated estimation performance.