![]() |
sablib
|
Baseline estimation using iterative polynomial fitting with a non-quadratic cost function(Backcor algorithm). More...
#include <stdexcept>#include <vector>Go to the source code of this file.
Enumerations | |
| enum class | sablib::BackcorFunc { Huber , AHuber , TQuad , ATQuad , Indec , AIndec } |
| Cost function types for the Backcor algorithm. More... | |
Functions | |
| const std::vector< double > | sablib::BaselineBackcor (const std::vector< double > &y, const unsigned int polyorder, const BackcorFunc func=BackcorFunc::ATQuad, const double s=1, const double alpha=0.99 *0.5, const unsigned int loop=50, const double eps=1.0e-3) |
| Performs baseline estimation using iterative polynomial fitting with a non-quadratic cost function (Backcor). | |
Baseline estimation using iterative polynomial fitting with a non-quadratic cost function(Backcor algorithm).
References:
Definition in file backcor.h.
|
strong |
Cost function types for the Backcor algorithm.
These functions define how the fitting error is penalized during the iterative polynomial fitting process. Asymmetric versions are typically used for signals with positive peaks to ensure the baseline stays below the signal.
| const std::vector< double > sablib::BaselineBackcor | ( | const std::vector< double > & | y, |
| const unsigned int | polyorder, | ||
| const BackcorFunc | func = BackcorFunc::ATQuad, | ||
| const double | s = 1, | ||
| const double | alpha = 0.99 *0.5, | ||
| const unsigned int | loop = 50, | ||
| const double | eps = 1.0e-3 ) |
Performs baseline estimation using iterative polynomial fitting with a non-quadratic cost function (Backcor).
This algorithm fits a polynomial of order polyorder to the signal y. In each iteration, the signal is modified based on the chosen cost function func to progressively estimate the background.
| y | The input data vector (signal to be processed). |
| polyorder | The order of the polynomial to be fitted. |
| func | The type of cost function to use (default: ATQuad). |
| s | Threshold parameter for the cost function (default: 1.0). |
| alpha | Control parameter for the iterative update (default: 0.99 * 0.5). Should be in range [0, 1]. |
| loop | The maximum number of iterations (default: 50). |
| eps | Convergence threshold for the relative change in the estimated baseline (default: 1.0e-3). |
| std::invalid_argument | One or more parameters are wrong. |
Definition at line 20 of file backcor.cpp.