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

Baseline estimation using simple moving average(implementation). More...

#include "sma.h"

Go to the source code of this file.

Functions

const std::vector< double > sablib::BaselineSMA (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(implementation).

Author
Izadori

Definition in file sma.cpp.

Function Documentation

◆ BaselineSMA()

const std::vector< double > sablib::BaselineSMA ( 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.

Definition at line 14 of file sma.cpp.