HRI board firmware v2.1 Microcontroller firmware of the board used during the HRI labs.

Data Structures | Functions
Lib / Basic filter

Basic iterative filter for smoothing. More...

## Data Structures
struct | bfilt_BasicFilter
| Basic filter structure. More...

## Functions
void | bfilt_Init (bfilt_BasicFilter *filter, float32_t tau, float32_t initialValue)
| Initialize a BasicFilter structure. More...
float32_t | bfilt_Step (bfilt_BasicFilter *filter, float32_t newValue)
| Step a BasicFilter structure. More...

## Detailed Description

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().

## Function Documentation

## ◆ 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()

float32_t bfilt_Step | ( | bfilt_BasicFilter * | filter,
|  | float32_t | newValue
| ) |  |

Step a BasicFilter structure.

Parameters

  filter | pointer on the structure to initialize.
  newValue | the new value of the signal to filter.

Return values

  the | filtered value.

Note
  this implementation is very basic, and does not take the timestep (dt) into account.