PART 2 / LESSON 13 · Overview free · interactive lesson in the full course

Sliding windows and moving averages

Explore rolling aggregates, prefix sums and bounded windows over streaming sensor data.

View lesson accessAll lessons

What the lesson covers

The course lesson is called A moving average that costs nothing. The moving average adds up the last 64 samples for every new sample. Ravi shows how one addition and one subtraction do the same job.

Before you start

Question to think about: What state must persist between samples to avoid recomputing an entire window?

Preparation exercise: Define what happens before a window is full and choose a reference calculation for comparisons.

This is an original public study prompt, not the paid lesson or its solution. The interactive course contains the walkthroughs, labs, exercises and recaps.

Read the free embedded C articles for additional practice.

Test your understanding

Practice free firmware interview questions and mock interviews · Assess your readiness