Skip to main content
. Author manuscript; available in PMC: 2018 Aug 22.
Published in final edited form as: Control Technol Appl. 2017 Oct 9;2017:847–852. doi: 10.1109/CCTA.2017.8062565

Algorithm 1.

Start and Stop Detect with Monotonic Filter

Input: φ(t)
Output: φf(t)
1: Initialize φf(t) = φ(t), stopped = false;
2: if stop detected then
3:   stopped = true;
4: else
5:   if |φ(t) − φf(t − Δt)| ≤ Δφ then
6:     stopped = false;
7:   end if
8: end if
9: if stopped = true or 3π2<φ(t)φf(tΔt)<0 then
10:   φf(t) = φf(t Δt);
11: else
12:   φf(t) = φ(t);
13: end if