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

Sorting and median filtering in firmware

Compare sorting algorithms for small sensor windows, including memory use and predictable work.

View lesson accessAll lessons

What the lesson covers

The course lesson is called The median that cleaned the noise. A temperature sensor throws occasional spikes. The fix is a median of the last 12 readings every 10 ms, which means sorting 12 numbers in under 40 microseconds.

Before you start

Question to think about: Which input distributions matter when assessing a sorting algorithm against a fixed time budget?

Preparation exercise: Prepare sorted, reverse-sorted, duplicate-heavy and spike-containing data and compare the intended output.

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