You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently sensor values are simply stored in a big buffer and the average is fully calculated each time it is needed by accessing and summing up all values in the buffer. This is unnecessarily expensive, since in this scenario the average can be calculated much more easily using this formula:
See Wikipedia - Moving average
Since we don't need the individual sensor values anyway, using this formula it should also be possible to remove the buffer altogether, and only store the current moving average.
It might also be interesting to see if a simple moving median is better suited, but it would require more performance and memory.
The text was updated successfully, but these errors were encountered:
Currently sensor values are simply stored in a big buffer and the average is fully calculated each time it is needed by accessing and summing up all values in the buffer. This is unnecessarily expensive, since in this scenario the average can be calculated much more easily using this formula:

See Wikipedia - Moving average
Since we don't need the individual sensor values anyway, using this formula it should also be possible to remove the buffer altogether, and only store the current moving average.
It might also be interesting to see if a simple moving median is better suited, but it would require more performance and memory.
The text was updated successfully, but these errors were encountered: