8855623ad0
Ensure that the delta goes in the correct direction (i.e. use positive delta for prev <= sample, and negative delta for prev > sample)