Package Exports
- ml-savitzky-golay
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ml-savitzky-golay) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
SavitzkyGolay
Savitzky–Golay filter in Javascript
This code is based in the article: Savitzky, A., & Golay, M. J. E. (1964). Smoothing and Differentiation of Data by Simplified Least Squares Procedures. Analytical Chemistry, 36(8), 1627–1639.
Installation
npm install ml-savitzky-golay
Methods
new SavitzkyGolay(data, dx)
Creates a new Savitzky-Golay filter based in the array of y
values(data
) and the difference between x
dots(dx
).
calc([options])
Applies the filter using the current options.
Options
- windSize: The amount of dots used to make the filtering evaluation, the default value is 5.
- deriv: The grade for the derivative, the default value is 1.
- pol: The grade of the polynomial function to use for calculation, the default value is 2.
Test
$ npm install
$ npm test