Basic iterative filter for smoothing.
More...
Basic iterative filter for smoothing.
First, instance a bfilt_BasicFilter structure (e.g. "bfilt_BasicFilter
b;"), then initialize it once with bfilt_Init(). Then, every time a new value of the signal is received, call bfilt_Step().
◆ bfilt_Init()
| void bfilt_Init |
( |
bfilt_BasicFilter * |
filter, |
|
|
float32_t |
tau, |
|
|
float32_t |
initialValue |
|
) |
| |
Initialize a BasicFilter structure.
- Parameters
-
| filter | pointer on the structure to initialize. |
| tau | the contribution of every new value. 0.0 (max filtering) to 1.0 (no filtering). |
| initialValue | initial value for the filter. |
◆ bfilt_Step()
Step a BasicFilter structure.
- Parameters
-
| filter | pointer on the structure to initialize. |
| newValue | the new value of the signal to filter. |
- Return values
-
- Note
- this implementation is very basic, and does not take the timestep (dt) into account.