mljs / savitzky-golay

Savitzky–Golay filter
https://mljs.github.io/savitzky-golay/modules.html
MIT License
34 stars 1 forks source link

Try to merge with the generalised algorithm #20

Closed andcastillo closed 7 years ago

andcastillo commented 8 years ago

I have an alternative implementation of this same algorithm, (https://github.com/mljs/savitzky-golay-generalized) and we should merge. I implemented some features that allows to use in a more general way than the current one. I list the features:

  1. It gives the same number of points as the input function without "padding" options. It uses the general definition of the Savitzky-Golay to deal with the border points.
  2. It accepts non equally spaced x vectors. Although this is just an approximation to the real solution, the algorithm speed is not affected that much, by considering the local changes of X within the windowSize as a constant. It is demonstrated that induced error is smaller than the error induced by the noise in the Y dimention. In cases of big changes in delta x, the approximation push down the derivatives to 0. Which is very casually correct. @mljs/collaborators
maasencioh commented 7 years ago

This was decided to keep splited