![]() |
sablib
|
The C interface of sablib baseline estimation functions.(implementation). More...
#include "baseline.h"#include "../baseline/airpls.h"#include "../baseline/arpls.h"#include "../baseline/asls.h"#include "../baseline/backcor.h"#include "../baseline/beads.h"#include "../baseline/goldindec.h"#include "../baseline/imodpoly.h"#include "../baseline/modpoly.h"#include "../baseline/polynomial.h"#include "../baseline/psalsa.h"#include "../baseline/sma.h"#include "../baseline/snip.h"#include "../baseline/spline.h"Go to the source code of this file.
Functions | |
| const SABLIB_BASELINE_DATA_PTR | Sablib_BaselineLinear (const SABLIB_DATA_PTR y, const unsigned int index1, const unsigned int index2) |
| Performs baseline estimation with a linear line between two points. | |
| const SABLIB_BASELINE_DATA_PTR | Sablib_BaselinePolynomial (const SABLIB_DATA_PTR y, const unsigned int polyorder, const unsigned int *indices_ptr, const size_t ptr_size) |
| Performs baseline estimation by fitting a polynomial to specified points. | |
| const SABLIB_BASELINE_DATA_PTR | Sablib_BaselineSpline (const SABLIB_DATA_PTR y, const unsigned int *indices_ptr, const size_t ptr_size) |
| Performs baseline estimation using cubic spline interpolation. | |
| const SABLIB_BASELINE_DATA_PTR | Sablib_BaselineSMA (const SABLIB_DATA_PTR y, const unsigned int n, const unsigned int loop) |
| Performs background estimation using a simple moving average. | |
| const SABLIB_BASELINE_DATA_PTR | Sablib_BaselineSnip (const SABLIB_DATA_PTR y, const unsigned int m, const bool decreasing, const enum Sablib_SnipPreprocess preprocess, const unsigned int loop) |
| Performs baseline estimation using the Statistics-sensitive Non-linear Iterative Peak-clipping (SNIP) algorithm. | |
| const SABLIB_BASELINE_DATA_PTR | Sablib_BaselineModPoly (const SABLIB_DATA_PTR y, const unsigned int polyorder, const unsigned int loop, const double eps) |
| Estimates the baseline using the Modified Polynomial (ModPoly) method. | |
| const SABLIB_BASELINE_DATA_PTR | Sablib_BaselineIModPoly (const SABLIB_DATA_PTR y, const unsigned int polyorder, const double k, const unsigned int loop, const double eps) |
| Estimates the baseline using the Improved Modified Polynomial (IModPoly) method. | |
| const SABLIB_BASELINE_DATA_PTR | Sablib_BaselineBackcor (const SABLIB_DATA_PTR y, const unsigned int polyorder, const enum Sablib_BackcorFunc func, const double s, const double alpha, const unsigned int loop, const double eps) |
| Performs baseline estimation using iterative polynomial fitting with a non-quadratic cost function (Backcor). | |
| const SABLIB_BASELINE_DATA_PTR | Sablib_BaselineGoldindec (const SABLIB_DATA_PTR y, const unsigned int polyorder, const double peak_ratio, const double alpha, const unsigned int loop, const double eps, const unsigned int loop_legend, const double eps_legend, const double eps_s) |
| Performs baseline estimation using the Goldindec algorithm. | |
| const SABLIB_BASELINE_DATA_PTR | Sablib_BaselineAsLS (const SABLIB_DATA_PTR y, const double lambda, const double p, const unsigned int s, const unsigned int loop, const double eps) |
| Performs baseline estimation using Asymmetric Least Squares Smoothing (AsLS). | |
| const SABLIB_BASELINE_DATA_PTR | Sablib_BaselineAirPLS (const SABLIB_DATA_PTR y, const double lambda, const unsigned int s, const unsigned int loop, const double eps) |
| Performs baseline estimation using adaptive iteratively reweighted Penalized Least Squares(airPLS). | |
| const SABLIB_BASELINE_DATA_PTR | Sablib_BaselineArPLS (const SABLIB_DATA_PTR y, const double lambda, const unsigned int s, const unsigned int loop, const double eps) |
| Performs baseline estimation using asymmetrically reweighted Penalized Least Squares(arPLS). | |
| const SABLIB_BASELINE_DATA_PTR | Sablib_BaselinePsalsa (const SABLIB_DATA_PTR y, const double lambda, const double p, const double k, const unsigned int s, const unsigned int loop, const double eps) |
| Performs baseline estimation using Peaked Signal’s Asymmetric Least Squares Algorithm (psalsa). | |
| const SABLIB_BASELINE_DATA_PTR | Sablib_BaselineBeads (const SABLIB_DATA_PTR y, const unsigned int s, const double frequency, const double r, const double lambda0, const double lambda1, const double lambda2, const unsigned int loop, const double eps, const enum Sablib_BeadsPenalty penalty) |
| Performs baseline estimation and denoising using Sparsity (BEADS). | |
| const SABLIB_DATA_PTR | Sablib_BeadsExpandBoundaries (const SABLIB_DATA_PTR y, const unsigned int n) |
| Expands the signal boundaries by padding with a tapered sequence. | |
| const SABLIB_DATA_PTR | Sablib_BeadsTrimBoundaries (const SABLIB_DATA_PTR y, const unsigned int n) |
| Trims the expanded signal boundaries. | |
The C interface of sablib baseline estimation functions.(implementation).
Definition in file baseline.cpp.
| const SABLIB_BASELINE_DATA_PTR Sablib_BaselineAirPLS | ( | const SABLIB_DATA_PTR | y, |
| const double | lambda, | ||
| const unsigned int | s, | ||
| const unsigned int | loop, | ||
| const double | eps ) |
Performs baseline estimation using adaptive iteratively reweighted Penalized Least Squares(airPLS).
| y | The input data for baseline estimation. |
| lambda | Smoothing parameter. |
| s | The order of the difference (usually s = 1, 2, or 3). |
| loop | Maximum number of iterations. |
| eps | Convergence threshold. |
Definition at line 265 of file baseline.cpp.
References AllocSablibBaselineData(), _stSablibBaselineData::baseline, _stSablibBaselineData::corrected, _stSablibData::data, and _stSablibData::size.
| const SABLIB_BASELINE_DATA_PTR Sablib_BaselineArPLS | ( | const SABLIB_DATA_PTR | y, |
| const double | lambda, | ||
| const unsigned int | s, | ||
| const unsigned int | loop, | ||
| const double | eps ) |
Performs baseline estimation using asymmetrically reweighted Penalized Least Squares(arPLS).
| y | The input data for baseline estimation. |
| lambda | Smoothing parameter. |
| s | The order of the difference (usually s = 1, 2, or 3). |
| loop | Maximum number of iterations. |
| eps | Convergence threshold. |
Definition at line 285 of file baseline.cpp.
References AllocSablibBaselineData(), _stSablibBaselineData::baseline, _stSablibBaselineData::corrected, _stSablibData::data, and _stSablibData::size.
| const SABLIB_BASELINE_DATA_PTR Sablib_BaselineAsLS | ( | const SABLIB_DATA_PTR | y, |
| const double | lambda, | ||
| const double | p, | ||
| const unsigned int | s, | ||
| const unsigned int | loop, | ||
| const double | eps ) |
Performs baseline estimation using Asymmetric Least Squares Smoothing (AsLS).
| y | The input data for baseline estimation. |
| lambda | Smoothing parameter. |
| p | Weight (asymmetry parameter, typically 0.001 to 0.1). |
| s | The order of the difference (usually s = 1, 2, or 3). |
| loop | Maximum number of iterations. |
| eps | Convergence threshold. |
Definition at line 245 of file baseline.cpp.
References AllocSablibBaselineData(), _stSablibBaselineData::baseline, _stSablibBaselineData::corrected, _stSablibData::data, and _stSablibData::size.
| const SABLIB_BASELINE_DATA_PTR Sablib_BaselineBackcor | ( | const SABLIB_DATA_PTR | y, |
| const unsigned int | polyorder, | ||
| const enum Sablib_BackcorFunc | func, | ||
| const double | s, | ||
| const double | alpha, | ||
| const unsigned int | loop, | ||
| const double | eps ) |
Performs baseline estimation using iterative polynomial fitting with a non-quadratic cost function (Backcor).
| 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. |
| s | Threshold parameter for the cost function. |
| alpha | Control parameter for the iterative update. Should be in range [0, 1]. |
| loop | The maximum number of iterations. |
| eps | Convergence threshold for the relative change in the estimated baseline. |
Definition at line 179 of file baseline.cpp.
References AHuber, AIndec, AllocSablibBaselineData(), _stSablibBaselineData::baseline, _stSablibBaselineData::corrected, _stSablibData::data, Huber, Indec, _stSablibData::size, and TQuad.
| const SABLIB_BASELINE_DATA_PTR Sablib_BaselineBeads | ( | const SABLIB_DATA_PTR | y, |
| const unsigned int | s, | ||
| const double | frequency, | ||
| const double | r, | ||
| const double | lambda0, | ||
| const double | lambda1, | ||
| const double | lambda2, | ||
| const unsigned int | loop, | ||
| const double | eps, | ||
| const enum Sablib_BeadsPenalty | penalty ) |
Performs baseline estimation and denoising using Sparsity (BEADS).
| y | The input data. |
| s | Order of the derivative for baseline sparsity (typically 1 or 2). |
| frequency | Sampling frequency of the signal. |
| r | High-pass filter parameter (cut-off frequency relative to sampling frequency). |
| lambda0 | Sparsity parameter for the baseline. |
| lambda1 | Sparsity parameter for the first-order derivative of the signal. |
| lambda2 | Sparsity parameter for the second-order derivative of the signal. |
| loop | Maximum number of iterations. |
| eps | Convergence threshold. |
| penalty | Penalty type. |
Definition at line 325 of file baseline.cpp.
References AllocSablibBaselineData(), _stSablibBaselineData::baseline, _stSablibBaselineData::corrected, _stSablibData::data, L1_v1, and _stSablibData::size.
| const SABLIB_BASELINE_DATA_PTR Sablib_BaselineGoldindec | ( | const SABLIB_DATA_PTR | y, |
| const unsigned int | polyorder, | ||
| const double | peak_ratio, | ||
| const double | alpha, | ||
| const unsigned int | loop, | ||
| const double | eps, | ||
| const unsigned int | loop_legend, | ||
| const double | eps_legend, | ||
| const double | eps_s ) |
Performs baseline estimation using the Goldindec algorithm.
| y | The input data vector (signal to be processed). |
| polyorder | The order of the polynomial to be fitted. |
| peak_ratio | Estimated ratio related to the peak content. |
| alpha | A weighting parameter for the iterative process. |
| loop | Maximum number of iterations for the main loop. |
| eps | Convergence threshold for the main loop. |
| loop_legend | Maximum number of iterations for internal LEGEND algorithm. |
| eps_legend | Convergence threshold for internal LEGEND algorithm. |
| eps_s | Convergence threshold for the internal parameter s. |
Definition at line 222 of file baseline.cpp.
References AllocSablibBaselineData(), _stSablibBaselineData::baseline, _stSablibBaselineData::corrected, _stSablibData::data, and _stSablibData::size.
| const SABLIB_BASELINE_DATA_PTR Sablib_BaselineIModPoly | ( | const SABLIB_DATA_PTR | y, |
| const unsigned int | polyorder, | ||
| const double | k, | ||
| const unsigned int | loop, | ||
| const double | eps ) |
Estimates the baseline using the Improved Modified Polynomial (IModPoly) method.
| y | The input data points to be processed. |
| polyorder | The order of the polynomial to fit. |
| k | Scaling factor for the standard deviation threshold. |
| loop | The maximum number of iterations. |
| eps | The convergence tolerance based on the standard deviation change. |
Definition at line 159 of file baseline.cpp.
References AllocSablibBaselineData(), _stSablibBaselineData::baseline, _stSablibBaselineData::corrected, _stSablibData::data, and _stSablibData::size.
| const SABLIB_BASELINE_DATA_PTR Sablib_BaselineLinear | ( | const SABLIB_DATA_PTR | y, |
| const unsigned int | index1, | ||
| const unsigned int | index2 ) |
Performs baseline estimation with a linear line between two points.
| y | The input data for baseline estimation. |
| index1 | The index of the first point. |
| index2 | The index of the second point. |
Definition at line 26 of file baseline.cpp.
References AllocSablibBaselineData(), _stSablibBaselineData::baseline, _stSablibBaselineData::corrected, _stSablibData::data, and _stSablibData::size.
| const SABLIB_BASELINE_DATA_PTR Sablib_BaselineModPoly | ( | const SABLIB_DATA_PTR | y, |
| const unsigned int | polyorder, | ||
| const unsigned int | loop, | ||
| const double | eps ) |
Estimates the baseline using the Modified Polynomial (ModPoly) method.
| y | The input data points to be processed. |
| polyorder | The order of the polynomial to fit. |
| loop | The maximum number of iterations. |
| eps | The convergence tolerance. |
Definition at line 140 of file baseline.cpp.
References AllocSablibBaselineData(), _stSablibBaselineData::baseline, _stSablibBaselineData::corrected, _stSablibData::data, and _stSablibData::size.
| const SABLIB_BASELINE_DATA_PTR Sablib_BaselinePolynomial | ( | const SABLIB_DATA_PTR | y, |
| const unsigned int | polyorder, | ||
| const unsigned int * | indices_ptr, | ||
| const size_t | ptr_size ) |
Performs baseline estimation by fitting a polynomial to specified points.
| y | The input data for baseline estimation. |
| polyorder | The order of the polynomial to fit. |
| indices_ptr | The indices of the points used for polynomial fitting. |
| ptr_size | The number of indices. |
Definition at line 45 of file baseline.cpp.
References AllocSablibBaselineData(), _stSablibBaselineData::baseline, _stSablibBaselineData::corrected, _stSablibData::data, and _stSablibData::size.
| const SABLIB_BASELINE_DATA_PTR Sablib_BaselinePsalsa | ( | const SABLIB_DATA_PTR | y, |
| const double | lambda, | ||
| const double | p, | ||
| const double | k, | ||
| const unsigned int | s, | ||
| const unsigned int | loop, | ||
| const double | eps ) |
Performs baseline estimation using Peaked Signal’s Asymmetric Least Squares Algorithm (psalsa).
| y | The input data for baseline estimation. |
| lambda | Smoothing parameter. |
| p | Weight (asymmetry parameter, typically 0.001 to 0.1). |
| k | Exponential decay of the weights. |
| s | The order of the difference (usually s = 1, 2, or 3). |
| loop | Maximum number of iterations. |
| eps | Convergence threshold. |
Definition at line 305 of file baseline.cpp.
References AllocSablibBaselineData(), _stSablibBaselineData::baseline, _stSablibBaselineData::corrected, _stSablibData::data, and _stSablibData::size.
| const SABLIB_BASELINE_DATA_PTR Sablib_BaselineSMA | ( | const SABLIB_DATA_PTR | y, |
| const unsigned int | n, | ||
| const unsigned int | loop ) |
Performs background estimation using a simple moving average.
| y | The input data for baseline estimation. |
| n | Half-width of the moving average window (calculated using 2 * n + 1 points). |
| loop | Number of iterations. |
Definition at line 87 of file baseline.cpp.
References AllocSablibBaselineData(), _stSablibBaselineData::baseline, _stSablibBaselineData::corrected, _stSablibData::data, and _stSablibData::size.
| const SABLIB_BASELINE_DATA_PTR Sablib_BaselineSnip | ( | const SABLIB_DATA_PTR | y, |
| const unsigned int | m, | ||
| const bool | decreasing, | ||
| const enum Sablib_SnipPreprocess | preprocess, | ||
| const unsigned int | loop ) |
Performs baseline estimation using the Statistics-sensitive Non-linear Iterative Peak-clipping (SNIP) algorithm.
| y | The input data vector (signal to be processed). |
| m | The maximum half-window size (maximum clipping distance). |
| decreasing | If true, iterates from m down to 1 (recommended). If false, iterates from 1 up to m. |
| preprocess | The preprocessing transformation to apply before clipping. |
| loop | The number of times to repeat the entire SNIP process. |
Definition at line 106 of file baseline.cpp.
References AllocSablibBaselineData(), _stSablibBaselineData::baseline, _stSablibBaselineData::corrected, _stSablibData::data, LL, LLS, and _stSablibData::size.
| const SABLIB_BASELINE_DATA_PTR Sablib_BaselineSpline | ( | const SABLIB_DATA_PTR | y, |
| const unsigned int * | indices_ptr, | ||
| const size_t | ptr_size ) |
Performs baseline estimation using cubic spline interpolation.
| y | The input data for baseline estimation. |
| indices_ptr | The indices of the points to be used as knots for the cubic spline. |
| ptr_size | The number of indices. |
Definition at line 66 of file baseline.cpp.
References AllocSablibBaselineData(), _stSablibBaselineData::baseline, _stSablibBaselineData::corrected, _stSablibData::data, and _stSablibData::size.
| const SABLIB_DATA_PTR Sablib_BeadsExpandBoundaries | ( | const SABLIB_DATA_PTR | y, |
| const unsigned int | n ) |
Expands the signal boundaries by padding with a tapered sequence.
| y | The input data vector. |
| n | The number of elements to add at each end. |
Definition at line 357 of file baseline.cpp.
References AllocSablibData(), _stSablibData::data, and _stSablibData::size.
| const SABLIB_DATA_PTR Sablib_BeadsTrimBoundaries | ( | const SABLIB_DATA_PTR | y, |
| const unsigned int | n ) |
Trims the expanded signal boundaries.
| y | The input data vector (expanded signal). |
| n | The number of elements to trim from each end. |
Definition at line 373 of file baseline.cpp.
References AllocSablibData(), _stSablibData::data, and _stSablibData::size.