Testing a setup; only with RandomNumber?

This forum deals with BCI2000 configuration issues.
Locked
pieterlaurens
Posts: 4
Joined: 16 May 2006, 06:02

Testing a setup; only with RandomNumber?

Post by pieterlaurens » 17 Oct 2006, 09:09

Fellow BCI researchers,

The BCI setup works fine, great work! However some things remain unclear. Therefore I would like to 'probe' a certain setup with known signals. When I am developping my own modules I would also like to be able to test them in this way. To this end I now use the RandomNumber (RN) source module.

The RN module can however only output two sines of one single frequency (right?). Is there an extension of (or alternative for) this module which is able to output slightly more complex signals? (A less pressing matter is that I get a stepwise and non-linear increase in amplitude of the sine if i modulate it with the mouse. I am trying to adapt the code to make the increase in amplitude more linear and softer...)

In line with this question I am also trying to read out the adapted parameters after each trial to see how they are changed for different 'brain' signals (which are of course no brain signals but come from RN) and for different settings for Statistics. Is there a more elegant way to do this than by writing a line in a log file from the Statistics filter?

Thanks in advance,

Pieter Laurens
University of Groningen

gschalk
Posts: 615
Joined: 28 Jan 2003, 12:37

RandomNumber questions ...

Post by gschalk » 18 Oct 2006, 18:00

Pieter,

Please find my answers below.
The BCI setup works fine, great work!
Thanks :-)
The RN module can however only output two sines of one single frequency (right?). Is there an extension of (or alternative for) this module which is able to output slightly more complex signals? (A less pressing matter is that I get a stepwise and non-linear increase in amplitude of the sine if i modulate it with the mouse. I am trying to adapt the code to make the increase in amplitude more linear and softer...)
Yes, you are correct. It can currently only output a maximum of two control signals (i.e., sine waves) whose amplitude are modulated using the mouse. There is no version for more complex signals, although if you know which signals you want to produce, it is very easy to adapt the RN code to do that.
In line with this question I am also trying to read out the adapted parameters after each trial to see how they are changed for different 'brain' signals (which are of course no brain signals but come from RN) and for different settings for Statistics. Is there a more elegant way to do this than by writing a line in a log file from the Statistics filter?
The simple answer is that the statistics parameters are actually only updated (and sent to the Operator) at the end of each run. What is updated after each trial are the internal variables within the Statistics filter. To output these variables, you do in fact have to write a line in a log file as you suggest, or to use states as described further below.

The more philosophical answer is that system parameters are supposed to be constant throughout a run. That's why they are only stored in the header of the data file and that's why they are only communicated throughout the system at the beginning/end of each run. If you need to calculate events that change constantly, you should be using states (which are stored along with each data sample).

The Gerv

pieterlaurens
Posts: 4
Joined: 16 May 2006, 06:02

Post by pieterlaurens » 19 Oct 2006, 09:40

Great, thanks for the speedy reply.

I am currently working on an adaptation of RN. I can define a set of signal sources producing a sum of sine waves, similar to RN, but with a multitude of sines (indeed very simple as you suggested). The activations of these sources can be transformed condition-based into a linear mixture at 'imaginary' electrodes.

In concert with your suggestions for reading out adaptation this should provide us with a good framework to test the operation of new filters.

I will look into state information soon, but am I correct that those data (the changed XMean etc.) are not written to the MatLab files with the command line tools?

mellinger
Posts: 1163
Joined: 12 Feb 2003, 11:06

Post by mellinger » 23 Oct 2006, 09:46

Pieter,
am I correct that those data (the changed XMean etc.) are not written to the MatLab files with the command line tools?
the bci_stream2mat command line tool will ignore parameters when converting a data stream into a Matlab file.
If, instead of the bci_dat2stream | bci_stream2mat combination, you use the load_bcidat mex file to load single runs (i.e., single dat files), parameters will be available in Matlab, and their values match the values in the BCI2000 file header, i.e., at the beginning of the recording.

If you want the updated classification parameters in Matlab, you might modify the Statistics filter to write them into additional states, as Gerv suggested.

Hope this helps,
Juergen

Locked

Who is online

Users browsing this forum: Bing [Bot] and 4 guests