Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
First order low-pass filter with delay. More...
#include "paparazzi.h"
Go to the source code of this file.
Data Structures | |
struct | delayed_first_order_lowpass_filter_t |
Macros | |
#define | DELAYED_FIRST_ORDER_LOWPASS_FILTER_BUFFER_SIZE 20 |
#define | DELAYED_FIRST_ORDER_LOWPASS_FILTER_FILTER_ALPHA_SHIFT 14 |
Functions | |
static int32_t | delayed_first_order_lowpass_propagate (struct delayed_first_order_lowpass_filter_t *f, int32_t input) |
delayed_first_order_lowpass_propagate More... | |
static void | delayed_first_order_lowpass_set_omega (struct delayed_first_order_lowpass_filter_t *f, uint32_t omega) |
delayed_first_order_lowpass_set_omega More... | |
static void | delayed_first_order_lowpass_set_delay (struct delayed_first_order_lowpass_filter_t *f, uint8_t delay) |
delayed_first_order_lowpass_set_delay More... | |
static void | delayed_first_order_lowpass_initialize (struct delayed_first_order_lowpass_filter_t *f, uint32_t omega, uint8_t delay, uint16_t max_inc, uint16_t sample_frequency) |
delayed_first_order_lowpass_initialize More... | |
First order low-pass filter with delay.
Definition in file delayed_first_order_lowpass_filter.h.
struct delayed_first_order_lowpass_filter_t |
Definition at line 35 of file delayed_first_order_lowpass_filter.h.
Data Fields | ||
---|---|---|
int32_t | alpha | |
int32_t | buffer[DELAYED_FIRST_ORDER_LOWPASS_FILTER_BUFFER_SIZE] | |
uint8_t | delay | |
uint8_t | idx | |
uint16_t | max_inc | |
uint32_t | omega | |
uint16_t | sample_frequency |
#define DELAYED_FIRST_ORDER_LOWPASS_FILTER_BUFFER_SIZE 20 |
Definition at line 32 of file delayed_first_order_lowpass_filter.h.
#define DELAYED_FIRST_ORDER_LOWPASS_FILTER_FILTER_ALPHA_SHIFT 14 |
Definition at line 33 of file delayed_first_order_lowpass_filter.h.
|
inlinestatic |
delayed_first_order_lowpass_initialize
f | Reference to the filter. |
omega | Filter bandwidth in [rad/s], only positive integer values. |
delay | Number of timesteps delay in the signal. Maximum defined by buffer size. |
sample_frequency | Frequency at which the filter is going to be updated. |
Initializes the filter, should be done before using it.
Definition at line 120 of file delayed_first_order_lowpass_filter.h.
References delay, DELAYED_FIRST_ORDER_LOWPASS_FILTER_BUFFER_SIZE, delayed_first_order_lowpass_set_delay(), delayed_first_order_lowpass_set_omega(), and f.
Referenced by stabilization_attitude_heli_indi_init().
|
inlinestatic |
delayed_first_order_lowpass_propagate
f | Reference to the filter. |
input | Value that needs to be filtered. |
The actual low-pass filter with delay. Delay is accomplished by internal buffer.
Definition at line 54 of file delayed_first_order_lowpass_filter.h.
References DELAYED_FIRST_ORDER_LOWPASS_FILTER_BUFFER_SIZE, DELAYED_FIRST_ORDER_LOWPASS_FILTER_FILTER_ALPHA_SHIFT, and f.
Referenced by indi_apply_actuator_models().
|
inlinestatic |
delayed_first_order_lowpass_set_delay
f | Reference to the filter. |
delay | Number of timesteps delay in the signal. Maximum defined by buffer size. |
Function to change the number of timesteps delay. This can be done during run-time. It basically changes the offset to the buffer value which is returned on a propagation.
Definition at line 101 of file delayed_first_order_lowpass_filter.h.
References delay, DELAYED_FIRST_ORDER_LOWPASS_FILTER_BUFFER_SIZE, and f.
Referenced by delayed_first_order_lowpass_initialize().
|
inlinestatic |
delayed_first_order_lowpass_set_omega
f | Reference to the filter. |
omega | Filter bandwidth in [rad/s], only positive integer values. |
Function to change the bandwidth of the filter, can be done in run-time.
Definition at line 84 of file delayed_first_order_lowpass_filter.h.
References DELAYED_FIRST_ORDER_LOWPASS_FILTER_FILTER_ALPHA_SHIFT, and f.
Referenced by delayed_first_order_lowpass_initialize().