Showing results for 
Search instead for 
Did you mean: 

Finding an objects velocity using a 1-D position array

Go to solution

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!

0 Kudos
Message 1 of 4
Accepted by topic author djj790



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.



Message 2 of 4

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)?

0 Kudos
Message 3 of 4

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



0 Kudos
Message 4 of 4