- You could choose the times from one of the signals, and interp1() the other signal at those times. Watch out for extrapolation (it typically returnes nan)
- You could find the overlapping time range, max(min(t1),min(t2)) to min(max(t1),max(t2)) and linspace() that and interp1() each of the signals to that common time. If you do this, it might well be the case that none of the original points from either signal are used exactly
- You could find the overlapping time range, max(min(t1),min(t2)) to min(max(t1),max(t2)) and find the union of all of the t1, t2 that fall in that range, and interp1() each of the signals to that union of times. If you do this, then every original point (within the time overlap) will be preserved exactly for both signals, and as well interpolation will be done for the points that exist in one but not the other
compare time series with different time steps
11 views (last 30 days)
Show older comments
I have 2 sets of time series data, v(t). These two data sets have different time steps. For example, t1 = 0: 0.3: 6; t2 = 0: 0.4: 6. I am wondering how I can compare the differences between two data sets, such as norm(data1-data2).
Thank you!
0 Comments
Answers (1)
Walter Roberson
on 20 Jun 2020
You have to interpolate them to a common time.
There are a few ways you could proceed:
See Also
Categories
Find more on Multirate Signal Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!