Monado OpenXR Runtime
m_lowpass_integer Struct Reference
Collaboration diagram for m_lowpass_integer:

Public Member Functions

 m_lowpass_integer (Rational64 alpha)
 
struct m_lowpass_integerm_lowpass_integer_create (int64_t alpha_numerator, int64_t alpha_denominator)
 Constructor. More...
 
void m_lowpass_integer_add_sample (struct m_lowpass_integer *mli, int64_t sample)
 Filter a sample. More...
 
int64_t m_lowpass_integer_get_state (const struct m_lowpass_integer *mli)
 Get the filtered value. More...
 
bool m_lowpass_integer_is_initialized (const struct m_lowpass_integer *mli)
 Get whether we have initialized state. More...
 
void m_lowpass_integer_destroy (struct m_lowpass_integer **ptr_to_mli)
 Destroy a lowpass integer filter. More...
 

Data Fields

IntegerLowPassIIRFilter< int64_t > filter
 

Member Function Documentation

◆ m_lowpass_integer_add_sample()

void m_lowpass_integer_add_sample ( struct m_lowpass_integer mli,
int64_t  sample 
)

Filter a sample.

Parameters
mliself-pointer
sampleThe value to filter

◆ m_lowpass_integer_create()

struct m_lowpass_integer * m_lowpass_integer_create ( int64_t  alpha_numerator,
int64_t  alpha_denominator 
)

Constructor.

Note
Taking alpha, not a cutoff frequency, here, because it's easier with the rational math.

Together, the two parameters specify the alpha value used to blend between new input and existing state. Larger values mean more influence from new input.

Parameters
alpha_numeratorThe numerator of the alpha value. Must be greater than 0 and less than alpha_denominator
alpha_denominatorThe denominator of the alpha value. Must be greater than 0.
Returns
null if a parameter is out of range

◆ m_lowpass_integer_destroy()

void m_lowpass_integer_destroy ( struct m_lowpass_integer **  ptr_to_mli)

Destroy a lowpass integer filter.

Does null checks.

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

◆ m_lowpass_integer_get_state()

int64_t m_lowpass_integer_get_state ( const struct m_lowpass_integer mli)

Get the filtered value.

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

Parameters
mliself-pointer

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

◆ m_lowpass_integer_is_initialized()

bool m_lowpass_integer_is_initialized ( const struct m_lowpass_integer mli)

Get whether we have initialized state.

Parameters
mliself-pointer

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


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