Baseline correction using asymmetric least squares, accelerated with C++.
Asymmetric least squares method is a technique that can correct the baseline while adjusting the balance between the fit of the baseline to the spectrum and the smoothness of the baseline curve.
- Eigen (C++ template library for linear algebra)
- pybind11 (Seamless operability between C++11 and Python)
- NumPy (Fundamental package for scientific computing with Python)
In ALS, the baseline
where the weights
This prioritizes points where the spectrum falls below the baseline
The first term of
P.H.C. Eilers, Anal. Chem., 2004, 76, 404-411.
The algorithm for baseline calculation using ALS is as follows. First, initialize all the weights
until convergence.
where
For equation
is zero which occurs when:
and thus, the baseline