LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Threshold 1D array descending ascending with negative floating point numbers

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

0 Kudos
Message 1 of 5
(3,568 Views)

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.

Omar
Message 2 of 5
(3,556 Views)

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.

Message 3 of 5
(3,544 Views)

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

0 Kudos
Message 4 of 5
(3,526 Views)

 


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)

 

 

 

0 Kudos
Message 5 of 5
(3,516 Views)