User Reference:Validating the Event Logging Mechanism: Difference between revisions
Created page with "==Synopsis== BCI2000 is able to record asynchronous data, so called Events, that occur during a recording. These events are logged into BCI2000 states, which provide a universal way to store information associated with brain signal sample data. This page provides an overview over the general concept and implementation of events. Also, it describes the RefLogger, which allows to quantify how reliable event recording is, and shows a simple Matlab script to analyze RefLog..." |
No edit summary |
||
| Line 7: | Line 7: | ||
==The Event Logging Mechanism== | ==The Event Logging Mechanism== | ||
===Time-stamping Brain Signal Data=== | |||
As described elsewhere, BCI2000 processes brain signal data in blocks of fixed size and duration. | As described elsewhere, BCI2000 processes brain signal data in blocks of fixed size and duration. | ||
Whenever a block of data has been acquired from the main brain signal source, a time stamp is taken from the computer's clock. | Whenever a block of data has been acquired from the main brain signal source, a time stamp is taken from the computer's clock. | ||
| Line 12: | Line 13: | ||
Assuming a negligible time delay between sampling of the block's last sample, and transmission into the computer, we can say that this time stamp represents the time of sampling for the first sample of the following block. | Assuming a negligible time delay between sampling of the block's last sample, and transmission into the computer, we can say that this time stamp represents the time of sampling for the first sample of the following block. | ||
Knowing this time stamp, and the sampling rate of the brain signal source, we can thus associate each of the block's samples with a sample time. | Knowing this time stamp, and the sampling rate of the brain signal source, we can thus associate each of the block's samples with a sample time. | ||
===Time-stamping Events=== | |||
In the BCI2000 software, a function exists that takes the name of an event, and a value. Whenever this function is called, it takes a time stamp from the computer’s clock and stores the event’s name, value, and time stamp into a queue of events. This queue is organized according to time stamps such that oldest entries will be retrieved first (priority queue). | |||
===Associating Time-stamped Events with Samples=== | |||
For the following, it is crucial to understand that events that happen while a data block is being digitized should be associated with the samples of that block. | |||
As soon as that block enters the computer’s memory, events are then taken from the event queue in order, and applied to the state variables inside the block. | |||
===Sources of Imprecision=== | |||
The event logging mechanism depends on precision of the BCI2000 time stamp. As this is derived from a high-precision clock available in all modern computers, this is in general not an issue. | |||
More of interest is another source of imprecision: Acquisition irregularities. Ideally, BCI2000 block duration is constant, and data blocks arrive regularly with little to no acquisition delay (time from sampling a block’s last sample, and seeing that block in the computer’s memory). Regularity of data blocks may be assessed by using the BCI2000 timing window; there, data block duration should form a straight line. Acquisition delay is more difficult to measure, and requires an amplifier with a digital (or analog) output that may be connected to an amplifier input. | |||
Revision as of 16:22, 28 July 2026
Synopsis
BCI2000 is able to record asynchronous data, so called Events, that occur during a recording. These events are logged into BCI2000 states, which provide a universal way to store information associated with brain signal sample data.
This page provides an overview over the general concept and implementation of events.
Also, it describes the RefLogger, which allows to quantify how reliable event recording is, and shows a simple Matlab script to analyze RefLogger data, together with results from a reference system.
The Event Logging Mechanism
Time-stamping Brain Signal Data
As described elsewhere, BCI2000 processes brain signal data in blocks of fixed size and duration. Whenever a block of data has been acquired from the main brain signal source, a time stamp is taken from the computer's clock. Note that this time stamp is taken after the data block has been sampled and transmitted from the hardware. Assuming a negligible time delay between sampling of the block's last sample, and transmission into the computer, we can say that this time stamp represents the time of sampling for the first sample of the following block. Knowing this time stamp, and the sampling rate of the brain signal source, we can thus associate each of the block's samples with a sample time.
Time-stamping Events
In the BCI2000 software, a function exists that takes the name of an event, and a value. Whenever this function is called, it takes a time stamp from the computer’s clock and stores the event’s name, value, and time stamp into a queue of events. This queue is organized according to time stamps such that oldest entries will be retrieved first (priority queue).
Associating Time-stamped Events with Samples
For the following, it is crucial to understand that events that happen while a data block is being digitized should be associated with the samples of that block. As soon as that block enters the computer’s memory, events are then taken from the event queue in order, and applied to the state variables inside the block.
Sources of Imprecision
The event logging mechanism depends on precision of the BCI2000 time stamp. As this is derived from a high-precision clock available in all modern computers, this is in general not an issue.
More of interest is another source of imprecision: Acquisition irregularities. Ideally, BCI2000 block duration is constant, and data blocks arrive regularly with little to no acquisition delay (time from sampling a block’s last sample, and seeing that block in the computer’s memory). Regularity of data blocks may be assessed by using the BCI2000 timing window; there, data block duration should form a straight line. Acquisition delay is more difficult to measure, and requires an amplifier with a digital (or analog) output that may be connected to an amplifier input.