daveP Posted October 22, 2008 Report Posted October 22, 2008 Hi, I should say I'm a relative beginner to Labview. I am trying to convert from one file type to another. I have x y data in array form. The original data was not generated with a uniform x interval, but the file I am converting to requires the x data to be evenly spaced from the start value to the end one. Does labview allow you to predict the y values at given x values i.e can a generate a new array with new x and y values where the x values are evenly spaced. Any help would be greatly appreciated Cheers Dave Quote
Francois Normandin Posted October 22, 2008 Report Posted October 22, 2008 Hi Dave, Try investigating the Interpolate & Threshold 1D Array in the Array Palette. You can specify the spacing yourself and iterate in a for/while loop to generate the proper vectors. This is "linear interpolation". You can have a look at spline interpolation too... When you have worked a little with these, post what you've got if you're still stuck. Quote
TobyD Posted October 22, 2008 Report Posted October 22, 2008 QUOTE (daveP @ Oct 21 2008, 09:06 AM) I have x y data in array form. The original data was not generated with a uniform x interval, but the file I am converting to requires the x data to be evenly spaced from the start value to the end one. Does labview allow you to predict the y values at given x values i.e can a generate a new array with new x and y values where the x values are evenly spaced. Hi Dave, normandinf beat me to it while I was making an example, but you should be able to utilize the interpolate VIs to get what you need. I have attached one example of what can be done with linear interpolation. Read your data into an array of clusters where each cluster contains your known x and coresponding y values. Then pass in the x values you want to know and the y values will be spit out. Play around with this until you get the kind of interpolation you need. -Toby http://lavag.org/old_files/post-8758-1224606781.vi'>Download File:post-8758-1224606781.vi Quote
Neville D Posted October 22, 2008 Report Posted October 22, 2008 Also take a look at the Resample ExpressVI. Neville. Quote
daveP Posted October 23, 2008 Author Report Posted October 23, 2008 Hi, Cheers for all the help. Think I've managed to sort it. I used the Spline Interpolation in a For loop. Thanks Dave Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.