- 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
13 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
Walter Roberson
2020 年 6 月 20 日
You have to interpolate them to a common time.
There are a few ways you could proceed:
参考
カテゴリ
Help Center および File Exchange で Multirate Signal Processing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!