An n-point moving average is equivalent to using a filter
with all coefficients equal to 1/n:
y[0] y[1] y[2] ... y[n-1] sliding window of samples
* 1/n * 1/n * 1/n ... * 1/n each multiplied by 1/n
-----------------------------------
z = (1/n)*(y[0] + y[1] + y[2] ... + y[n-1]) = n-point moving average
We should be able to obtain a better result using coefficients
c[0],c[1],...,c[n-1]
which are not necessarily all equal, and are specifically chosen to provide
a desired frequency response:
y[0] y[1] y[2] ... y[n-1]
* c[0] * c[1] * c[2] ... * c[n-1]
-----------------------------------------------------
z = y[0]*c[0] + y[1]*c[1] + y[2]*c[2] ... + y[n-1]*c[n-1]