LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2D spline interpolation

Hello All
I have only 1D spline interpolation in my LV.
Is there 2D spline interpolation somewhere?

thanks in advance
Pawel
0 Kudos
Message 1 of 6
(5,842 Views)
Try the attached VIs. Use them the same way as the 1D counterparts.
(I hope they work correctly. I wrote them long time ago, forgot exactly why
I did it the way I did it...)

-Franz


"pawel" schrieb im Newsbeitrag
news:50650000000800000059970000-1042324653000@exchange.ni.com...
> Hello All
> I have only 1D spline interpolation in my LV.
> Is there 2D spline interpolation somewhere?
>
> thanks in advance
> Pawel



[Attachment 2D_spline.llb, see below]
0 Kudos
Message 2 of 6
(5,841 Views)
I ran across an NI DevLib Example which shows an example of how to use 1D Spline in two dimensions:
  2D Array Interpolation
  (related download - 2D_interpolation_demo.zip )

In order to better understand what it does, I added many comments to that example, and then extended it.

Their example produces a uniformly-spaced output array, and I wanted to interpolate at an arbitrarily located point.  Also, I figured out how to allow one of the independent variables, [[Xc]], to be specified as a (unevenly sampled / jittery) 2D-matrix instead of as a 1D-vector.  I haven't yet figured out how to generalize the second independent variable [Xr] into a (jittery) matrix too.  I'll probably have to use an approach similar to bilinearDEMO but suggestions would be welcomed!  I have LabVIEW 7.0, so I can't try the new surface-fitting stuff in 8.0.

Note my commented version of NI's "2Dinterpolation.vi" is included as a subVI to the attached demo.  I hope this is helpful.  CHEERS!
Message 3 of 6
(5,562 Views)
(fixed a small bug, and added a few more comments)
0 Kudos
Message 4 of 6
(5,550 Views)
Same example extended one more time, now [[Xr]] is also a 2D matrix w/ "jitter".
(This produces identical results as yesterday's simpler "2D_interpolation_demo(modified-DAK_060629(b)).zip" when Xr_jitter is set to zero.)

Note that non-zero jitter on [[Xc]] does not yield noisy "y3" results, but jitter on [[Xr]] does.  (Even compared spline, rational, and polynomial interpolations in this demo.)  Anyone know how to produce better results?

This example code is "public domain", so please share your improvements!  -citizenDAK

Message Edited by citizenDAK on 06-30-2006 11:18 AM

0 Kudos
Message 5 of 6
(5,541 Views)
 
 

FYI everyone, LabVIEW 8.0 introduced built-in 2D interpolation along with LOADS of other mathematical goodies. It's got 2D bicubic, bicubic spline, bilinear, and nearest interpolation methods. We have Hermite, polynomial, rational, Fourier Interpolation. Did I mention improved Optimization, LevMar and more? The list goes on and on... This is miles beyond our earlier offerings and might be worth a look!

 

Message Edited by Jarrod S. on 06-30-2006 12:53 PM

Jarrod S.
National Instruments
Message 6 of 6
(5,526 Views)