0

I have some raw accelerometer data which were collected unevenly spaced time at sampling rate between 200 and 220 Hz. I would like to analyze the data using stationary methods so I applied matlab anti-aliasing function resample on the raw data. Here is the code I used for resampling:

time_data = timeseries(mag, time) % mag is the magnitue sqrt(x^2 + y^2 + Z^2)

fs = 26; %frequency

time_end = 50;

dt = 1 / fs; % new vector of time with fixed dt = 1 / fs

new_time = 1:dt:time_end;

time_datanew = resample(time_data, new_time);

My questions are: How do I choose the frequency fs i.e. which sampling rate should I choose for the resampled data? And what should the end time be, i.e how large should this window be to detect some important features?

Hope my questions make sense:)

Thank you very much for your help.

  • 1
    I would suggest to pick the highest sampling rate you encountered with your non-uniform sampling. Simply because that avoids the problem of creating aliasing by violating the Nyquist criterion. In your case that would be 220 Hz. Assuming when you are talking about a window size, you refer to actual value of time_end, I would suggest to set it to last value of your time vector. – Mouse On Mars Feb 08 '17 at 17:47
  • Thank you Michael:) 220 Hz is too high to capture the periodicity. Instead of changing my data into timeseries data, I simply just change my code to: [signal,time] = resample(mag,time_old, 30); with a new frequency 30Hz. – Ljusbidombi Feb 18 '17 at 09:36

0 Answers0