Robot gripper following a cyan target on a rail with subtle scattered localization glints.

What you need

Use a saved coordinate time series containing a stationary target and a known step or ramp. Keep raw timestamps.

First outputs after a 10 mm step, alpha 0.2. Sample 1: 2 mm; Sample 2: 3.6 mm; Sample 3: 4.88 mm; Sample 4: 5.904 mm.
First outputs after a 10 mm step, alpha 0.2. Original Academy diagram using illustrative values; not a measured hardware result.
Read the diagram as a data table
Values used in the illustration
Condition or componentmm
Sample 12
Sample 23.6
Sample 34.88
Sample 45.904

The calculation

y_k = α × x_k + (1 − α) × y_(k−1)

x is the raw coordinate, y is the filtered coordinate and 0 < α ≤ 1. Sampling rate changes the filter’s time behavior.

Worked example

Illustrative numbers. Replace them with your measured inputs.

With α=0.2, starting at 0 and receiving a constant 10 mm input, the first outputs are 2, 3.6, 4.88 and 5.904 mm. The noise looks smaller, but the filter is still far from the true position after four samples.

Try it step by step

  1. Replay a stationary sequence to quantify raw noise and decide whether mechanical or lighting improvements are needed first.
  2. Apply several α values to the same data and compare both stationary spread and response to a known movement.
  3. Keep the filter state associated with a tracked object; do not blend coordinates from different parts after an identity switch.
  4. Define reset behavior after missing detections and use stale-data rejection independently of smoothing.

How to check the result

Measure maximum dynamic error over the motion range and sample rate expected in the task, not only standard deviation at rest.

Common mistake to avoid

A filter can make an incorrect target look convincingly stable. It must not conceal object switching, calibration error or stale frames.

Reference reading

Primary references for the underlying models, APIs or application context. The worked numbers and plots above are educational calculations, not results reported by these sources.

Read our methods, limitations and safety notes.