Open jcbyts opened 6 years ago
I believe this works as a solution
% we're going to use the second column of data (which reports the sample
% duration) because it is higher precision than the first column. However,
% it does not track the real time of the eyetracker, so we need to correct
% for any pauses in the file
% correct for pauses in the file
time = [0; diff(samples(:,1))]*1e3; time(time < 10) = 0;
v.time = [0; cumsum(samples(2:end,2))] + cumsum(time);
% debugging figure
% figure, plot(samples(:,1)*1e3, '.'); hold on; plot(v.time, '.')
This figure shows the time across the entire file.
Fixed in commit 8144f6869d42794d239b3950229096cc06a45b23
The first column of data in the vpx file is in seconds and is truncated to 3 decimal places, making it too imprecise for our needs. The second column has the sample duration in ms and is more than precise enough. We can't just take the cumulative sum of the second column because it doesn't account for pauses in the file.