Overview

Processing analog sensor data with digital filtering can be a resource-intensive job for a Microcontroller Unit (MCU). This application note presents multiple digital filter algorithms, compares their properties, and provides code examples that are good starting points for application-specific filtering.

In digital signal processing, a vast choice of filtering algorithms is readily available in libraries or can be easily implemented in C code. Not all are well-suited for the relatively limited resources of 8-bit MCUs: Restrictions in memory size, speed, and power consumption force the application designers to compromise. In this application note, we present readily available libraries for several filtering algorithms that are easy to implement and use on AVR® MCUs. These filters are:
  • Median filter
  • Fast Fourier Transform (FFT) using the kissFFT library
  • Infinite Impulse Response (IIR) using a bi-quadratic algorithm
  • Kalman filter using the kalman-clib library

In the following sections, we are giving a short introduction to the filters, comment on their usefulness and applications, quantify their CPU load, and provide sample code.