Documentation
Tools for embedded systems
Loading...
Searching...
No Matches
qSSMoother

API for the qSSmoother library. More...

Data Structures

struct  qSSmoother_LPF1_t
 A 1st order Low-Pass Filter. More...
 
struct  qSSmoother_LPF2_t
 A 2nd order Low-Pass Filter. More...
 
struct  qSSmoother_MWM1_t
 A Moving Window Median filter. More...
 
struct  qSSmoother_MWM2_t
 A Moving Window Median filter. More...
 
struct  qSSmoother_MOR1_t
 A Moving Outlier Removal filter. More...
 
struct  qSSmoother_MOR2_t
 A Moving Outlier Removal filter. More...
 
struct  qSSmoother_GMWF_t
 A Gaussian filter. More...
 
struct  qSSmoother_EXPW_t
 An Exponential weighting filter. More...
 
struct  qSSmoother_KLMN_t
 A scalar Kalman filter. More...
 
struct  qSSmoother_DESF_t
 Double exponential smoothing (Holt’s Method) More...
 
struct  qSSmoother_ALNF_t
 Adaptive Filter LMS. More...
 

Enumerations

enum  qSSmoother_Type_t {
  QSSMOOTHER_TYPE_LPF1 , QSSMOOTHER_TYPE_LPF2 , QSSMOOTHER_TYPE_MWM1 , QSSMOOTHER_TYPE_MWM2 ,
  QSSMOOTHER_TYPE_MOR1 , QSSMOOTHER_TYPE_MOR2 , QSSMOOTHER_TYPE_GMWF , QSSMOOTHER_TYPE_KLMN ,
  QSSMOOTHER_TYPE_EXPW , QSSMOOTHER_TYPE_DESF , QSSMOOTHER_TYPE_ALNF
}
 Supported Filters by the qSSmoother library. More...
 

Functions

int qSSmoother_IsInitialized (const qSSmootherPtr_t *const s)
 Check if the smoother filter is initialized.
 
int qSSmoother_Reset (qSSmootherPtr_t *const s)
 Reset the the smoother filter.
 
float qSSmoother_Perform (qSSmootherPtr_t *const s, const float x)
 Perform the smooth operation recursively for the input signal x.
 
int qSSmoother_Setup (qSSmootherPtr_t *const s, const qSSmoother_Type_t type, const float *const param, float *window, const size_t wsize)
 Setup an initialize smoother filter.
 

Detailed Description

API for the qSSmoother library.

For a brief description of this module, please read Filters for signal smoothing

Enumeration Type Documentation

◆ qSSmoother_Type_t

Supported Filters by the qSSmoother library.

Enumerator
QSSMOOTHER_TYPE_LPF1 

Low-Pass filter 1st Order

QSSMOOTHER_TYPE_LPF2 

Low-Pass filter 2nd Order

QSSMOOTHER_TYPE_MWM1 

Moving Window Median filter ( O(n) time )

QSSMOOTHER_TYPE_MWM2 

Moving Window Median filter ( O(1) time by using a TDL )

QSSMOOTHER_TYPE_MOR1 

Moving Outliers Removal ( O(n) time )

QSSMOOTHER_TYPE_MOR2 

Moving Outliers Removal ( O(1) time by using a TDL )

QSSMOOTHER_TYPE_GMWF 

Gaussian Filter

QSSMOOTHER_TYPE_KLMN 

Kalman Filter

QSSMOOTHER_TYPE_EXPW 

Exponential weighting filter

QSSMOOTHER_TYPE_DESF 

Double Exponential Smoother

QSSMOOTHER_TYPE_ALNF 

Adaptive Noise Cancellation

Function Documentation

◆ qSSmoother_IsInitialized()

int qSSmoother_IsInitialized ( const qSSmootherPtr_t *const s)

Check if the smoother filter is initialized.

Parameters
[in]sA pointer to the signal smoother instance.
Returns
1 if the smoother has been initialized, otherwise return 0.

◆ qSSmoother_Perform()

float qSSmoother_Perform ( qSSmootherPtr_t *const s,
const float x )

Perform the smooth operation recursively for the input signal x.

Precondition
Instance must be previously initialized by qSSmoother_Setup()
Parameters
[in]sA pointer to the signal smoother instance.
[in]xA sample of the input signal.
Returns
The smoothed output.

◆ qSSmoother_Reset()

int qSSmoother_Reset ( qSSmootherPtr_t *const s)

Reset the the smoother filter.

Parameters
[in]sA pointer to the signal smoother instance.
Returns
1 on success, otherwise return 0.

◆ qSSmoother_Setup()

int qSSmoother_Setup ( qSSmootherPtr_t *const s,
const qSSmoother_Type_t type,
const float *const param,
float * window,
const size_t wsize )

Setup an initialize smoother filter.

Parameters
[in]sA pointer to the signal smoother instance.
[in]typeThe filter type. Use one of the following values:
Parameters
[in]paramThe smoother parameters. Depends of the type selected:

if QSSMOOTHER_TYPE_LPF1 a pointer to a value between [ 0 < alpha < 1 ]

if QSSMOOTHER_TYPE_LPF2 a pointer to a value between [ 0 < alpha < 1 ]

if QSSMOOTHER_TYPE_MWM1 can be ignored. Pass NULL as argument.

if QSSMOOTHER_TYPE_MWM2 can be ignored. Pass NULL as argument.

if QSSMOOTHER_TYPE_MOR1 a pointer to a value between [ 0 < alpha < 1 ]

if QSSMOOTHER_TYPE_MOR2 a pointer to a value between [ 0 < alpha < 1 ]

if QSSMOOTHER_TYPE_GMWF, an array with two values. The first element with the Standard deviation [ sigma > 0 ]. The second element with the offset of the gaussian center. [ 0 < offset < ( wsize - 1 ) ].

if QSSMOOTHER_TYPE_KLMN, an array with three values. The first element with the initial estimated error covariance. The second element with the process(predict) noise covariance. The third element with the measure noise convariance

if QSSMOOTHER_TYPE_EXPW, a pointer to a value between [ 0 < lambda < 1 ] that represents the forgetting factor.

if QSSMOOTHER_TYPE_DESF, an array with three values. The first element [ 0 < alpha < 1 ] that represents the weight for the level, the second, [ 0 < beta < 1 ] weight for the trend. The third element with the number of step for the forecast, should be an integer value greater or equal to zero.

if QSSMOOTHER_TYPE_ALNF, an array with two values. The first element with learning rate [ 0 < alpha < 1 ]. The second element with the momentum [ 0 < mu < 1 ].

Parameters
[in]windowThe filter window and coefficients. Depends of the type selected:

if QSSMOOTHER_TYPE_LPF1, can be ignored. Pass NULL as argument.

if QSSMOOTHER_TYPE_LPF2, can be ignored. Pass NULL as argument.

if QSSMOOTHER_TYPE_MWM1, An array of wsize elements.

if QSSMOOTHER_TYPE_MWM2, An array of wsize elements.

if QSSMOOTHER_TYPE_MOR1, An array of wsize elements.

if QSSMOOTHER_TYPE_MOR2, An array of wsize elements.

if QSSMOOTHER_TYPE_GMWF, An array of 2* wsize to hold both, the window and the gaussian kernel coefficients.

if QSSMOOTHER_TYPE_KLMN, can be ignored. Pass NULL as argument.

if QSSMOOTHER_TYPE_EXPW, can be ignored. Pass NULL as argument.

if QSSMOOTHER_TYPE_DESF, can be ignored. Pass NULL as argument.

if QSSMOOTHER_TYPE_ALNF, An array of 2* wsize elements when momentum is set to zero, otherwise an array of 3* wsize elements.

Parameters
[in]wsizeIf used, the number of elements in window, otherwise pass 0uL as argument.
Returns
1 on success, otherwise return 0.