LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Interpolation of curve with loops

hi ...
i've got another question

why is the graph plotted have points out of the range of the values in the array ?? is it possible to keep the interpolated points in the range??

i need to normalize the curves to make the range 0-1 so that i can also set the database range to be 0-1 to be compared later... where and how do i do normalization ?? the vi  that i posted earlier i had normalised the range .. but i think the zeros affect the normalization.. can i normalize the interpolated data?? will the points out of the range afftect the later comparison results??

thanks..
 

ps: i've posted a question earlier . this is in a new page.. i hope u can help me solve this problem .. thanks very much...

Message Edited by kupikupi on 09-08-2006 10:50 AM

0 Kudos
Message 21 of 29
(1,411 Views)
hi .. sorry to keep posting questions here...

altenbach ..
for thr program u did ... it does not work for 1 set of data.... it shows NaN when there's only 1 set of data

for 2 sets... there's only the points without plot.. but there are 4 type of plots when there are only2 sets of data

could u give me more details  on the program ? i dont really understand wat is happening in the loop ..

if im not wrong.. the plot connect ng all the input points are the interpolated data.. but they are not in the range of the original data...

i need the interpolated data to be in the range of the original data as i need it to compare with a database as i have mentioned in my previous post..

please explain more about the program to me  and how can i implement my questions .. thanks

0 Kudos
Message 22 of 29
(1,395 Views)
hi ,, could anyone help me please>> thanks...
0 Kudos
Message 23 of 29
(1,372 Views)
You simply need to truncate the arrays at the first zero, then generate a ramp of equal lenght for the index.
 
Where is the original data generated? Maybe, instead of using a 2D array, you should have an 1D array of a [cluster containing a 1D array]. Now each motion can have variable lenght and the code can be much simpler.
 
Attached is one example tha you can modify.
 
 
I am not sure how you want to normalize your data (scale from 0..1, divide by the max value, etc.). If you normalize the data, the spline can be outside the range because of loops, so maybe you should normalize the spline and then apply the same transofrm to the data.
 
If you have a variable number of motions, you should also change the plots programmatically so the spline are lines and the data are points (property nodes).
 
 

Message Edited by altenbach on 09-10-2006 11:17 AM

0 Kudos
Message 24 of 29
(1,371 Views)
hi altenbach ..
i've tried out the program ... strangely it's not working as expected...

for similar motions .. i get diferrent shape of graph ... i expected it to be be... if i plot it on an xy graph ..without scaling, spline and interpolation .. they look similar...

i've attached my program .. could u help me have a look at it .. im not so sure which part is wrong ...
 please help me .. thanks...
0 Kudos
Message 25 of 29
(1,325 Views)
Hi kupikupi,

Rather than posting your entire code, is it possible to cut it down to snippet of the data manipulation and plotting that you are doing?  It will make it simplier for others (and yourself!) to debug.  A good approach may be to to use constants (based on real data) as inputs to your calculations instead of actually acquire data from hardware.  If we can get the transforms and plotting to work for these cases, it shouldn't be difficult to extend it to others.  After doing so, please let us know what kind of plots you expect or desire, so we have a good idea of what you are trying to accomplish.  Keep us updated, and we'll be glad to help!

Thaison V
Applications Engineer
National Instruments

0 Kudos
Message 26 of 29
(1,305 Views)
hi ....
thanks for the reply ..


i've already modified my program,

just for ur info ..
i have 3 sets of data to test , the 1st set of x and y are already connected...

the other 2 sets is supposed to have a similar shape when i plot them directly on an XY graph ... but when i go thru the spline . the shape of the graph of the 3 sets of data somehow becomes so different..

my aim here is to match the shape to the graphs.. if the shape is similar .. then i have a match . but till now .. nothing seems to work for me .. i hope u can help me .. tahnks...
0 Kudos
Message 27 of 29
(1,294 Views)
can anyone please help me ?? im stuck at this part... i need some pointers to continue... thanks...  
0 Kudos
Message 28 of 29
(1,257 Views)
kupikupi,

I am in the process of looking at the VI.  I will let you know what I find though.  If you make any progress of your own, feel free to update us in this thread as well.  Thanks!

Thaison V
Applications Engineer
National Instruments

0 Kudos
Message 29 of 29
(1,247 Views)