LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2D Array Seach and Interpolation/Extrapolation

Hi there,
I have a rather large 2D array that I need to search, interpolate/extrapolate at the same time. I have an excel spreadsheet function that performs this task, but I was wondering if it is possible to implement this in Labview? Help would be greatly appreciated.
Paul
0 Kudos
Message 1 of 7
(5,377 Views)
LabVIEW 8 incorporates many types of 2D interpolations (bilinear, bicubic, bicubic spline, etc.)
 
You can also make your own. Have a look at my bilinear interpolation example in the following old post (http://forums.ni.com/ni/board/message?board.id=170&message.id=149338#M149338 You also need to download the even older subVI from the link in the post above it)
 
Just modify it for your needs. 😄
 
 

Message Edited by altenbach on 02-09-2006 09:35 AM

Message 2 of 7
(5,372 Views)
Altenbach,
with a bit of manipulation, that will work a treat!Smiley Very Happy
Thanks so much for the help.
0 Kudos
Message 3 of 7
(5,359 Views)

Hi,

 

I was searching for 2D interpolation and extrapolation and found this thread among others. Interpolation is fine, but for 2D extrapolation, the linear and cubic method gives NaN. Is there a function am unaware of that can take care of 'extrapolating' using some kind of data-fit, and let me have those values that lie outside the initial input data-set.

 

Thanks.

 

 

0 Kudos
Message 4 of 7
(4,446 Views)

@nskatlv wrote:

 Is there a function am unaware of that can take care of 'extrapolating' using some kind of data-fit, and let me have those values that lie outside the initial input data-set.


The keyword is "fit" here. Do you have a mathematical model for your surface as a function of X and Y? Once you have a fit for the visible portion, you can calculate the model outside the xy range of the original data.

 

There are plently of 2D fit examples posted here. Can you be a bit more specific about the kind of data you have? If it is relatively featureless, a 2D polynomial surface might be sufficient.

 

(Of course I recommend you start your own new thread for this new discussion!)

0 Kudos
Message 5 of 7
(4,442 Views)

Thanks for the reply altenbach.

 

I guess if I have a function for the data, I won't need inter/extrapolation at all. I can just plot it as such.

 

I was thinking that the inter/extrapolation functions might take care of this fitting business outside the input [x,y] domain. They don't.

 

But your suggestion of fitting it first is worthwhile, and once I fit the data, I guess I won't be needing the interpolation function anymore. I can just generate input vectors (in a grid), calculate the z and plot it.

 

Let me try fitting myself and will start a new thread if I fail.

 

Thanks & Regards.

 

 

0 Kudos
Message 6 of 7
(4,432 Views)

The problem with extrapolating is that the results are unconstrained - unless you impose some expectations, which is what is part of the fitting process.  A low-order polynomial fit will tend to maintain derivatives at the boundaries of the input region, but even a cubic can easily diverge very quickly from the input data.

 

There are ways to inter/extrapolate without fitting though.  One method I use is a Kriging interpolation, which is also reasonably well-behaved outside the input data, and works for an irregular spacing of input data points.  There are a lot of possibilities for imposing constraints on the mapping (have a search for Kriging and variograms), but the most simple approach is to just use weightings of the distance to the input data, which tends towards the average of the input values as the distance gets large.  I've posted about it before: http://forums.ni.com/t5/LabVIEW/2D-array-or-3D-array-interpolation-need-help/m-p/1681014#M598046  In recent versions of LabVIEW (2011+ I think), the Interpolate 2D Scattered function using the Greens method uses pretty much the same approach, though I think has problems with two data points at the same location (i.e. distance=0 between them).

 

Kriging Interpolation Simple_BD.png

 

 

Message 7 of 7
(4,417 Views)