06-23-2014 05:07 PM
Hello,
I have one arry of RR secuence values (its peak to peak of ECG wave time is seconds). I knows the added value of arrays is the total time of sample data.
I would like to separate in diferent graphs the representation of each hour of logged data.
I need to get any way to get the index which the number of values added are => 3600s (1h).
So i can to know the index of arrays values to get the correct index to graph 1h of values, another index for another hour for another graph,.... so until get the several hourly graph the data can show.
I hope you understand me.
Best Regards.
Solved! Go to Solution.
06-23-2014 06:04 PM
In this example I can get the sum values of array and get the index of array when it is equal or higher than 3600s (1h).
But i need get the index of the next hour. So i need test the sum of values with 3600, 7200, 10800,.... until end of data logged.
Any help?.
Thanks.
06-23-2014 06:39 PM
Here is one way. This is not optimized but should work. The one disadvantage is that the output array contains zeros at the ends of the shorter rows. This is because arrays in LV must be rectangular - all rows must have the same length.
The first for loop generates some simulated RR interval data. The middle loop finds the index where the sum crosses 3600 and then resets the sum to zero for the next segment. The third loop splits the data array at the indexes found by the middle loop.
It is saved back to LV 2011.
Lynn
06-24-2014 01:02 AM
06-24-2014 05:10 AM
Hello John,
thank you, it works. I added the rest of data recorded to plot in the next hour graph.
Regards.
06-24-2014 05:15 AM
mikeporter escribió:
OK, simple. You have an array of intervals in seconds that you use to generate an array of running totals. Cast that array to integers, perform a modulo 3600 division. The output will be an array of remainders. Find all the elements containing 0, and you're done.
Mike...
Hi Mike,
Thank you for you input.
Can you elaborate more please, I dont understand when you say ' perfom to 3600 division'. Visual capture is easier to understand better.
Array to integers I suppose you say to use Type cast with type U16.
It is interesting to learn diferent point of views...
Regards.
06-25-2014 03:23 PM
Modulo division is performed by the Quotient & Remainder function on the Numeric palette.
It will work with DBL or integer data types and arrays.
When I use the method I think Mike intended, the VI sometimes misses an hourly transition. This happens with the simulated data I generate because it is possible for the remainder to be different from zero. For example this can happen if the accumulated sum is 3599.4 s and the next RR interval is 1.3 s. That gives the next sum = 3600.7 s. When converted to integers the sums are 3599 and 3601. The remainders are 3599 and 1 after the modulo division. Neither is exactly equal to zero.
I modified this to use DBL and then look for the large negative transition. The minimum value can be up to the largest RR interval in the data. However, there will always be a large transition from close to 3600 to close to zero.
Lynn
06-26-2014 12:45 PM - edited 06-26-2014 12:49 PM
Hello Lynn,
Thank you so much for your time and the explication. Perfect. I got it.
Best Regards, Fonsi.