how to convert absolute time to real time and calculate the sampling rate
30 次查看(过去 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!