LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simple Interpolation

Hi guys,
 
I need to make a simple interpolation, but i´m really desperated, because nothing works...
I have something about of 10 columns and every column has exactly 50 values and i want to push them up to 100 (because to get curve over 100%)...
You know what i mean?!
 
Thanx for help, Tom
0 Kudos
Message 1 of 9
(4,977 Views)

Here's a quick example of a simple interpolation, which just takes the value of one index and averages it with the next one up (although, this'll give 99 values total rather than 100).

Hope this helps!



Message Edited by corys on 06-05-2008 09:09 AM
-Cory
0 Kudos
Message 2 of 9
(4,972 Views)

Thanx for first, but i was more thinking of a possibility of a spline interpolation or something!

It´s more about of making 100 values of a signal made by a frequenzy of 50hz...you know?!

0 Kudos
Message 3 of 9
(4,961 Views)
Yeah, I thought that would be a bit too simple, but it was worth a shot Smiley Tongue
 
To my recollection, there are many ways to go about doing a spline interpolation (mine would be akin to a linear spline interpolation, no?), but maybe my memory is not doing me any favors.  Maybe if you could expand on that a bit?
 
Are you trying to obtain 100 values rather than 50 while acquiring your signal, or taking 50 obtained values and expanding them to 100?  If expanding from 50 obtained values, what kind of signal are you expecting (or namely, what type of interpolation would be more appropriate?)
 
Tryin' to get a better idea of what you're needing, to try and help.
-Cory
0 Kudos
Message 4 of 9
(4,952 Views)
The technique you are alluding to is upsampling. As noted in that Wikipedia page, this involves inserting zeros and then passing the signal through a low-pass filter. LabVIEW has an Upsample VI that inserts the zeros and has several filter VIs. There's also an Express VI called "Align and Resample" that you may be able to use. The method to use depends on the characteristics of your signal.
0 Kudos
Message 5 of 9
(4,948 Views)
There are already 50 obtained values, i want to push them up to 100!!
Everything is about...: it is about a running analysis and i got 50 values of foot pressure system and i want to show it over 100% of one step, so i need to interpolate every step to 100 values!! You maybe now know better what i mean?!?!
 
Thanx
0 Kudos
Message 6 of 9
(4,945 Views)
I do not really know how to use them correctly, but what about these interpolate vi´s?! 1D Interpolation, 2D Interpolation, 1D Spline Interpolation and so on!!
0 Kudos
Message 7 of 9
(4,935 Views)
Those VIs are pretty simple to use and very powerful. The Interpolate 1D VI can do many different types of interpolation, including linear and spline. It should definitely fit your needs.

There are two ways to indicate to this VI how you want to resample your data. You can input an array of X Values that correspond with your Y Values array, and then input a new array of desired X Values for the interpolated Y array. For instance, suppose I have X = [0, 1, 2] and Y = [100, 200, 300]. I can resample Y with interpolation to be about twice as long by specifing an xi array of [0, 0.5, 1, 1.5, 2]. The resulting Y array has interpolated values for all 5 desired X points.

Alternatively, if you simply want to insert samples between the existing Y values at evenly spaced intervals, you can use the N Times input to specify how many samples to insert between each Y Value. This assumes, of course, that all Y Values are evenly spaced over time. If this is the case, to roughly double the size of your array with spline interpolation, all you need to do is the following:




Message Edited by Jarrod S. on 06-05-2008 11:56 AM
Jarrod S.
National Instruments
Message 8 of 9
(4,905 Views)
Hello to all,
 
My problem concerns using cubic spline.vi. It needs an ascending datapoints wired to X. Data that i need to manipulate might have single points that makes the dataset not completely ascending.
 
I've made a simple interpolation.vi  (attachment) which will interpolate single descending points without altering surrounding points
principle (...  3, 4, 2, 5, 6...) --> (...3, 4, 4.5, 5, 6...)
 
but this still doesn't solve the problem.. cubic spline.vi results an empty array
 
Question is: Do You have a better idea how to interpolate single datapoint without altering complete dataset?
 
Regards, ASJ
0 Kudos
Message 9 of 9
(4,843 Views)