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

A Moving Window Median filter. More...

#include <smoother.hpp>

Inheritance diagram for qlibs::smootherMWM1:
qlibs::smoother

Public Member Functions

virtual ~smootherMWM1 ()
 
bool setup (real_t *window, const size_t w_size)
 Setup an initialize the Moving Window Median filter.
 
template<size_t windowSize>
bool setup (real_t(&window)[windowSize])
 Setup an initialize the Moving Window Median 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.
 

Detailed Description

A Moving Window Median filter.

Note
Time complexity is O(n)

Constructor & Destructor Documentation

◆ ~smootherMWM1()

virtual qlibs::smootherMWM1::~smootherMWM1 ( )
inlinevirtual

Member Function Documentation

◆ setup() [1/2]

bool smootherMWM1::setup ( real_t * window,
const size_t w_size )

Setup an initialize the Moving Window Median filter.

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

◆ setup() [2/2]

template<size_t windowSize>
bool qlibs::smootherMWM1::setup ( real_t(&) window[windowSize])
inline

Setup an initialize the Moving Window Median filter.

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

◆ smooth()

real_t smootherMWM1::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.