LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can I expand an array by interpolating between adjacent elements in the array?

Hi
 
I would like to expand my array by interpolating between adjacent elements (this is for a data smoothing application of a 2d data set)
 
I have split my 2-d array into two 1-d arrays.  With one of the 1-d arrays I would like to interpolate between adjacent elements to expand it.
 
e.g. for the array 1.0, 2.0, 3.0, 4.0, 5.0
 
I might want  to expand to: 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0.
 
alternatively does anybody know of a smoothing VI for 2-d data?
 
Many thanks
 
Ash
 
 
0 Kudos
Message 1 of 3
(3,030 Views)
Hi Ash

I attached a small example (it uses the Interpolate 1D Array VI). Be careful, the attached VI is inefficient if the input array is long. In this case it might be better to create an array with the final length (input size*2 -1), wire it to the shift register and replace elements inside the loop instead of inserting into the input array.
For 2D-arrays, just put another for loop with auto-indexing around the code.

Daniel

Message 2 of 3
(3,020 Views)

Hi Dan

Many thanks

Worked a treat on my data!

Ash

0 Kudos
Message 3 of 3
(3,004 Views)