Language: EN


Arduino Single EMA Library for Low Pass and High Pass Filter

The Single EMA Filter library implements an exponential filter. The library allows for low pass and high pass filtering. The Single EMA Filter class uses templates to allow it to work with different types (int, long, float, …).

User Manual


The Single EMA filter is instantiated through its constructor, which takes the Alpha parameter of the filter as the only value.

SingleEMAFilter<int> singleEMAFilter(const size_t alpha);

Using the Filter

// Add a new value to the filter and return the Low Pass filtered value

// Get the last Low Pass filtered value (the same as the one returned when adding the value to the filter)

// Get the last High Pass filtered value


The Single EMA Filter library includes the following examples to illustrate its use.

  • SingleEMAFilterInt: Example of filtering for integer variables.
  • SingleEMAFilterFloat: Example of filtering for float variables.


  • Download the latest version from GitHub
  • Unzip the file
  • Copy it to your libraries folder (usually My Documents\Arduino\libraries)
  • Restart the Arduino IDE