melizalab / jill

realtime electrophysiology, behavioral, and acoustic recording system
http://melizalab.github.io/jill
3 stars 5 forks source link

Recording durations don't match metadata #19

Closed dmeliza closed 2 years ago

dmeliza commented 2 years ago

This error occurs when doing triggered recording, which generates an ARF file with a bunch of entries, one for each time the recording was triggered. Sometimes the new recording gets triggered right after the end of a previous recording, before the pretrigger buffer has had a chance to fill completely. When this happens, the second entry ought to start on the sample right after the first entry's end. It's pretty obvious when these happens when inspecting the recordings, and downstream code may want to splice these entries together for analysis.

However, the jack_frame or timestamp attributes are compared to each other for these cases, the difference is less than the duration of the first entry. What I think is happening is that the attributes are not reflecting the actual amount of data used from the pretrigger buffer. This would also mean that the trigger times are not being correctly offset.