Dear all,
I am planning to measure the delay of our BCI system. So I want to send a Trigger signal(Made by a signal generator) through BrianAmp and then RDA client to BCI2000 and then run a Visual stimulation triggered by this signal. How can I run the stimulation through the trigger signal? As I understood I have to write a function in c++ and then put in the singal processing module. But how can I do this?
All the best,
Farrokh
Running a Stimulation using an external tirgger
-
boulay
- Posts: 382
- Joined: 25 Dec 2011, 21:14
Re: Running a Stimulation using an external tirgger
I wrote out a long reply so I'll keep in below just in case. But I think you should start by reading this.
Let's see if I understand correctly. You are going to use a signal generator to create a trigger signal that goes to your amp and simultaneously to an oscilloscope. Then you want BCI2000 to generate a visual stimulus based on detecting this trigger signal, and you will use a photodetector on the monitor, also connected to the oscilloscope. One the oscilloscope you will examine the delay between the trigger and visual stimulus. Is that correct?
There are a few sources of delay that will confound your measurements.
(1) the delay in the acquisition system (RDA server + client).
(2) the inconsistent delay between the trigger time and the sampling time. (If you sample at 256 Hz, that still leaves 3.9ms between samples. The trigger could be anywhere in there).
(3) the inconsistent delay between the trigger time and the end-of-block time. (BCI2000 runs its tasks once per block. If your trigger is at the end of its block, there will be less time between it and the task than if the trigger were at the beginning of the block).
(4) the delay in your code to detect the trigger. (Only if you use analog inputs. If you use the digital inputs then there is no delay, but first check that the digital and analog buffers are synchronized by splitting a trigger to both analog and digital inputs and seeing that there is no jitter between them. Based on my experience with the BrainAmp MR Plus I would guess this is true).
(5) the delay in the computer from the time you send a graphical command to the time the monitor actually switches its pixels.
There are probably others I'm missing.
I can't think of how to measure (1).
(2) can't be helped unless you synchronize your signal generator and amplifier. BrainProducts actually have hardware to do this to facilitate artifact removal in EEG-fMRI.
(3) can be accounted for after-the-fact but will be very hard to do on an oscilloscope in real time.
(5) is something you can measure. Create a very simple application that does 2 things: every 10 blocks it records a state change and sends a command to flash a visual stimulus. Put a photosensor on the monitor and record that photosensor into the BrainAmps hardware directly. The delay you are interested in is the delay between the first sample in the block with the state change and the change in the analog recording of the photosensor.
Who is online
Users browsing this forum: No registered users and 0 guests
