10-12-2019 06:41 AM
Hi,
I have a numeric data channel that can be anything up to the max channel length. I need to extract the data value at say every 1000th row and add it as a new row in a seperate channel. Currently I do this by using a for loop and specifiying the interval (1000 in this case) and just copy the value at that row number to the new channel, the interval value is increased by 1000 each time. However this can be very slow when doing for small intervals or repeating it many times for different start values. This is a single channel without an associated time channel.
Is there a built in function that I can call that does this and thus benefit from a faster internal loop process
Best Regards
Keith
10-13-2019 10:30 AM
Below is a link showing a complete example from my website of how to re-sample a numeric channel from 17.24 samples/sec to 1/10th that or 1.72 samples/sec, saving the result to a new channel in a new channel group. It uses the DIAdem command ChnResampleFreqBased(). You can also do the re-sampling manually from the DIAdem analysis panel.
http://www.savvydiademsolutions.com/analysis.php?topic=analysis-resample-channel
Another approach would be to read every 1000th value from the data file with the DataFileLoadRed() command, using the "IntervalWidth" option.