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

Baseline estimation with polynomial line. More...

#include <stdexcept>
#include <vector>
#include "../misc/polyfit.h"

Go to the source code of this file.

Functions

std::vector< double > sablib::BaselineLinear (std::vector< double > &y, const unsigned int index1, const unsigned int index2)
 Performs baseline estimation with a linear line between two points.
std::vector< double > sablib::BaselinePolynomial (std::vector< double > &y, const unsigned int polyorder, const std::vector< unsigned int > &indices)
 Performs baseline estimation by fitting a polynomial to specified points.

Detailed Description

Baseline estimation with polynomial line.

Author
Izadori

Definition in file polynomial.h.

Function Documentation

◆ BaselineLinear()

std::vector< double > sablib::BaselineLinear ( std::vector< double > & y,
const unsigned int index1,
const unsigned int index2 )

Performs baseline estimation with a linear line between two points.

Parameters
yThe input data for baseline estimation.
index1The index of the first point.
index2The index of the second point.
Returns
The estimated linear baseline.
Exceptions
std::invalid_argumentOne or more parameters are wrong.

Definition at line 16 of file polynomial.cpp.

◆ BaselinePolynomial()

std::vector< double > sablib::BaselinePolynomial ( std::vector< double > & y,
const unsigned int polyorder,
const std::vector< unsigned int > & indices )

Performs baseline estimation by fitting a polynomial to specified points.

Parameters
yThe input data for baseline estimation.
polyorderThe order of the polynomial to fit.
indicesThe indices of the points used for polynomial fitting.
Returns
The estimated polynomial baseline.
Exceptions
std::invalid_argumentOne or more parameters are wrong.

Definition at line 43 of file polynomial.cpp.