How can one improve the derivative? [message #86662] |
Wed, 27 November 2013 04:25  |
g.nacarts
Messages: 148 Registered: November 2013
|
Senior Member |
|
|
Hi
I had to differentiate noisy data - which is a problem. I was wondering, how can one improve the derivative?
I read on a blog that one way is to make a Fourier filtering afterwards and another way is to apply a "smoothed" or "filtered" gradient. But I had no idea how to do this in IDL. Can anyone help?
Thanks in advance
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: How can one improve the derivative? [message #86701 is a reply to message #86684] |
Thu, 28 November 2013 08:53  |
lecacheux.alain
Messages: 325 Registered: January 2008
|
Senior Member |
|
|
Le jeudi 28 novembre 2013 14:27:41 UTC+1, g.na...@gmail.com a écrit :
> This is what I did, I was playing with different values for nL and nR. But I was wondering if there is any specific rule. Also, when I used order=1 to give me the first order derivative filter the answer was not converges at all.
>
> At order 0, the Savitzky-Golay filter seems to make the things better but not much.
SG filtering assumes that your function can be locally fitted by a low order polynomial (of order 2 to 4, at most nL+nR). The (LS) fit is done for each point of the function. The output of the filter is the constant term of the best polynomial fit. This is similar to a moving average, except that the latter uses a constant (a polynomial of degree 0). Derivative is obtained in the same way, but the constant term of the corresponding derived polynomial is used in that case.
Everything will depend on the shape of your function. Derivatives noisier than
the function is a normal result: differenciating increases noise while integrating is a smoothing process.
alx.
|
|
|