Monado OpenXR Runtime
m_lowpass_float Struct Reference
Collaboration diagram for m_lowpass_float:

Public Member Functions

 m_lowpass_float (float cutoff_hz)
 
struct m_lowpass_floatm_lowpass_float_create (float cutoff_hz)
 Constructor. More...
 
void m_lowpass_float_add_sample (struct m_lowpass_float *mlf, float sample, timepoint_ns timestamp_ns)
 Filter a sample. More...
 
float m_lowpass_float_get_state (const struct m_lowpass_float *mlf)
 Get the filtered value. More...
 
timepoint_ns m_lowpass_float_get_timestamp_ns (const struct m_lowpass_float *mlf)
 Get the time of last update. More...
 
bool m_lowpass_float_is_initialized (const struct m_lowpass_float *mlf)
 Get whether we have initialized state. More...
 
void m_lowpass_float_destroy (struct m_lowpass_float **ptr_to_mlf)
 Destroy a lowpass integer filter. More...
 

Data Fields

LowPassIIRFilter< float > filter
 

Member Function Documentation

◆ m_lowpass_float_add_sample()

void m_lowpass_float_add_sample ( struct m_lowpass_float mlf,
float  sample,
timepoint_ns  timestamp_ns 
)

Filter a sample.

Parameters
mlfself-pointer
sampleThe value to filter
timestamp_nsThe time that this sample was measured.

◆ m_lowpass_float_create()

struct m_lowpass_float * m_lowpass_float_create ( float  cutoff_hz)

Constructor.

Parameters
cutoff_hzA cutoff frequency in Hertz: signal changes much lower in frequency will be passed through the filter, while signal changes much higher in frequency will be blocked.

◆ m_lowpass_float_destroy()

void m_lowpass_float_destroy ( struct m_lowpass_float **  ptr_to_mlf)

Destroy a lowpass integer filter.

Does null checks.

Parameters
ptr_to_mlfAddress of your lowpass integer filter. Will be set to zero.

◆ m_lowpass_float_get_state()

float m_lowpass_float_get_state ( const struct m_lowpass_float mlf)

Get the filtered value.

Probably 0 or other meaningless value if it's not initialized: see m_lowpass_float_is_initialized

Parameters
mlfself-pointer

References xrt::auxiliary::math::LowPassIIRFilter< Scalar >::getState().

◆ m_lowpass_float_get_timestamp_ns()

timepoint_ns m_lowpass_float_get_timestamp_ns ( const struct m_lowpass_float mlf)

Get the time of last update.

Parameters
mlfself-pointer

References xrt::auxiliary::math::LowPassIIRFilter< Scalar >::getTimestampNs().

◆ m_lowpass_float_is_initialized()

bool m_lowpass_float_is_initialized ( const struct m_lowpass_float mlf)

Get whether we have initialized state.

Parameters
mlfself-pointer

References xrt::auxiliary::math::LowPassIIRFilter< Scalar >::isInitialized().


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