LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Interpolate 2D array

Dear all,
I have a 2D array (MAP) Which holds the value of temperature1 in one axis and temperature2 on the other axis with values in the array are the actuator output level. The array has given in low resolution and so i need to interpolate from two coordinates.
For example, Let us take a 3 x 5 array
        0        1       2       3       4
0     10     20     30     40     30
1     50     60     30     50     20
2     10     15     40     20     25
 
 
the rows shown in green color are indicating temperature1 values and the columns shown in Orange are indicating temperature2. The resultant array combinations are the values that is used to control the outputs.
 
If i have temperature1 value as 3.5 and temperature2 value as 1.5, thwen i need to interpolate the array.
 
Can any one help me how to interpolate the 2D array? Is there any VI for doing this?
Can the index array help me to do this. Please advice!
0 Kudos
Message 1 of 4
(9,725 Views)
Hi,

the question is how you want to interpolate your array. There are different approaches doing an interpolation, taking into account only the nearest neighbor-points or taking into account also several other points to come to a better interpolation.

If you only want to take into account the nearest neighbor, you can do a linear interpolation: Let us assume your temperatures are T1=0.5 and T2=1.5. Use "Round to +infinity" and "Round to -infinity" from the numerics-palette and you get 0 and 1 for T1. Now interpolate the row of T1=0 and T1=1 for T2=1.5. You can use "Threshold 1D Array" to get the fractional index of x, that means if you have T2=1.5 and you have a T2-axis like the one shown in orange, you will get 1.5 for x meaning that your value is in the middle between array-element 1 and array element 2. Now do an interpolation for row 0 and row 1 with "Interpolate 1D-Array" using this fractional index. You will get 25 for row 0 (between 20 and 30) and 45 for row 1 (between 40 and 30). Now do an interpolation between these two values using T1=0.5: You will get 35, as T1=0.5.

Hope this helps

Christian

THINK G!! 😉
------------------------------------------------------------------------------------------------
Using LabView 2010 and 2011 on Mac and Win
Programming in Microsoft Visual C++ (Win), XCode (Mac)
0 Kudos
Message 2 of 4
(9,715 Views)
Newer version of LabVIEW have all kinds of 2D interpolations (bilinear, bicubic, etc).
 
If you want to write your own, you could do something like I did long ago on the following old thread.
 
 
 
Message 3 of 4
(9,701 Views)
Thanks a lot friends. I have done the design as per your Guidance. Is Working For me!!!
0 Kudos
Message 4 of 4
(9,659 Views)