PX4 Firmware
PX4 Autopilot Software http://px4.io
math::LowPassFilter2p Class Reference

#include <LowPassFilter2p.hpp>

Collaboration diagram for math::LowPassFilter2p:

Public Member Functions

 LowPassFilter2p (float sample_freq, float cutoff_freq)
 
void set_cutoff_frequency (float sample_freq, float cutoff_freq)
 
float apply (float sample)
 Add a new raw value to the filter. More...
 
float get_cutoff_freq () const
 
float reset (float sample)
 

Private Attributes

float _cutoff_freq {0.0f}
 
float _a1 {0.0f}
 
float _a2 {0.0f}
 
float _b0 {0.0f}
 
float _b1 {0.0f}
 
float _b2 {0.0f}
 
float _delay_element_1 {0.0f}
 
float _delay_element_2 {0.0f}
 

Detailed Description

Definition at line 43 of file LowPassFilter2p.hpp.

Constructor & Destructor Documentation

◆ LowPassFilter2p()

math::LowPassFilter2p::LowPassFilter2p ( float  sample_freq,
float  cutoff_freq 
)
inline

Definition at line 47 of file LowPassFilter2p.hpp.

Member Function Documentation

◆ apply()

float math::LowPassFilter2p::apply ( float  sample)

Add a new raw value to the filter.

Returns
retrieve the filtered result

Definition at line 75 of file LowPassFilter2p.cpp.

References _a1, _a2, _b0, _b1, _b2, _delay_element_1, and _delay_element_2.

Referenced by DfMpu9250Wrapper::_publish(), MS5525::collect(), SDP3X::collect(), MEASAirspeed::collect(), reset(), and control::BlockLowPass2::update().

Here is the caller graph for this function:

◆ get_cutoff_freq()

float math::LowPassFilter2p::get_cutoff_freq ( ) const
inline

Definition at line 64 of file LowPassFilter2p.hpp.

References lps22hb::reset().

Referenced by control::BlockLowPass2::update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset()

float math::LowPassFilter2p::reset ( float  sample)

Definition at line 94 of file LowPassFilter2p.cpp.

References _b0, _b1, _b2, _delay_element_1, _delay_element_2, and apply().

Here is the call graph for this function:

◆ set_cutoff_frequency()

void math::LowPassFilter2p::set_cutoff_frequency ( float  sample_freq,
float  cutoff_freq 
)

Definition at line 43 of file LowPassFilter2p.cpp.

References _a1, _a2, _b0, _b1, _b2, _cutoff_freq, _delay_element_1, _delay_element_2, f(), and M_PI_F.

Referenced by DfMpu9250Wrapper::DfMpu9250Wrapper(), and control::BlockLowPass2::update().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _a1

float math::LowPassFilter2p::_a1 {0.0f}
private

Definition at line 73 of file LowPassFilter2p.hpp.

Referenced by apply(), and set_cutoff_frequency().

◆ _a2

float math::LowPassFilter2p::_a2 {0.0f}
private

Definition at line 74 of file LowPassFilter2p.hpp.

Referenced by apply(), and set_cutoff_frequency().

◆ _b0

float math::LowPassFilter2p::_b0 {0.0f}
private

Definition at line 76 of file LowPassFilter2p.hpp.

Referenced by apply(), reset(), and set_cutoff_frequency().

◆ _b1

float math::LowPassFilter2p::_b1 {0.0f}
private

Definition at line 77 of file LowPassFilter2p.hpp.

Referenced by apply(), reset(), and set_cutoff_frequency().

◆ _b2

float math::LowPassFilter2p::_b2 {0.0f}
private

Definition at line 78 of file LowPassFilter2p.hpp.

Referenced by apply(), reset(), and set_cutoff_frequency().

◆ _cutoff_freq

float math::LowPassFilter2p::_cutoff_freq {0.0f}
private

Definition at line 71 of file LowPassFilter2p.hpp.

Referenced by set_cutoff_frequency().

◆ _delay_element_1

float math::LowPassFilter2p::_delay_element_1 {0.0f}
private

Definition at line 80 of file LowPassFilter2p.hpp.

Referenced by apply(), reset(), and set_cutoff_frequency().

◆ _delay_element_2

float math::LowPassFilter2p::_delay_element_2 {0.0f}
private

Definition at line 81 of file LowPassFilter2p.hpp.

Referenced by apply(), reset(), and set_cutoff_frequency().


The documentation for this class was generated from the following files: