03-20-2013 08:32 PM
Hello all,
I am trying to take a derivative of a 1-D array of points of an object that I am tracking so I can get its velocity. Basically, I have a 1-D array of position coordinates (X,Y,Z) that are continuously being refreshed (or updated) every 100ms. I would like to turn this position data into velocity data. Is the solution to this problem as easy as using the LabVIEW derivative function?
Thank you!
Solved! Go to Solution.
03-20-2013 08:42 PM
Maybe.
I would certainly start there. Or maybe just use shift registers and subtract to get differences between X[i] and X[i-1].
Are you looking at dx, dy, and dz separately or do you want derivatives along some vector?
If your data is noisy, derivatives tend to enhance the noise. In that case the Savitsky-Golay smoothing and derivative algorithms may be advantageous.
Lynn
03-20-2013 09:03 PM
Thank you for your prompt reply! Right now I am trying to find dx, dy, and dz separately. I tried the derivative function and it is giving me a non-zero value when the object is stationary O_o. One thing I was thinking of is whether or not the derivative function automatically uses the previous position (iteration i-1) in its calculation. I assume it works like this: (x2-x1)/(t2-t1)?
03-21-2013 10:29 AM
Read the Detailed Help for the Derivative x(t).vi. It can do that calculation but the default method is 2nd Order Central which uses:
y[i] = (x[i+1] - x[i-1])/2dt
Lynn