Implements a simple leaky integrator integer value filter, handy for fast, simple, ADC output filtering. Implemented as described here: [[http://ece124web.groups.et.byu.net/references/readings/Simple%20Software%20Lowpass%20Filter.pdf|Simple Software Lowpass Filter.pdf]]
Dependents: AVC_20110423 WallBot_Simple AVC_2012
SimpleFilter Class Reference
SimpleFilter implements a simple low pass integer "leaky integrator" described here: More...
#include <SimpleFilter.h>
Public Member Functions | |
SimpleFilter (short shift) | |
Creates a new filter object. | |
short | filter (short value) |
Supplies input to the filter and returns filtered output value. | |
short | value (void) |
Read the current value in the filter. | |
operator short () | |
Shorthand operator for value() |
Detailed Description
SimpleFilter implements a simple low pass integer "leaky integrator" described here:
http://ece124web.groups.et.byu.net/references/readings/Simple%20Software%20Lowpass%20Filter.pdf
Well suited for filtering ADC integer values very quickly
Michael Shimniok http://bot-thoughts.com/
Definition at line 9 of file SimpleFilter.h.
Constructor & Destructor Documentation
SimpleFilter | ( | short | shift ) |
Creates a new filter object.
- Parameters:
-
shift,: the number of shifts to perform at each filtering input step; lower means higher bandwidth
Definition at line 3 of file SimpleFilter.cpp.
Member Function Documentation
short filter | ( | short | value ) |
Supplies input to the filter and returns filtered output value.
- Parameters:
-
value is the input value to the filter, e.g., some measurement
- Returns:
- the filtered output value
Definition at line 7 of file SimpleFilter.cpp.
operator short | ( | ) |
Shorthand operator for value()
- Returns:
- the current value in the filter
Definition at line 34 of file SimpleFilter.h.
short value | ( | void | ) |
Read the current value in the filter.
- Returns:
- the current value in the filter
Definition at line 14 of file SimpleFilter.cpp.
Generated on Wed Jul 13 2022 18:05:52 by 1.7.2