how to convert absolute time to real time and calculate the sampling rate
조회 수: 8 (최근 30일)
이전 댓글 표시
Hello to all...In this file, I have the absolute time and date and day of data registration. Now I want to get the real time and calculate the sampling rate from the difference of the frames with each other and their inverse. I have a problem with the MATLAB code. In the first step, I don't know how to calculate the real time and do the next steps? Help me please. Thanks a lot
댓글 수: 0
채택된 답변
Les Beckham
2023년 10월 25일
편집: Les Beckham
2023년 10월 25일
load metaData_Depth
fn = @(s) datetime(s.AbsTime);
dt = arrayfun(fn, metaData_Depth)
delta_t = seconds(diff(dt))
max(delta_t)
min(delta_t)
numel(unique(delta_t))
mean(delta_t)
std(delta_t)
plot(delta_t, '.')
grid on
So, every single sample has a different duration of time between it and the next sample. Thus, it isn't going to make much sense to calculate a sample rate for this data.
댓글 수: 7
Voss
2023년 10월 25일
load metaData_Depth
C = num2cell(vertcat(metaData_Depth.AbsTime),1);
dt = datetime(C{:})
delta_t = dt - dt(1)
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!