cancel
Showing results for 
Search instead for 
Did you mean: 

Interpolation

TUDS
Member

Interpolation

Message contains an attachment
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?
13 REPLIES 13
Ben
Knight of NI Knight of NI
Knight of NI

Re: Interpolation

Message contains an attachment
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
rpursley8
Active Participant

Re: Interpolation

Message contains an attachment
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
altenbach
Knight of NI

Re: Interpolation

Message contains an attachment
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?
rpursley8
Active Participant

Re: Interpolation

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
Dr._Imad
Active Participant

Re: Interpolation

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
Mads
Active Participant

Re: Interpolation

Message contains an attachment
Attached is a 2D interpolation and extrapolation function I made to do a 2D lookup, perhaps you can use it as well.
rohrdt
Member

Re: Interpolation

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
chilly_charly
Trusted Enthusiast

Re: Interpolation

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)
rohrdt
Member

Re: Interpolation

CC,
Thanks for the response. Is there any chance that you could save it in LV 7.0 ???
Thanks alot
rohrdt