This repository contains a statically allocated, STL-free digital signal processing library for embedded systems.
Copy all files from include into your headers folder.
Instantiate the 'Filter' class and provide the filter weights:
#include "Filter.h"
Filter<OUTPUT_TYPE,FITLER_SIZE> my_filter;
my_filter.SetCoefficients(input_coeffs,output_coeffs);Now, every new measurement can be filtered (See examples 1,2):
OUTPUT_TYPE new_filtered_value = my_filter.Update(new_value);Besides, the Z transform numerator & denominator coefficients (from f.x. MATLAB) can be supplied instead and the library will automatically convert them to the filter weights:
my_filter.SetCoefficientsFromZTransform(numerator,denominator);The filter can be cleared for easy reinitialziation:
my_filter.ClearState();Finally although not recommended, it is possible to change the filter states:
my_filter.SetState(input_state,output_state);For usage of this library, check installation chapter.
For development, this repository uses CMake. It is already configured for the CMake Tools extension and runs on the default generator.
This repository uses doxygen. For Windows, run doxygen Doxyfile.
The expected roadmap is:
- Add variable filter size
- Remove dynamic allocation
- Add template for filtering variable type
- Add embedded systems standard recommendations
- Add other standard recomendations (AUTOSAR/ C++ standards)
- Keep library std-free
- Add CMake compilation
- Add google tests
- Add pre-designed filtering options
- Add doxygen docuemntation