Problem with signal resampling(stretching)
15 views (last 30 days)
Hello, I have been trying to solve my problem using various tools and commands in Matlab e.g. resample, xcorr, dwt etc but I'm unable to achieve the desired result. Here is the problem.. I have two pressure sensors through which I record pressure sensor measurements at the same frequency. Both the sensors have their own internal clock that provides time stamps for every measurement. I need to time-synchronize the measurements from both the sensors to do my further calculations. But it appears that the clock of one of the sensors is running faster than the other's, i.e. if I record data for 100 sec on one of the sensor the other sensor shows a recording of ~105 sec. How can I resample the second signal of 105 s to 100 s? The time stamps are also needed to be adjusted as it is required in my further calculations.
Sailesh Sidhwani on 27 Jul 2017
If we assume the slowdown is uniform, you could simply do the following for the second time series:
ts2.Time = ts2.Time * 100/105;
Now the duration will be in agreement while the data is unaffected.
Finally, you can use 'resample' to determine interpolated values at the desired times. The built-in MATLAB 'resample' function is: http://www.mathworks.com/help/matlab/ref/timeseries.resample.html