LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

differention

I have a data acquisition of position sensor. When in LABIEW, this data is in number form. I wish to take the derivative with respect to time of the position. How to you take the slope of two adjacent points. I know the time step but I dont know how to subtract two adjacent points to get the slope
0 Kudos
Message 1 of 13
(4,193 Views)
pass the data array to a while loop
the use the index array function
DY=Data_index(i+1)-Data_index(i)

divide Dy by the time step

there has been a recent thread on differentiation
have a look at this thread
http://forums.ni.com/ni/board/message?board.id=170&message.id=109985
0 Kudos
Message 2 of 13
(4,177 Views)
I tried that but when I tested it for an sine input i just got back a sine waveform of different amplitude. I'm not sure if I am using the index array functions or the while loop correctly. Distinguishing between the index (i) and index (i+1) i used the shifting (?) property of the while loop to get the previous value for (i).
0 Kudos
Message 3 of 13
(4,161 Views)
Sure, the derivitive of a sine wave, is also sine wave (actually a cosine). so you would still get a sinosoid, but with a phase diffrenece of 90 degrees
0 Kudos
Message 4 of 13
(4,157 Views)
I know I should get a sinusoid but I'm getting a phase shift of 180 degrees
0 Kudos
Message 5 of 13
(4,156 Views)
Hi Mike

Try the Savitzky Golay filter available from my website.

www.sciware.com.au

It allows you to smooth and differentiate your data.

Regards

Kurt
Kurt Friday
www.sciware.com.au
0 Kudos
Message 6 of 13
(4,138 Views)
 
0 Kudos
Message 7 of 13
(4,126 Views)
Attached is a vi that does differentiation. Hopeit helps
0 Kudos
Message 8 of 13
(4,124 Views)
I have LabView 6i so i cannot view this vi.
0 Kudos
Message 9 of 13
(4,106 Views)
For the Savitzky Golay filter, the x and y values are arrays and my input values are numbers. How do I modify the Savitzky Golay filter for my system?
0 Kudos
Message 10 of 13
(3,940 Views)