Skip to content

davidsecacontrol/FilterEmbeddedLibrary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FilterEmbeddedLibrary

This repository contains a statically allocated, STL-free digital signal processing library for embedded systems.

Installation

Copy all files from include into your headers folder.

Usage

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);

Compilation

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.

Documentation

This repository uses doxygen. For Windows, run doxygen Doxyfile.

Future Updates

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

About

This repository contains a static, STL-independent library for embedded systems.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •