What does the 'moving average' calculate?

Modified on Thu, 05 May 2022 at 07:10 PM

Within the Time Series Feature Extraction step, the 'moving average' option calculates the centred average value of the column selected. This enables to smoothen the curve and can be used when measurements are noisy, or to get rid of high frequency signals.


The time period T that is being averaged over is selected by entering a value in the 'window size' field (in the same unit as the column used for time). This moving average is 'centred' rather than 'trailing'. For each time step, the formula is looking to average T/2 before the current time step upto T/2 after the current time step. You will see blank values in the output column until you are T/2 into the dataset, at which point the window has enough data before and after the current timestep to calculate the centred moving average. The time window is then slid along and a new average calculated at every timestep.


Here is an example with some comments:


  • The red curve is the raw signal with some noise.
  • For the blue curve, the moving average was applied with a window size of 0.1. You can see that there is still noise, which means that the window size might be too small.
  • For the blue curve, the moving average was applied with a window size of 0.5. The curve is much smoother and follows well the original signal.
  • For the purple curve, the moving average was applied with a window size of 2. The curve is really smooth, but it doesn't follow the original signal as well (see for example between 1 and 2 seconds), so the window size might be too large.
  • Moreover, as explained above, the smoothing average will not be applied for the first and last T/2 sections of the signal. In this case, you can see that:
    • the blue curve starts at t=0.1/2=0.05 seconds,
    • the green curve starts at t=0.5/2=0.25 seconds, and
    • the purple curve starts at t=2/2=1 seconds.

This is an important point to remember. In the case of the purple curve, this means that the signal is now only available for 60% of its original length (3 out of 5 seconds). Here is what the beginning of the table of this example looks like:

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article