I’m using a fiber optic displacement sensor to monitor the motion of a bead pack as it’s being vertically shaken. The shaker shakes the beads vertically with a sin wave of a given amplitude and frequency. I am trying to take the displacement data I get from this and take two derivatives so that I can compare the acceleration from the data with the acceleration picked up by the accelerometer.
I was able to successfully import my data and plot the position vs. time function correctly but when I try to plot its derivative the graph is unbelievable noisy for the first derivative and much worse for the second. Is there any way I can fix this?
Fit a sine wave to the raw data, that looks past some of the noise in the data, take the second derivative of the sine wave and see if that is a credible estimate?
Perhaps you would like to use discrete derivatives given by Differences function to operate directly on data, not their fits, and then fit those by smooth curves? Also, is it possible to post data somewhere, here if it is reasonable size, or as a download at a DropBox site or similar?
You should definitely repeat all this, perhaps with fewer cycles and more noise and more parameters to see if you are confident you have captured the idea.
Then try it on your real data and see if the fit has looked past the noise in your data and done a good job at estimating the actual positions.
Then take a look at the second derivative and see if it is reasonable.
One thing to try wold be to change this to a slighly higher fit order and see if your issue still occurs
InterpolationOrder -> 4
In effect this supplies a bit of somoothing by interpolationg with a higher order polynomial. When you use InterpolationOrder → 3 the second derivative is in effect a linear fit to the data’s derivative which may well be quite choppy