If you read sensors using microcontrollers before, you have dealt with data that is always moving above or below a set point. This “noisy” data can be processed using a moving average filter.
The 8-point moving average filter is one of the many low-pass FIR filters. It can be imagined as a window of eight elements moving along the array, one element at a time.
The algorithm is simple: the middle element of the window is to be changed into the the average of all elements in the window. In the image above, the average of all the elements is 20, thus, the middle element (26) is changed to 20. However, note that changing the middle element must be changed only after all the elements of the window have passed.
As the window moves at the end of the array, its size gets lesser and lesser. Thus, data at the end of the array are unfiltered.