Interpolate/Adjust to new Sampling Rate

34 views (last 30 days)
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?

Accepted Answer

Star Strider
Star Strider on 18 May 2020
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.
  4 Comments
Felix Westphal
Felix Westphal on 20 May 2020
That worked perfectly, thank you! :)

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!