Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
low_pass_zoh_filter.h File Reference

A first order low pass filter using Zero Order Hold (ZOH) discretization. More...

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

Go to the source code of this file.

Data Structures

struct  FirstOrderZOHLowPass
 Zero Order Hold (ZOH) discrete first order low pass filter structure. More...
 

Functions

static void init_first_order_zoh_low_pass (struct FirstOrderZOHLowPass *filter, const float tau, const float sample_time, float value)
 Init first order ZOH low pass filter.
 
static float update_first_order_zoh_low_pass (struct FirstOrderZOHLowPass *filter, const float value)
 Update first order ZOH low pass filter state with a new value.
 
static float reset_first_order_zoh_low_pass (struct FirstOrderZOHLowPass *filter, const float value)
 Reset the first order ZOH low-pass filter to a specific value.
 
static float get_first_order_zoh_low_pass (const struct FirstOrderZOHLowPass *filter)
 Get current value of the first order ZOH low pass filter.
 
static void update_first_order_zoh_low_pass_tau (struct FirstOrderZOHLowPass *filter, const float tau, const float sample_time)
 Update time constant (tau parameter) for first order ZOH low pass filter.
 

Detailed Description

A first order low pass filter using Zero Order Hold (ZOH) discretization.

Definitions and inline functions for 1st order low-pass ZOH filter vector types.

Provides structures and functions to initialize, update, reset, and get outputs from 1st order low-pass ZOH filter vectors.

Author
Justin Dubois j.p.g.nosp@m..dub.nosp@m.ois@s.nosp@m.tude.nosp@m.nt.tu.nosp@m.delf.nosp@m.t.nl

Definition in file low_pass_zoh_filter.h.


Data Structure Documentation

◆ FirstOrderZOHLowPass

struct FirstOrderZOHLowPass

Zero Order Hold (ZOH) discrete first order low pass filter structure.

This structure represents a first order low pass filter implemented using the Zero Order Hold (ZOH) method for discretization. It maintains the necessary state for filtering operations.

Definition at line 38 of file low_pass_zoh_filter.h.

Data Fields
float discrete_time_constant
float last_in
float last_out

Function Documentation

◆ get_first_order_zoh_low_pass()

static float get_first_order_zoh_low_pass ( const struct FirstOrderZOHLowPass filter)
inlinestatic

Get current value of the first order ZOH low pass filter.

Parameters
[in]filterfirst order ZOH low pass filter structure
Returns
current value of the filter

Definition at line 100 of file low_pass_zoh_filter.h.

References FirstOrderZOHLowPass::last_out.

◆ init_first_order_zoh_low_pass()

static void init_first_order_zoh_low_pass ( struct FirstOrderZOHLowPass filter,
const float  tau,
const float  sample_time,
float  value 
)
inlinestatic

Init first order ZOH low pass filter.

The ZOH discretization method is used to convert a continuous-time first order low pass filter into its discrete-time equivalent which matches the continuous-time behavior at the sampling instants exactly when holding the input constant between samples.

Parameters
[out]filterfirst order ZOH low pass filter structure
[in]tautime constant of the first order low pass filter [s]
[in]sample_timesampling period of the signal [s]
[in]valueinitial value of the filter

Definition at line 56 of file low_pass_zoh_filter.h.

References FirstOrderZOHLowPass::discrete_time_constant, foo, FirstOrderZOHLowPass::last_in, and FirstOrderZOHLowPass::last_out.

Referenced by init_first_order_zoh_low_pass_array().

+ Here is the caller graph for this function:

◆ reset_first_order_zoh_low_pass()

static float reset_first_order_zoh_low_pass ( struct FirstOrderZOHLowPass filter,
const float  value 
)
inlinestatic

Reset the first order ZOH low-pass filter to a specific value.

Parameters
[in,out]filterfirst order ZOH low pass filter structure
[in]valueValue to reset the filter to
Returns
The reset value

Definition at line 87 of file low_pass_zoh_filter.h.

References FirstOrderZOHLowPass::last_in, and FirstOrderZOHLowPass::last_out.

◆ update_first_order_zoh_low_pass()

static float update_first_order_zoh_low_pass ( struct FirstOrderZOHLowPass filter,
const float  value 
)
inlinestatic

Update first order ZOH low pass filter state with a new value.

Parameters
[in,out]filterfirst order ZOH low pass filter structure
[in]valuenew input value of the filter
Returns
new filtered value

Definition at line 72 of file low_pass_zoh_filter.h.

References FirstOrderZOHLowPass::discrete_time_constant, FirstOrderZOHLowPass::last_in, and FirstOrderZOHLowPass::last_out.

Referenced by update_first_order_zoh_low_pass_array().

+ Here is the caller graph for this function:

◆ update_first_order_zoh_low_pass_tau()

static void update_first_order_zoh_low_pass_tau ( struct FirstOrderZOHLowPass filter,
const float  tau,
const float  sample_time 
)
inlinestatic

Update time constant (tau parameter) for first order ZOH low pass filter.

Parameters
[in,out]filterfirst order ZOH low pass filter structure
[in]tautime constant of the first order low pass filter [s]
[in]sample_timesampling period of the signal [s]

Definition at line 110 of file low_pass_zoh_filter.h.

References FirstOrderZOHLowPass::discrete_time_constant, and foo.