Let's say I have an array of $N$ numbers:
$n_1, n_2, .... n_N$
I then calculate a running average of those numbers, by averaging $A$ numbers at a time, which will result in the following array:
$a_1, a_2, .... a_{N-A+1}$ , where
$a_1 = \frac {n_1 + n_2 + ... + n_A}{A}$
$a_2 = \frac {n_2 + n_3 + ... + n_{A+1}}{A}$
...
I then calculate a running average of the running average I obtained above, by averaging B numbers at a time, which will result in the following array:
$b_1, b_2, .... b_{N-A-B+2}$ , where
$b_1 = \frac {a_1 + a_2 + ... + a_B}{B}$
$b_2 = \frac {a_2 + a_3 + ... + a_{B+1}}{B}$
...
My question is, is there some general formula that can get you the second running average (b numbers) directly from original set (n numbers), with arbitrary A and B coefficients?
I'm asking, because I did a few of these by hand, and the results look very much like digital filters (weighted averages). Thanks.
Remember convolving two box car gives a triangle, that's why you get the increasing and then decreasing and also symmetric coefficients down there in one of the answers.
– Andrew Au Mar 07 '16 at 17:57