Resampling non-uniform sampled data

Rob Mahurin rob at utk.edu
Thu Apr 2 10:36:20 CDT 2009


On Apr 2, 2009, at 5:30 AM, Sean87 wrote:
> Hi,
>
> I'm fairly new to Octave and I'm attempting to use it to analyse  
> some data
> that has not been sampled at uniform time intervals.  In order to  
> proceed I
> need to have the sampling uniform.  Does anyone know of a way to  
> interpolate
> and resample the data?


interp1 does this for 1d data:

# irregularly sampled and noisy "data"
x = sort( rand(1e2,1) );
y = x.^2 + 0.05 * randn( size(x) );
# interpolation
xi = linspace(0,1,100);
yi = interp1(x,y,xi);
plot(x,y,'o', xi,yi,'-x')

Cheers,
Rob

-- 
Rob Mahurin
Department of Physics and Astronomy
University of Tennessee 		865 207 2594
Knoxville, TN 37996 			rob at utk.edu





More information about the Help-octave mailing list