Documentation
Tools for embedded systems
Loading...
Searching...
No Matches
qlibs::smootherMOR2 Class Reference

A Moving Outlier Removal filter. More...

#include <smoother.hpp>

Inheritance diagram for qlibs::smootherMOR2:
qlibs::smoother qlibs::tdl

Public Member Functions

virtual ~smootherMOR2 ()
 
bool setup (real_t *window, const size_t w_size, const real_t a=0.9_re)
 Setup an initialize the Moving Outlier Removal filter.
 
template<size_t windowSize>
bool setup (real_t(&window)[windowSize], const real_t a=0.9_re)
 Setup an initialize the Moving Outlier Removal filter.
 
real_t smooth (const real_t x) override
 Perform the smooth operation recursively for the input signal x.
 
- Public Member Functions inherited from qlibs::smoother
virtual ~smoother ()
 
bool isInitialized (void) const
 Check if the smoother filter is initialized.
 
bool reset (void)
 Reset the the smoother filter.
 
- Public Member Functions inherited from qlibs::tdl
virtual ~tdl ()
 
 tdl ()=default
 
 tdl (real_t *const area, const size_t n, const real_t initVal=0.0_re)
 Constructor for the Tapped Delay Line (TDL) instance.
 
template<size_t numberOfDelays>
 tdl (real_t(&area)[numberOfDelays], const real_t initVal=0.0_re) noexcept
 Constructor for the Tapped Delay Line (TDL) instance.
 
void setup (real_t *const area, const size_t n, const real_t initVal=0.0_re) noexcept
 Setup and initialize a Tapped Delay Line (TDL) instance by setting the default optimal parameters.
 
template<size_t numberOfDelays>
void setup (real_t(&area)[numberOfDelays], const real_t initVal=0.0_re) noexcept
 Setup and initialize a Tapped Delay Line (TDL) instance by setting the default optimal parameters.
 
void flush (const real_t initVal=0.0_re) noexcept
 Clears all delays from the TDL and sets them to the specified value.
 
real_t getOldest (void) const noexcept
 Get the oldest sample from the TDL x(k-n)
 
real_t getRecent (void) const noexcept
 Get the most recent sample from the TDL x(k)
 
real_t getAtIndex (const size_t i) const noexcept
 Get the specified delayed sample from the TDL x(k-i)
 
void insertSample (const real_t sample) noexcept
 Insert a new sample to the TDL removing the oldest sample.
 
const real_toperator[] (int index) noexcept
 Get the specified delayed sample from the TDL x(k-i)
 
void operator() (const real_t sample) noexcept
 Insert a new sample to the TDL removing the oldest sample.
 
bool isInitialized (void) const
 Check if the TDL has been initialized.
 

Detailed Description

A Moving Outlier Removal filter.

Note
Time complexity is O(1)

Constructor & Destructor Documentation

◆ ~smootherMOR2()

virtual qlibs::smootherMOR2::~smootherMOR2 ( )
inlinevirtual

Member Function Documentation

◆ setup() [1/2]

bool smootherMOR2::setup ( real_t * window,
const size_t w_size,
const real_t a = 0.9_re )

Setup an initialize the Moving Outlier Removal filter.

Parameters
[in]windowAn array to hold the samples of the window
[in]w_sizeThe number of elements in window
[in]aA value to adjust the filter behavior
Returns
true on success, otherwise return false.

◆ setup() [2/2]

template<size_t windowSize>
bool qlibs::smootherMOR2::setup ( real_t(&) window[windowSize],
const real_t a = 0.9_re )
inline

Setup an initialize the Moving Outlier Removal filter.

Parameters
[in]windowAn array to hold the samples of the window
[in]aA value to adjust the filter behavior
Returns
true on success, otherwise return false.

◆ smooth()

real_t smootherMOR2::smooth ( const real_t x)
overridevirtual

Perform the smooth operation recursively for the input signal x.

Precondition
Instance must be previously initialized
Parameters
[in]xA sample of the input signal.
Returns
The smoothed output.

Implements qlibs::smoother.