questions about timing
Posted: 22 Jul 2005, 13:44
I have a couple of questions about timing.
My understanding of the BCI2000 system is that it takes in one block of data at a time from the DAQ system and then processes this block. This would lead to a delay between when one single sample is taken by the data acquisition system and when it is processed by BCI2000. Thus, there is a latency between the time stamp of the data being processed and the time stamp of the recorded data. What I would like to do is correct for that latency.
I am currently recording the time using GetBCItime_ms() in two different places. The first is in Application\TTask.cpp UpdateDisplay(), which is where I process the BCI data and decide what to display to the screen. The other place where a time stamp is being recorded is in EEGsource\BufferRead\BufferReadADC.cpp, which is right after one of the blocks is written. What I was expecting to see when looking at the times I had saved was that the BufferReadADC timer would have give the same time value for several cycles as it records a single block and then jumps after it gets updated with a new block. This is exactly what I saw. For the TTask timer, I was expecting to see new timer values each cycle, but instead it looks like the BufferReadADC timer, only delayed. At first I thought this might be due to timer precision, but it looks like GetBCItime_ms should have pretty high resolution because it uses a good timer. Why do GetBCItime_ms calls in TTask return values that are step-like?
In a related note, how are state variables saved? Are they aligned with the acquired data or are they simply written whenever they are updated?
What I would like to know, in short, is how to go about properly fixing latencies between acquisition and processing. Is it possible to get the aquire time of data with accuracy greater than that of one acquisition block? Or is the best I can do to find latencies simply to subtract the BufferReadADC time stamp from the TTask time stamp.
Thanks,
Paul Hammon
UCSD
My understanding of the BCI2000 system is that it takes in one block of data at a time from the DAQ system and then processes this block. This would lead to a delay between when one single sample is taken by the data acquisition system and when it is processed by BCI2000. Thus, there is a latency between the time stamp of the data being processed and the time stamp of the recorded data. What I would like to do is correct for that latency.
I am currently recording the time using GetBCItime_ms() in two different places. The first is in Application\TTask.cpp UpdateDisplay(), which is where I process the BCI data and decide what to display to the screen. The other place where a time stamp is being recorded is in EEGsource\BufferRead\BufferReadADC.cpp, which is right after one of the blocks is written. What I was expecting to see when looking at the times I had saved was that the BufferReadADC timer would have give the same time value for several cycles as it records a single block and then jumps after it gets updated with a new block. This is exactly what I saw. For the TTask timer, I was expecting to see new timer values each cycle, but instead it looks like the BufferReadADC timer, only delayed. At first I thought this might be due to timer precision, but it looks like GetBCItime_ms should have pretty high resolution because it uses a good timer. Why do GetBCItime_ms calls in TTask return values that are step-like?
In a related note, how are state variables saved? Are they aligned with the acquired data or are they simply written whenever they are updated?
What I would like to know, in short, is how to go about properly fixing latencies between acquisition and processing. Is it possible to get the aquire time of data with accuracy greater than that of one acquisition block? Or is the best I can do to find latencies simply to subtract the BufferReadADC time stamp from the TTask time stamp.
Thanks,
Paul Hammon
UCSD