Of course, this has the effect of smearing the output data. Sharp peaks will be somewhat flattened. In effect, for each i we make an output by multiplying the input waveform by a unit step function, and summing the results at each point. The unit step is then slid one point to the right and the algorithm repeated. Adjusting the number of points included in each average simply changes the width of the step.
Narrow steps give noisy signals that are more faithful to the input data.
A step exactly one point wide gives the unmodified input signal. We call this technique the convolution. Now, when I went to collage, the professors baffled me with math that left the concept behind convolution a total mystery. Sure, I could sling the exponential integrals the academics loved, but really had no idea the convolution is the simple process of using one function, in a narrow sliding window against another function, to generate a third that is the combination of the two. In averaging we slide a very simple function along the axis.