sablib
Loading...
Searching...
No Matches
sma.h File Reference

Baseline estimation using simple moving average. More...

#include "result_type.h"
#include "sablib_export.h"

Go to the source code of this file.

Functions

const BaselineResult sablib::BaselineSMA (const std::vector< double > &y, const unsigned int n, const unsigned int loop=50)
 Performs background estimation using a simple moving average.

Detailed Description

Baseline estimation using simple moving average.

Author
Izadori

Definition in file sma.h.

Function Documentation

◆ BaselineSMA()

SABLIB_EXPORT const BaselineResult sablib::BaselineSMA ( const std::vector< double > & y,
const unsigned int n,
const unsigned int loop = 50 )

Performs background estimation using a simple moving average.

Parameters
yThe input data for baseline estimation.
nHalf-width of the moving average window (calculated using 2 * n + 1 points).
loopNumber of iterations (default is 50).
Returns
The estimated baseline and baseline-corrected data.

Definition at line 16 of file sma.cpp.

References sablib::BaselineResult::baseline, and sablib::BaselineResult::corrected.