The way I'm thinking is that a change is only
one change as long as it is continously rising or falling, no matter how many degrees. As soon as the temperature levels out it is ready to register a new change.
It's like the fluctuating values (your data) are moving within a corridor that is 5 degrees wide. It can fluctuate within that corridor without register a change but as soon as it fluctuates enough to hit any of the walls it will move the whole corridor sideways and any movement of the corridor will register as a change. The data can then fluctuate within the new position of the corridor without register a change. Eventually it will hit a wall again and cause another movement of the corridor and register another change.
Another way of looking at it is as a very crude filter (hysteresis filter). It just filters out changes smaller than a certain amount and then counts the number of changes that are bigger.
This does not sound that much different from my corridor analogy, except you make it jump 5 instead of following a continous movement.
I implemented that too for comparison but that is not the method I would have used.

Bookmarks