Paparazzi UAS
v5.15_devel230gc96ce27
Paparazzi is a free software Unmanned Aircraft System.

First order lowpass 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 lowpass 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.
Referenced by delayed_first_order_lowpass_initialize(), delayed_first_order_lowpass_propagate(), and delayed_first_order_lowpass_set_delay().
#define DELAYED_FIRST_ORDER_LOWPASS_FILTER_FILTER_ALPHA_SHIFT 14 
Definition at line 33 of file delayed_first_order_lowpass_filter.h.
Referenced by delayed_first_order_lowpass_propagate(), delayed_first_order_lowpass_set_omega(), indi_apply_compensator_filters(), and stabilization_attitude_init().

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 delayed_first_order_lowpass_filter_t::buffer, DELAYED_FIRST_ORDER_LOWPASS_FILTER_BUFFER_SIZE, delayed_first_order_lowpass_set_delay(), delayed_first_order_lowpass_set_omega(), delayed_first_order_lowpass_filter_t::idx, delayed_first_order_lowpass_filter_t::max_inc, and delayed_first_order_lowpass_filter_t::sample_frequency.
Referenced by stabilization_attitude_init().

inlinestatic 
delayed_first_order_lowpass_propagate
f  Reference to the filter. 
input  Value that needs to be filtered. 
The actual lowpass 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_t::alpha, delayed_first_order_lowpass_filter_t::buffer, delayed_first_order_lowpass_filter_t::delay, DELAYED_FIRST_ORDER_LOWPASS_FILTER_BUFFER_SIZE, DELAYED_FIRST_ORDER_LOWPASS_FILTER_FILTER_ALPHA_SHIFT, delayed_first_order_lowpass_filter_t::idx, and delayed_first_order_lowpass_filter_t::max_inc.
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 runtime. 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 delayed_first_order_lowpass_filter_t::delay, and DELAYED_FIRST_ORDER_LOWPASS_FILTER_BUFFER_SIZE.
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 runtime.
Definition at line 84 of file delayed_first_order_lowpass_filter.h.
References delayed_first_order_lowpass_filter_t::alpha, DELAYED_FIRST_ORDER_LOWPASS_FILTER_FILTER_ALPHA_SHIFT, delayed_first_order_lowpass_filter_t::omega, and delayed_first_order_lowpass_filter_t::sample_frequency.
Referenced by delayed_first_order_lowpass_initialize().