Included Filters
To reduce sensor noise!
Median Filter
The median filter works as:
Create list of 'n' size
If you would like to alway get the middle value, set n to an odd number
If you would like to alway get the average of the two middle most values, set n to an even number
Add data to array
Remove oldest data if array size is > n
Sort the array in ascending order
Calculate the statistical median
Due the the properties of this filter, it will return the 'middle' value of the window and ignore values too high or too low.
Low Pass Filter
The low pass filter is another filter included in this library, it is a basic algorithm that smooths values given to it.
By adjusting the gain, this filter can be tuned. When gain values increase, each new measurement has a greater influence on the estimate than when gain values are smaller. Iteratively, this process updates the estimate at each timestamp. You must have a gain value between 0 and 1!
Last updated