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

Baseline estimation using Goldindec(implementation). More...

#include <cmath>
#include <functional>
#include <iostream>
#include "../misc/polyfit.h"
#include "goldindec.h"

Go to the source code of this file.

Functions

const std::vector< double > sablib::BaselineGoldindec (const std::vector< double > &y, const unsigned int polyorder, const double peak_ratio=0.5, const double alpha=0.99 *0.5, const unsigned int loop=100, const double eps=1.0e-4, const unsigned int loop_legend=50, const double eps_legend=1e-3, const double eps_s=1e-4)
 Performs baseline estimation using the Goldindec algorithm.

Detailed Description

Baseline estimation using Goldindec(implementation).

Author
Izadori

Definition in file goldindec.cpp.

Function Documentation

◆ BaselineGoldindec()

const std::vector< double > sablib::BaselineGoldindec ( const std::vector< double > & y,
const unsigned int polyorder,
const double peak_ratio = 0.5,
const double alpha = 0.99 *0.5,
const unsigned int loop = 100,
const double eps = 1.0e-4,
const unsigned int loop_legend = 50,
const double eps_legend = 1e-3,
const double eps_s = 1e-4 )

Performs baseline estimation using the Goldindec algorithm.

Parameters
yThe input data vector (signal to be processed).
polyorderThe order of the polynomial to be fitted.
peak_ratioEstimated ratio related to the peak content (default: 0.5).
alphaA weighting parameter for the iterative process (default: 0.99 * 0.5).
loopMaximum number of iterations for the main loop (default: 100).
epsConvergence threshold for the main loop (default: 1.0e-4).
loop_legendMaximum number of iterations for internal LEGEND algorithm (default: 50).
eps_legendConvergence threshold for internal LEGEND algorithm (default: 1e-3).
eps_sConvergence threshold for the internal parameter s (default: 1e-4).
Returns
A vector of the same size as y containing the estimated baseline.
Exceptions
std::invalid_argumentOne or more parameters are wrong.

Definition at line 21 of file goldindec.cpp.