Iterative regression-based baseline correction.
The algorithm is based on the document Baseline correction by improved iterative polynomial fitting with automatic threshold
$ npm i ml-baseline-correction-regression
import baselineCorrection from 'ml-baseline-correction-regression';
let time = [
/* ... */
];
let originalSignal = [
/* ... */
];
const { corrected, delta, iteration, baseline } = baselineCorrection(
time,
originalSignal,
);