4
$\begingroup$

I have the following curve, which is calculated on a large number of points and shows smooth behaviour when viewed from distance.

enter image description here

However, the derivative (shown below) exhibits artificial oscillations which are inevitable due to complications in my method of numerical calculation. I know about the correct result and its derivative (shown below in red), and want to eliminate these sharp peaks and fluctuations with a post-processing (filtering) step.

enter image description here

What is a reasonable filtering process to eliminate the fluctuations in derivative and get the correct result (the red curve)? How can I decide on the details of such filter?

$\endgroup$
  • 8
    $\begingroup$ You should eliminate the numerical oscillations rather than making them "disappear" in post-processing. In general, oscillations are not good in numerical and may reveal that your numerical scheme is not stable. Speaking of which, your oscillations on your derivative seem to increase in amplitude from left to right, there is no certitude that your simulation will converge in another case. $\endgroup$ – Coriolis Aug 9 '16 at 11:45
1
$\begingroup$

You can use some scheme where value at a point is some type of average of its neighboring values. You will have to decide whether this kind of smoothing is appropriate in your case or not. In MATLAB, smooth3 function is used to smooth data in 3D. Using same principle, you can perform Gaussian smoothing or box smoothing in 1D. This is how smoothing is done. Reliability of smoothed results is what you will have to judge.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.