Showing results for 
Search instead for 
Did you mean: 

Savitzky golay filter for finding second derivative

Hello friends,

 I want to find second derivative using Savitzky golay filter for the data as shown in image.

Three different spacings are used.



  • Region AB and EF= ∆f1
  • Region  BC and DE=∆f2
  • Region  CD=∆f3

Can some one help me to understand to to decide side points and polynomial order for my input data.?


Thanks in advance.


0 Kudos
Message 1 of 5

The polynomial order must be at least one larger than the highest derivative. So a third order polynomial is required for a second deriviative. In general it is better to keep the polynomial order as low as possible while getting a good fit to the data.


The number of side points is somewhat arbitrary and depends on how much smoothing is needed. Often some experimentation and judgement is required.


Have you considered resampling the data to create a new dataset with uniform sampling throughout? That might be easier than trying to match derivatives at the transition points.There are several resampling VIs available.


How many data points do you have in each segment?



0 Kudos
Message 2 of 5

Thank you very much Lynn.


Total no of data points are not fixed ,varying always.

Its in range of 520-570.

Eg When Toatal point= 517


  • Region AB=83
  • Region EF= 98
  • Region  BC=68
  • Region DE=67
  • Region CD=201


0 Kudos
Message 3 of 5

With the data sets that small I think I would try resamplng first.



0 Kudos
Message 4 of 5

Hi Lynn,

I did resampling and applied Savitzky golay coefficients. And plotted same graph as in previous image.

I found peaks for prevoius image for both with and without Savitzky golay filter coefficients.

After comparision i found 1% (50-60Hz)change in frequency which is not affordable in my application.

So , now finding derivative without Savitzky golay filter coefficients.

 Thank you for your support.

0 Kudos
Message 5 of 5