LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Interpolation

Hi

I am trying to interpolate a 2d array with interpolate 1d array. But I get a constant value?
Can you please tell me what is wrong?
0 Kudos
Message 1 of 14
(5,362 Views)
Hi TUDS,

I have to admit that I have never seen a 2-d array wired to a "Interpolate 1-d array" before. Just never thought about trying it!

It sorta looks like you are trying to re-sample your data.

This can be accomplished by combining the "Threshold 1-d array" with the above function.

This is illustrated in the attached jpg.

You will note that have used a copy of your default data as the source and kept your X and Y arrays seperate.

I hope this helps,

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 14
(5,351 Views)
If I follow your program correctly, you are taking the data and resampling it. Take your first column and find a fractional index for the lambda value. Then you use that fractional index to find the interpolated value in the second column. Attached is the code. Hopefully I interpreted it correctly.
Randall Pursley
0 Kudos
Message 3 of 14
(5,347 Views)
Interpolate array should not allow a 2D array input, this looks like a bug.

There are two allowed possible inputs: (1) 1D array, (2) An array of xy pairs(cluster). Check the online help for details.
Method (2) seems a more natural choice for your problem.

The attached VI shows both methods using your data (Converted to LabVIEW 7.0). The results of the two methods are withing 1E-5, but they are NOT exactly equal. I have not investigated in detail what needs to be tweaked to make them identical. Anyone?
Message 4 of 14
(5,300 Views)
They are much closer to indentical (by 9 orders of magnitude) if you make the original data double precision instead of single precision as it is in your vi.
Randall Pursley
0 Kudos
Message 5 of 14
(5,292 Views)
Just a note,

I usually prefer the curve fitting functions, they are better and can be used with different interpolation schemes.
By the way, the interpolate 1 D array does not extrapolate
Message 6 of 14
(5,281 Views)
Attached is a 2D interpolation and extrapolation function I made to do a 2D lookup, perhaps you can use it as well.
Message 7 of 14
(5,274 Views)
Mads,
I have a different interpolation/extrapolation problem.
I am trying to create a 3D surface plot, but the data that I have is not evenly spaced.
If you think of a rectangle, the data that I have is all around the border, on the diagonals and on the lines connecting the midpoints of each of the sides. This leaves large gaps in the rectangle with no data.
Do you know of a good algorithm to use to fill in those gaps with interpolated data?

rohrdt
0 Kudos
Message 8 of 14
(5,153 Views)
May be you could try the tripolation.vi written by Koji Ohashi. see here :
forums.ni.com/ni/board/message?board. id=170&message.id=99851

CC
Chilly Charly    (aka CC)
Message 9 of 14
(5,124 Views)
CC,
Thanks for the response. Is there any chance that you could save it in LV 7.0 ???
Thanks alot
rohrdt
0 Kudos
Message 10 of 14
(5,109 Views)