Go to the source code of this file.
This module contains a header-implementation of a high-pass filter.
- See also
- hp_filter_t
-
hp_filter_init()
-
hp_filter_update()
Definition in file hp_filter.h.
◆ hp_filter_get()
static double hp_filter_get |
( |
const hp_filter_t * |
filt | ) |
|
|
static |
- Returns
- The current output of a high-pass filter without updating the filter's state.
- Note
- The filter needs at least 2 measurements before it can start providing valid output. The filter's output will be
NAN
before that.
- See also
- hp_filter_update()
Definition at line 113 of file hp_filter.h.
◆ hp_filter_get_f_cutoff()
static double hp_filter_get_f_cutoff |
( |
const hp_filter_t * |
filt | ) |
|
|
static |
- Returns
- The current cutoff frequency (in Hz) for a high-pass filter.
Definition at line 136 of file hp_filter.h.
◆ hp_filter_init()
static void hp_filter_init |
( |
hp_filter_t * |
filt, |
|
|
double |
f_cutoff |
|
) |
| |
|
static |
Initializes a high-pass filter.
- Parameters
-
filt | The filter to be initialized. |
f_cutoff | Filter cutoff frequency in Hz. |
- See also
- hp_filter_t
Definition at line 65 of file hp_filter.h.
◆ hp_filter_set_f_cutoff()
static void hp_filter_set_f_cutoff |
( |
hp_filter_t * |
filt, |
|
|
double |
f_cutoff |
|
) |
| |
|
static |
Sets a new cutoff frequency for a high-pass filter.
- Parameters
-
filt | The filter for which to change the cutoff frequency. |
f_cutoff | New cutoff frequency to set (in Hz). |
Definition at line 125 of file hp_filter.h.
◆ hp_filter_update()
static double hp_filter_update |
( |
hp_filter_t * |
filt, |
|
|
double |
m, |
|
|
double |
d_t |
|
) |
| |
|
static |
Updates a high-pass filter with a new input value. You want to call this every time a new measurement is obtained, which you want to filter.
- Parameters
-
filt | The filter to be updated. |
m | The new measurement to be integrated into the filter. |
d_t | Delta-time in seconds since the last filter update. |
- Returns
- The current filter output after the update has been performed.
- Note
- The filter needs at least 2 measurements before it can start providing valid output. The filter's output will be
NAN
before that.
- See also
- hp_filter_get()
Definition at line 88 of file hp_filter.h.