How to synchronize two datasets with different AND varying sampling rate?

조회 수: 2 (최근 30일)
Micke Malmström
Micke Malmström 2017년 11월 4일
편집: Micke Malmström 2017년 11월 4일
I have the data sets, Data1 and Data2 like below:
Data1.t % vector with timestamps e.g. [0.1, 0.4 2 2.3 4 4.5 4.7 etc...]
Data1.data % The voltage measured of a 0.1 Hz triangle function at the times specified above.
and:
Data2.data % the same 0.1 Hz triangle function but measured at different times than in Data1.t
The problem is that I want to figure out the time at which Data2 was sampled, i.e. Data2.t (there is at least 10 samples per period)
I was thinking of using something like
Data2.t=interp(Data1.data(start_index_n:stop_index_n),...
Data1.t,...
Data2.data(start_index_n:stop_index_n))
If I'm lucky I can find the
start_index_n
for each period "n" in both Data1.data and Data2.data with some peakfinder-function… and then cycle through all the recorded periods.
(I started writing this as a question but as I was writing I realised how I could approach the problem. So this post is mainly to help others)

답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by