|
Core
|
Core filter library. More...
#include <stdint.h>#include <stdbool.h>Go to the source code of this file.
Data Structures | |
| struct | core_filter_s |
Typedefs | |
| typedef struct core_filter_s | core_filter_t |
Functions | |
| float | core_filter_update (float x, core_filter_t *filt) |
| Get an output value from the filter. This is the primary function being called. | |
| bool | core_filter_rolling_avg_init (uint8_t order, core_filter_t *filt) |
| Initialize a rolling average. This will apply an even coefficient across the last (order) inputs to the filter. | |
| bool | core_filter_exp_lowpass_init (float a, core_filter_t *filt) |
| Initialize an exponential lowpass filter. | |
Core filter library.
This core library components is used to handle general-purpose digital filters. The filters work via coefficient arrays, which determine the weighting that previous inputs and outputs have on the current output.
These arrays and the corresponding information for them will be set up within the specialized init functions for each filter type.
| bool core_filter_exp_lowpass_init | ( | float | a, |
| core_filter_t * | filt ) |
Initialize an exponential lowpass filter.
| a | Alpha value for the filter. This represents the weighting of the current input. The weighting of the previous output is indirectly propertional to (a) |
| filt | Filter object to apply input to |
| bool core_filter_rolling_avg_init | ( | uint8_t | order, |
| core_filter_t * | filt ) |
Initialize a rolling average. This will apply an even coefficient across the last (order) inputs to the filter.
| order | Number of inputs to consider in the rolling average (an order of 1 is no filter, the output will be the input) |
| filt | Filter object to apply input to |
| float core_filter_update | ( | float | x, |
| core_filter_t * | filt ) |
Get an output value from the filter. This is the primary function being called.
| x | Input to filter |
| filt | Filter object to apply input to |