Skip to content

Despike smooth

Parameters

Despike

despike · boolean · default True

Replace a point that jumps away from its neighbours' median position by that median (a Hampel filter per point across rows). Steady motion moves the median with it and is left alone; a jump shorter than half the window is removed.

Despike window (s)

despike_window_s · number · default 0.1 · range >0–5 · unit s

How far either side of a row the despike's median reaches, in seconds; resolved to rows at the recording's cadence.

Despike threshold (MADs)

despike_k · number · default 3.0 · range >0–20

How many scaled median deviations from the window's median a point may sit before it counts as a spike.

Despike floor (body fraction)

despike_floor · number · default 0.03 · range 0–1

The deviation's lower bound, as a fraction of body scale, so a still animal's sub-pixel jitter is never read as a spike.

Smooth

smooth · boolean · default True

Replace each point by a local quadratic fitted to its neighbours in time, Gaussian-weighted. It removes frame-to-frame jitter and keeps turning points a plain average would flatten; an absent point stays absent.

Smooth window (s)

smooth_window_s · number · default 0.133 · range >0–5 · unit s

The smoothing weights' standard deviation, in seconds, measured in time so a gap or an every-n run is weighted by real distance.

Smooth kernel

smooth_kernel · string · default local_quadratic

The local fit: a quadratic, the only kernel offered.

Smooth reach (windows)

smooth_truncate · number · default 3.0 · range >0–10

How many smooth windows either side the weights reach.

Smooth minimum neighbours

smooth_min_points · integer · default 5 · range 3–50

How many weighted neighbours (the point itself included) a quadratic needs; with fewer, the point takes the weighted mean.