LOL. Exactly how are you going to get a velocity plot and an acceleration plot by running the filter once (without recoding it so that multiple derivative orders are output) ?![]()
What part of not coding specifically to force the behaviour didn't compute ?Let N be the degree of the best-fit polynomial, and let W be the number of points in each window.
Code:for each window: for i = 1 to N: compute derivative i
What language is that ? Appears at first glance to be psuedo-code.
You're making it up as you go along again. I make no such assertion.With modern computers, and time series as short as the ones we've been discussing in this subforum, it's beyond silly for femr2 to worry about the speed of the Savitzky-Golay algorithm.
Easily done. Run the Savitzky-Golay algorithm over the displacement data, generating both velocity and acceleration data in that one pass (as described above).
Ye gads man. Talk about pedantic.Incorrect.femr2 said:derivative order cannot exceed polynomial order
Polynomial functions are C∞ (smooth, infinitely differentiable).
Whilst you're correct in mathematical purity, you'll find that most implementations enforce the limit, as you would expect...unless you WANT a whole bag of zero
Again, see aboveIncorrect.Of course taking the second derivative also forces you to use a poly order of at least 2.
"aren't very interesting" ?! LOL. Care to elaborate, or say zero ?(The second derivatives of linear and constant-valued functions aren't very interesting, but they do exist.)
