ml-savitzky-golay-generalized
Advanced tools
Comparing version 1.0.3 to 1.1.0
{ | ||
"name": "ml-savitzky-golay-generalized", | ||
"version": "1.0.3", | ||
"version": "1.1.0", | ||
"description": "Savitzky–Golay filter in Javascript", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -8,3 +8,24 @@ # savitzky-golay-generalized | ||
I'll try an automatic parameter tunning based on the SNR or in the entropy of the signal. | ||
#Usage | ||
```js | ||
npm i ml-savitzky-golay-generalized | ||
const SG = var SG = require("ml-savitzky-golay-generalized"); | ||
SG(dataY, deltaX|X, options) | ||
``` | ||
##Parameters | ||
### dataY | ||
The data to be filtered. | ||
###deltaX | X | ||
deltaX specifies the difference between 2 consecutive points of the independent: deltaX = X[i+1] - X[i]. Specficiying a deltaX suppose that all your points are equally spaced on the independent variable. | ||
If your points are not equally spaced in the ordinate variable, then you have to provide explicitelly your X values. The algorithm will use the average deltaX within each bin of 'windowSize' points to approximate the derivatives. This fast approximation only works if the X is almost locally equally spaced. | ||
###options | ||
####windowSize: | ||
The odd number of points to approximate the regresion polynomial. Default 9 | ||
####derivative: | ||
The grade of the derivative. 0 by defualt(Smoothing) | ||
####polynomial: | ||
The order of the regresion polynomial. Default 3 | ||
## Examples | ||
@@ -11,0 +32,0 @@ |
@@ -6,5 +6,5 @@ //Code translate from Pascal source in http://pubs.acs.org/doi/pdf/10.1021/ac00205a007 | ||
var defaultOptions = { | ||
windowSize: 11, | ||
windowSize: 9, | ||
derivative: 0, | ||
polynomial: 2, | ||
polynomial: 3, | ||
}; | ||
@@ -11,0 +11,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12688
99