Output the last value before the input changed more than a threshold.
The input signal.
Difference threshold.
Return the difference between current and the last changed: