Digital filters are useful for signal processing. The application can range from smoothing signals to estimating future values based on other analog signals. In this collection of examples you can find filter demos based on finding the median, fast fourier transfom, infinite impulse response, and a Kalman filter algorithm.
The Median filter is a simple idea to smooth a signal by removing spikes from the signal. The median filter can be used both on images and on 1-dimensional signal problems. Here, the latter is covered.
The Fast Fourier Transformation (FFT) is a versatile tool for signal analysis. The general idea, in terms of electronic signals, is to de-compose a given signal (in the time domain) into sinus-shaped components (in the frequency domain). Each component has a handful of parameters (amplitude, frequency and phase) that help analyzing the input signal.
Infinite Impulse Response (IIR) filters are a class of filters that are feedback-based, i.e. the previous output plays a role in the current output. The demo will cover Band Pass Filter and Low Pass Filter. The library also supports High Pass Filter, Notch Filter, Peaking Band EQ Filter, Low Shelf Filter and High Shelf Filter.
The Kalman filter, also called linear quadratic estimation (LQE), is an algorithm that uses a series of measurements to estimate unknown variables in the future. State estimation can for example be used to predict the placement of a robotic vacuum cleaner to avoid hitting into walls, or for creating a balancing robot.
- Microchip Application Note AN4515: "Processing Analog Sensor Data with Digital Filtering"
- The Road to Median Filter Mastery
- FFT Visualization and Explanation
- Digital Filters and IIR
- Kalman Filter For Dummies
- Microchip Studio IDE v7.0.2594 or newer
- XC8 Compiler v2.40 or newer
- Microchip AVR64EA48 Device Support Pack AVR-Dx_DFP 2.2.56 or newer
All code examples were created using an AVR64EA48 Curiosity Nano Evaluation Kit and the Microchip Studio IDE. Refer to the AVR64EA48 Curiosity Nano Hardware User Guide for using the evaluation kit together with the IDE.
Refer to the individual filter examples on how to configure and use the filters.
After going through these use cases, you should better understand how to use the mentioned filters in an AVR context. This includes how to measure the speed of the filters.