Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
high_pass_filter.h File Reference

Simple high pass filter with double precision. More...

#include "std.h"
#include "math/pprz_algebra_int.h"
+ Include dependency graph for high_pass_filter.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  FirstOrderHighPass
 First order high pass filter structure. More...
 
struct  FourthOrderHighPass
 Fourth order filter structure. More...
 

Functions

static void init_first_order_high_pass (struct FirstOrderHighPass *filter, float tau, float sample_time, float value)
 Init first order high pass filter. More...
 
static float update_first_order_high_pass (struct FirstOrderHighPass *filter, float value)
 Update first order high pass filter state with a new value. More...
 
static float get_first_order_high_pass (struct FirstOrderHighPass *filter)
 Get current value of the first order high pass filter. More...
 
static void init_fourth_order_high_pass (struct FourthOrderHighPass *filter, double *a, double *b, double value)
 Init fourth order high pass filter. More...
 
static double update_fourth_order_high_pass (struct FourthOrderHighPass *filter, double value)
 Update fourth order high pass filter state with a new value. More...
 
static double get_fourth_order_high_pass (struct FourthOrderHighPass *filter)
 Get current value of the fourth order high pass filter. More...
 

Detailed Description

Simple high pass filter with double precision.

Definition in file high_pass_filter.h.


Data Structure Documentation

◆ FirstOrderHighPass

struct FirstOrderHighPass

First order high pass filter structure.

using bilinear z transform

Definition at line 37 of file high_pass_filter.h.

Data Fields
float last_in
float last_out
float time_const

◆ FourthOrderHighPass

struct FourthOrderHighPass

Fourth order filter structure.

Polynomial discrete form:

   b0 + b1 z^-1 + b2 z^-2 etc

H(z) = -------------------— a0 + a1 z^-1 + a2 z^-2 etc

Definition at line 99 of file high_pass_filter.h.

Data Fields
double a[4] denominator gains
double b[4] numerator gains
double i[4] input history
double o[4] output history

Function Documentation

◆ get_first_order_high_pass()

static float get_first_order_high_pass ( struct FirstOrderHighPass filter)
inlinestatic

Get current value of the first order high pass filter.

Parameters
filterfirst order high pass filter structure
Returns
current value of the filter

Definition at line 86 of file high_pass_filter.h.

References FirstOrderHighPass::last_out.

◆ get_fourth_order_high_pass()

static double get_fourth_order_high_pass ( struct FourthOrderHighPass filter)
inlinestatic

Get current value of the fourth order high pass filter.

Parameters
filterfourth order high pass filter structure
Returns
current value of the filter

Definition at line 159 of file high_pass_filter.h.

References FourthOrderHighPass::o.

◆ init_first_order_high_pass()

static void init_first_order_high_pass ( struct FirstOrderHighPass filter,
float  tau,
float  sample_time,
float  value 
)
inlinestatic

Init first order high pass filter.

Laplace transform in continuous time: tau*s H(s) = ------— 1 + tau*s

Parameters
filterfirst order high pass filter structure
tautime constant of the first order high pass filter
sample_timesampling period of the signal
valueinitial value of the filter

Definition at line 56 of file high_pass_filter.h.

References FirstOrderHighPass::last_in, FirstOrderHighPass::last_out, and FirstOrderHighPass::time_const.

Referenced by nps_fdm_init().

+ Here is the caller graph for this function:

◆ init_fourth_order_high_pass()

static void init_fourth_order_high_pass ( struct FourthOrderHighPass filter,
double *  a,
double *  b,
double  value 
)
inlinestatic

Init fourth order high pass filter.

Parameters
filterfourth order high pass filter structure
valueinitial value of the filter

Definition at line 112 of file high_pass_filter.h.

References FourthOrderHighPass::a, FourthOrderHighPass::b, b, FourthOrderHighPass::i, and FourthOrderHighPass::o.

◆ update_first_order_high_pass()

static float update_first_order_high_pass ( struct FirstOrderHighPass filter,
float  value 
)
inlinestatic

Update first order high pass filter state with a new value.

Parameters
filterfirst order high pass filter structure
valuenew input value of the filter
Returns
new filtered value

Definition at line 70 of file high_pass_filter.h.

References FirstOrderHighPass::last_in, FirstOrderHighPass::last_out, and FirstOrderHighPass::time_const.

Referenced by gazebo_write().

+ Here is the caller graph for this function:

◆ update_fourth_order_high_pass()

static double update_fourth_order_high_pass ( struct FourthOrderHighPass filter,
double  value 
)
inlinestatic

Update fourth order high pass filter state with a new value.

Parameters
filterfourth order high pass filter structure
valuenew input value of the filter
Returns
new filtered value

Definition at line 131 of file high_pass_filter.h.

References FourthOrderHighPass::a, FourthOrderHighPass::b, FourthOrderHighPass::i, and FourthOrderHighPass::o.