Interpolation

hi,
I setup a script in order to draw curves.
The information is contained in a wave file that I amount of scilab.
The information is not perfectly aligned, is what a graph unpleasant to see.
how can I do to fit it to the various points in order to get a clean graph?

here is the script:

clear;
mostra = %f;
usecanvas(%T);
mprintf("\n");
mprintf("\n -*-*- Tracciatore di curve I_V -*-*- \n");
fs= 16.5
rm= input("Inserisci il valore della resistenza di misura:  ");
filein=input("Nome del file wav contenente i dati: ","string");
y= wavread(filein);
b=((y(1,:))*fs);
a=((y(2,:))*fs);
i=(((a-b)/rm)*1000);
v=b;
xtitle("Grafico" , "Tensione(V)" , "Corrente(mA)");
xgrid(1);
xset("wresize",1);
xset("auto clear","on");
plot2d (v,i,style=3);
g=get('current_axes');
//set(g,"y_location","origin");
//set(g,"x_location","origin");
xset("wpos",0,0);
xset("wdim",540,540);
xset("mark size",18);
xset("font size",3.5);
 

I have to interpolate the variables i and v.

thanks!

Taxonomy upgrade extras: