- 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
조회 수: 20 (최근 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!