1

I have the following sensor sample data:

Time(milliseconds)            Data
------------------    -------------------
0                     0.30865225195884705   
60                    0.14355185627937317   
100                  -0.16846869885921478   
156                  -0.2458019256591797    
198                  -0.19664153456687927
258                   0.27148059010505676   
305                  -0.16949564218521118   
350                  -0.227480947971344 
397                   0.23532353341579437   
458                   0.20740140974521637

Which means at time 0 I have the value 0.30865225195884705 and at time 60 I have the value 0.14355185627937317 and so on.

As it is observed, data are not equally spaced which means I have data at different time stamps. I need this because I will apply Fast Fourier Transform to this signals.

Are there any methods or implementations so that I can create equally spaced data from my sensor data? (using MATLAB)

danishjo
  • 159
  • 1
  • 1
  • 8
  • 1
    Yes, you can use `interp1`. Create an equally spaced time vector `t` and call `DataEqSpaced=interp1(Time,Data,t)` – BillBokeey Dec 11 '15 at 14:09
  • It depends on the data, as you will need to estimate its value at that time; It is easy if the data follows a particular distribution, which will allow you to interpolate it. Otherwise, there is nothing stopping you from just using the data you currently have, and run your fft on non-evenly sampled data. – GameOfThrows Dec 11 '15 at 14:52
  • 3
    @GameOfThrows: *"and run your fft on non-evenly sampled data"* - no, that's a really bad idea - you'll get bizarre results if the sampling interval is not constant. – Paul R Dec 11 '15 at 16:22
  • 2
    [Relevant thread on MATLAB Central](http://www.mathworks.com/matlabcentral/newsreader/view_thread/32761). – Paul R Dec 11 '15 at 16:24

0 Answers0