ml-rolling-ball-baseline
TypeScript icon, indicating that this package has built-in type declarations

2.0.3 • Public • Published

ml-rolling-ball-baseline

NPM version build status npm download

Rolling ball baseline correction. The algorithm was initially described in [1].

1. Kneen, M. A.; Annegarn, H. J. Algorithm for Fitting XRF, SEM and PIXE X-Ray Spectra Backgrounds. Nuclear Instruments and Methods in Physics Research Section B: Beam Interactions with Materials and Atoms 1996, 109–110, 209–213.

2. Liland KH, Almøy T, Mevik B (2010). “Optimal Choice of Baseline Correction for Multivariate Calibration of Spectra.” Applied Spectroscopy, 64, 1007-1016.

Installation

$ npm i ml-rolling-ball-baseline

Usage

import { rollingBall } from 'ml-rolling-ball-baseline';

// spectrum is an array
const spectrum=[1, 2, 1, ...];

// you need to provide and array with the data and
// two numbers indicating the "size" of the balls,
// i.e., the maximization/minimization and the smoothing window.
const baseline = rollingBall(spectrum, 200, 400);

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i ml-rolling-ball-baseline

Weekly Downloads

489

Version

2.0.3

License

MIT

Unpacked Size

20.2 kB

Total Files

21

Last publish

Collaborators

  • mljs-bot