LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How works Threshold 1D Array VI?

 

Hello!

 

 

I've read the help. And understand almost everything.

 

In this part:

 

The fractional index or x is 1, corresponding to the index of the first value of 5 the function finds. Suppose the array elements are 2.3, 5.2, 7.8, 7.9, 10.0, the start index is 0, and the threshold y is 6.5. The output is 1.5 because 6.5 is halfway between 5.2 (index 1) and 7.8 (index 2). If threshold y is 7 for the same set of numbers, the output is 1.69. If threshold y is 14.2, start index is 5, and the values in the array starting at index 5 are 9.1, 10.3, 12.9, and 15.5, threshold y falls between elements 7 and 8 because 14.2 is midway between 12.9 and 15.5. The value for fractional index or x is 7.5, that is, halfway between 7 and 8.

 

 I understand how to get value "1,5" and "7,5". But could anyone explain me how is value "1.69" obtained??

 

 

0 Kudos
Message 1 of 4
(2,851 Views)

linear interpolation.  The line segment defined by points (index1) and (index2) gives you a slope of 2.6Y/X.  7 is 1.8Y greater than point 2. 

(1.8Y/X) / 2.6Y + 1(start index) = 1.692X and change. 


"Should be" isn't "Is" -Jay
Message 2 of 4
(2,847 Views)

Hi aciduser,

 

1.69 = 1+ 0.69 = 1 + (7-5.2)/(7.8-5.2)

 

y threshold is 7 and falls between 5.2 and 7.8, hence the 1. The fractional part describes the distance to 5.2 compared to the distance between 5.2 and 7.8. Any questions?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 4
(2,846 Views)
Thanks for clear explaination! 🙂
0 Kudos
Message 4 of 4
(2,831 Views)