Debian Codegraph @

docs/wobble.typ

raw
1 #set page(width: 16cm, margin: 0.5em, height: auto)
2 #let definition(content) = box(fill: luma(92%), width: 100%, inset: 0.5em, stroke: black)[#content]
3
4 #let pr = $nu$
5 #let time = $t$
6
7 = Wobble smoothing
8
9 To reduce high frequency noise.
10
11 *Algorithm*: Wobble smoothing\
12 *Input* : ${(x[k],y[k],t[k]) in RR^2 times RR_+, 0 <= k<=n}$, $Delta T>0$ (from `wobble_smoother_timeout`), $v_"min"$ (from
13 `wobble_smoother_speed_floor`) and $v_"max"$ ( from `wobble_smoother_speed_ceiling`)\
14 Compute a weighted moving average of the positions $overline(p)[j] = (overline(x)[j],overline(y)[j])$
15 $
16 forall j in [|\0,n|],
17 overline(p)[
18 j
19 ] = cases(
20 (display(sum_(k=1)^n p[k] (t[k] - t[k-1]) bb(1)_(lr([t[j] - Delta T, t[j]], size: #170%)) (t[k]))) /display(sum_(k=1)^n bb(1)_(lr([t[j] - Delta T, t[j]], size: #170%)) (t[k])) &"if the numerator" !=0,
21 p[j]&"otherwise",
22
23 )
24 $
25 Calculate a moving average velocity $overline(v)[j]$
26 $
27 forall j in [|0, n|],
28 overline(v)[
29 j
30 ] = cases(0 & j = 0, (
31 display(sum_(k=1)^n norm(p[k] - p[k-1]) bb(1)_(
32 lr([t[j] - Delta T, t[j]], size: #170%)) (t[k]))
33 )/(
34 display(sum_(k=1)^n (t[k] - t[k-1]) bb(1)_(
35 lr([t[j] - Delta T, t[j]], size: #170%)) (t[k]))
36 )quad &"otherwise")
37 $
38 Interpolate between the average position and the raw ones based on the average speed
39 $
40 forall j in [|0,n|],
41 p'[j] = &
42 min((overline(v)[j] - v_"min")/(v_"max" - v_"min") bb(1)_(\[v_"min",oo\[) (overline(v)[j]), 1) overline(p)[
43 j
44 ] \ + &(1 - min((overline(v)[j] - v_"min")/(v_"max" - v_"min") bb(1)_(\[v_"min",oo\[) (overline(v)[j]))) p[j]
45 $
46 where $p'[j] = (x'[j],y'[j])$\
47 *Output*: ${(x'[k],y'[k]) in RR^2, 0<= k <=n}$ the filtered positions.\ Hence for low local speeds, the smoothing is
48 maximum (we take exactly the average position over the time $Delta T$) and for high speed there is no smoothing. We also
49 note that the first position is thus never filtered.