% Spline interpolation simple wavelet % splinewavelet.m L Braile 3/7/2005 x = [0 1 3 4 5 6.2 8.3 9.6 12]; y = [0 0 2.8 0.5 -2.7 0 1 0 0]; minx = min(x); maxx = max(x); dx = 0.05; xs = [minx:dx:maxx]; % interpolate with delta x = 0.05 % x values are now evenly spaced % % choose nearest, linear, spline or cubic options %ys = interp1(x,y,xs,'nearest'); %ys = interp1(x,y,xs,'cubic'); %ys = interp1(x,y,xs,'linear'); ys = interp1(x,y,xs,'spline'); plot(x,y,'-b',x,y,'ob') hold on plot(xs,ys,'-r','linewidth',3) xlabel('x') ylabel('y') title('Spline interpolation for simple wavelet') hold off