How to do interpolation of an unevenly sampled matrix?

I have a data in the form of a matrix (88x3). It is not evenly sampled, how can I do interpolation on it so that it becomes evenly sampled. I need to perform low pass filtering on this data. Any help would be greatly appreciated.

2 Comments

Is it 88 samples of three series or...???
these are the readings of an acelerometer in the form of x, y and z axis. Therefore a matrix is formed of order 88x3 i.e having 88 rows and 3 columns of x, y and z respectively.

Sign in to comment.

Answers (1)

And where is the time at which they were sampled from which to interpolate? Come on here, give us some help...
In general, you've got to have a timestamp vector of the same length as the data and then use interp1 with the desired times to create the interpolated series.
new=interp1(t,old,tnew);
where
old is your existing accel data, t is the aforementioned sampled time vector and tnew is the desired time vector.
doc interp1 % for the details of interpolation types to use...

4 Comments

Thank you for your reply. I have attached the readings below. Can you please explain me now with respect to these readings...thanx
Can't -- you didn't preserve sufficient time resolution to tell the various values apart so you only know to the nearest minute. As can tell by looking at the time column in numeric form, the first several are as follows--
0.853912037037037
0.853958333333333
0.853958333333333
0.853969907407407
0.853969907407407
0.853969907407407
0.853969907407407
This proves there's not sufficient resolution in the data as saved to tell them apart and hence you can't realistically do anything other than make an assumption that the sampling was the average of how many/minute there are overall and approximate to that average sample time.
Looks like it's time to take the data again with a better recording mechanism or reprocess the raw data file if you have it somewhere with a better time stamp than what is in the spreadsheet.
Sorry for the bad news...
Is it possible to use this data and pass it through a low pass filter without interpolation. and how can i determine the sampling frequency from this data?
dpb
dpb on 26 Jul 2014
Edited: dpb on 26 Jul 2014
All you can do is the average of the number of samples over the total period; you have no more information to do anything else. That still has up to almost 2 minutes total uncertainty in the time duration (if the first were the last second of that minute and the last the first in the ending minute). All in all, you have very little time information at all, really, in terms of sample rates. Probably the best estimate you can get will be to throw out the first and last minutes and then use the remaining number of samples over that time interval.

Sign in to comment.

Asked:

on 23 Jul 2014

Edited:

dpb
on 26 Jul 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!