libgui 2.01
libgui is a GUI library for the GameCube, Wii, and Wii U
 
Loading...
Searching...
No Matches
OneEuroFilter Class Reference

Adaptive speed-based low-pass filter (the 1-euro filter) for smoothing noisy pointer signals such as the Wii U IR pointer. More...

#include <OneEuroFilter.h>

Public Member Functions

 OneEuroFilter (float minCutoff=1.0f, float beta=0.0f, float dCutoff=1.0f)
 
float filter (float value, float dt)
 
void reset ()
 Forgets all history; the next filter() call returns its input unchanged.
 
void setParams (float newMinCutoff, float newBeta, float newDCutoff=1.0f)
 Changes the filter parameters without resetting its state; see the constructor for their meaning.
 

Detailed Description

Adaptive speed-based low-pass filter (the 1-euro filter) for smoothing noisy pointer signals such as the Wii U IR pointer.

Definition at line 65 of file OneEuroFilter.h.

Constructor & Destructor Documentation

◆ OneEuroFilter()

OneEuroFilter::OneEuroFilter ( float minCutoff = 1.0f,
float beta = 0.0f,
float dCutoff = 1.0f )
inline
Parameters
minCutoffCutoff frequency in Hz when the signal is at rest (lower = smoother, more lag)
betaHow much the cutoff rises with signal speed (higher = snappier during fast motion)
dCutoffCutoff frequency in Hz for the speed estimate; rarely needs changing

Definition at line 70 of file OneEuroFilter.h.

Member Function Documentation

◆ filter()

float OneEuroFilter::filter ( float value,
float dt )
inline
Parameters
valueRaw noisy sample
dtSeconds since the previous call (must be > 0; non-positive values are treated as 1/60 s)
Returns
the filtered value

Definition at line 76 of file OneEuroFilter.h.

◆ reset()

void OneEuroFilter::reset ( )
inline

Forgets all history; the next filter() call returns its input unchanged.

Definition at line 99 of file OneEuroFilter.h.

◆ setParams()

void OneEuroFilter::setParams ( float newMinCutoff,
float newBeta,
float newDCutoff = 1.0f )
inline

Changes the filter parameters without resetting its state; see the constructor for their meaning.

Definition at line 106 of file OneEuroFilter.h.


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