![]() |
sablib
|
The C interface of sablib baseline estimation functions. More...
Go to the source code of this file.
Enumerations | |
| enum | Sablib_BackcorFunc { Huber = 0 , AHuber , TQuad , ATQuad , Indec , AIndec } |
| Cost function types for the Backcor algorithm. More... | |
| enum | Sablib_SnipPreprocess { None = 0 , LL , LLS } |
| Preprocessing types for the SNIP algorithm. More... | |
| enum | Sablib_BeadsPenalty { L1_v1 = 0 , L1_v2 } |
| Penalty types for the BEADS algorithm. More... | |
Functions | |
| SABLIB_EXPORT 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. | |
| SABLIB_EXPORT 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. | |
| SABLIB_EXPORT 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. | |
| SABLIB_EXPORT 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. | |
| SABLIB_EXPORT 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. | |
| SABLIB_EXPORT 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. | |
| SABLIB_EXPORT 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. | |
| SABLIB_EXPORT 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). | |
| SABLIB_EXPORT 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. | |
| SABLIB_EXPORT 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). | |
| SABLIB_EXPORT 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). | |
| SABLIB_EXPORT 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). | |
| SABLIB_EXPORT 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). | |
| SABLIB_EXPORT 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). | |
| SABLIB_EXPORT 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. | |
| SABLIB_EXPORT 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.
Definition in file baseline.h.
| enum Sablib_BackcorFunc |
Cost function types for the Backcor algorithm.
Definition at line 23 of file baseline.h.
| enum Sablib_BeadsPenalty |
Penalty types for the BEADS algorithm.
| Enumerator | |
|---|---|
| L1_v1 | Penalty type 1. |
| L1_v2 | Penalty type 2. |
Definition at line 46 of file baseline.h.
Preprocessing types for the SNIP algorithm.
| Enumerator | |
|---|---|
| None | No preprocessing (linear scale). |
| LL | Log-log transformation. |
| LLS | Log-log-sqrt transformation. |
Definition at line 36 of file baseline.h.
| SABLIB_EXPORT 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.
| SABLIB_EXPORT 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.
| SABLIB_EXPORT 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.
| SABLIB_EXPORT 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.
| SABLIB_EXPORT 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.
| SABLIB_EXPORT 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.
| SABLIB_EXPORT 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.
| SABLIB_EXPORT 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.
| SABLIB_EXPORT 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.
| SABLIB_EXPORT 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.
| SABLIB_EXPORT 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.
| SABLIB_EXPORT 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.
| SABLIB_EXPORT 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.
| SABLIB_EXPORT 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.
| SABLIB_EXPORT 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.
| SABLIB_EXPORT 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.