MATLAB: Interpolate/Adjust to new Sampling Rate

fftinterpolationsampling ratetime stamps

Hello,
i have data received from a accelerometer with a sampling frequency of 10Hz.
But the time stamps in the data file are not equidistant, the sampling time interval is changin.
How can i "fix" the time stamps with my corresponding acceleration values?
So far i have just calculated the mean value for the sampling time interval (for further fft calculations) -> t_s = mean(diff(t))
Is there a better way to do that? maybe by interpolation?

Best Answer

Use the Signal Processing Toolbox resample function. The advantage it offers over simply interpolating is that it uses an anti-aliasing filter to keep the resamples signal free of extraneous frequencies.