07-10-2012 02:15 PM
Hi, I have a LV program that acquires simultaneous data. I have crank angle data from a shaft encoder and a voltage reading. To make things simpler lets say, for every 1 degree crank angle (CA), I have 1 voltage (V) reading - so that’s 360 data points per revolution. LV records data all the way from 0 to 359, then returns to 0 for the next revolution.
My data goes something like this:
CA V
0 2
1 3
2 5
3 5
... ...
359 10
0 3
1 2
2 4
... ...
359 12
0 1
1 4
... ...etc
Is there any way I can rearrange my data so that it gives me the revolution data side by side so that it can be average, so for the above it would be:
CA V (rev 1) V (rev 2) V (rev 3) V (average)
0 2 3 1 2
1 3 2 4 3
2 5 4 ...
3 5
... ... ...
359 10 12 ... etc
If it cannot be average in labview – that is not too much of an issue since I could easily just do it in excel too. But, I need the data side by side at least. The crank angle interval does not change per revolution.
Many thanks in advance.
Notay
07-10-2012 02:53 PM
I would use index Array to get the 2nd column of the array, then reshape array to convert that to a 2-D array of 360 rows by however many Revolutions. Then use Build array to put it with the first 360 elements of the 1st column of the array.
07-10-2012 03:09 PM
Hi,
I'm reading into your post that your data is saved in a text file.
You could store it in an array, changing the column index every 360th point. Then you can average it and put that value in the final column. The first column would be the degree value.
Also, you can use the size of the array function to get the number of columns, subtract one for the degree column, and use that size to compute the average.