12-08-2010 07:30 AM
I'm having an issue trying to detect multiple breeches of a threshold.
I was thinking I could use the threshold 1D array.vi and then get the remaining subset after the breeche and continue in this manner.
Strangley I only got one result and the next subset would not should a threshold even though the following was true:
1st pt <threshold < 2nd pt
It seems that if the data descends first through the threshold and then ascends back through the threshold it doesn't register as having breeched the threshold, see attached VI.
Does anyone know what I'm doing wrong?
Thanks,
Sean
12-08-2010 09:10 AM - edited 12-08-2010 09:11 AM
From the LabVIEW help
Note Use this function only with arrays sorted in non-descending order. |
This function does not recognize the index of a negative slope crossing, and it might return incorrect data if threshold y is less than the value at start index. Use the Threshold Detector VI for more advanced analysis of arrays.
12-08-2010 10:50 AM - edited 12-08-2010 10:52 AM
Here is a better link to the threshold_peak_detector ...
It's not quite the same because it returns only integers while "threshold array" returns interpolated fractional indices.
12-09-2010 03:45 AM
Thanks Omar/ Altenbach.
I looked through the peak detector and as Altenback states it returns an integer which is not acceptable to me as it would introduce a large positional error.
I was thinking a possible solution would be to index based on the returned index and multiple the sub array by -1 once a peak is found.
This should work although I'm running out of time. It's surprising NI haven't already developed a VI that will do this.
Thanks for your help.
Sean
12-09-2010 11:23 AM
SeanJ wrote:I was thinking a possible solution would be to index based on the returned index and multiple the sub array by -1 once a peak is found.
Maybe something like this? (read the entire thread for limitations)