# Problem with signal resampling(stretching)

15 views (last 30 days)
Ehtesham Hasnain on 18 Jul 2017
Edited: Toni Seidlitz on 7 Feb 2019
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.
Thank you!

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
Toni Seidlitz on 7 Feb 2019
Edited: Toni Seidlitz on 7 Feb 2019
Hi!
Is there a way to determine the elongation factor based in the pressure signal of the sensor?
I have the same problem, and i need to find a solution, which is working for all kinds of stretching, since the clock speed seems to be affected by the voltage of the powering battery.
xcorr is bringing both signals to allignment, but unfortunately only in the middle of the measurement.