I had some code computing the second difference of a sampled signal as
(x(n-1)-2x(n)+x(n+1))/(square of interval)
I only needed a crude estimate of the second derivative in this case.
Then I came across "five point stencils"
By this method, the second difference is
(-x(n-2)+16x(n-1)-30n(n)+16x(n+1)-x(n+2))/12/(square of interval)
And then 5-sample Savitsky-Golay formula, which seems rather different
(2x(n-2)-x(n-1)+2x(n)-x(n+1)+2x(n+2))/7/(square of interval)
Are either of these "better" in any sense?

Posted by Greg Berchin●April 25, 20192019-04-25

On Thursday, April 25, 2019 at 3:13:58 AM UTC-5, conr...@gmail.com wrote:

> I only needed a crude estimate of the second derivative in this case.

100% of our work is cutting-edge DSP
We are a small, high tech, sonar-processing company that develops state-of-the-art sonar, signal processing software systems used in naval aircraft.
Tasks:
* 60-75% signal processing algorithm development
* 25% real time code development in C++ Full relocation will be provided for the right candidate (e.g. relocation package up to $20,000).