Jump to content

User Tutorial:Configuring Online Feedback: Difference between revisions

From BCI2000 Wiki
Mellinger (talk | contribs)
Mellinger (talk | contribs)
Line 33: Line 33:
In the next step, we construct a full parameter file for the subject:
In the next step, we construct a full parameter file for the subject:
*In the configuration window, click ''Load Parameters'' to load <tt>parms/MuTutorial/MuFeedback.prm</tt>.
*In the configuration window, click ''Load Parameters'' to load <tt>parms/MuTutorial/MuFeedback.prm</tt>.
*Additionally, load your amplifier configuration from <tt>parms/Amplifiers</tt>.
*Additionally, load your amplifier configuration from <tt>parms/amplifiers</tt>.
*Load the spatial filtering parameter fragment created above.
*Load the spatial filtering parameter fragment created above.
*Go to the ''Storage'' tab, and enter the subject's name or ID into the ''SubjectName'' parameter.
*Go to the ''Storage'' tab, and enter the subject's name or ID into the ''SubjectName'' parameter.

Revision as of 18:35, 20 December 2007

This tutorial step assumes that you have obtained Mu rhythm parameters in an initial session. Now you are going to create a subject-specific parameter configuration for on-line feedback.

Starting up BCI2000

Start BCI2000 using the appropriate batch file at batch/CursorFeedback_<YourAmplifier>.bat. You might consider creating a link to this file on the desktop.

Spatial Filtering

As a result of the initial session, you have some idea of the signal topography, and spatial filtering that extracts the signal best. In this tutorial, we use Common Average Reference (CAR) filtering because it gives generally good results, and has the advantage of being independent of the montage used. Also, this method is independent of subject specific parameters, so you will only need to configure it once for a given electrode montage.

Creating a CAR Filter

The idea behind CAR filtering is to subtract the spatial average of all N channels from each individual channel. In terms of spatial filtering matrices, this means an identity matrix minus a matrix that has 1/N in all entries:

Mij=δij1/N.

For 16 and 64 channel recordings, you may load appropriate parameter fragments are available at parms/SpatialFilters/CommonAverageN.prm. For other N, you will need to configure the TransmitChList and SpatialFilter parameters as follows:

  • Go to the Source tab. In the TransmitChList parameter, enter a space-separated list of channel numbers beginning with 1:
    1 2 3 4 ... N
  • Go to the Filtering tab. Click the Edit Matrix button associated with the SpatialFilter parameter.
    • Set both Number of columns and Number of rows to N, and click Set new matrix size.
    • In the diagonal entries of the matrix, enter the numerical value of 11/N.
    • In the non-diagonal entries, enter the numerical value of 1/N.
    • Right-click the matrix, and choose Edit labels from the context menu.
    • As row labels, enter the electrode locations corresponding to channels.
    • Close the matrix editor window.
  • Click Configure Save in the configuration window, and check all parameter entries except TransmitChList and SpatialFilter; then close the window.
  • Click Save Parameters, and save your spatial filter configuration under parms/spatial_filters/CommonAverage<YourMontage>.prm.
  • Click Configure Save again, uncheck all parameter entries, close the window.

The step of entering electrode locations is not mandatory. However, it makes subject-specific configuration easier to set up later on. Also, pre-defined CAR parameter files do not specify electrode locations, so you will need to enter these locations manually, and save the resulting configuration as described above.

Subject-Specific Parameters

In the next step, we construct a full parameter file for the subject:

  • In the configuration window, click Load Parameters to load parms/MuTutorial/MuFeedback.prm.
  • Additionally, load your amplifier configuration from parms/amplifiers.
  • Load the spatial filtering parameter fragment created above.
  • Go to the Storage tab, and enter the subject's name or ID into the SubjectName parameter.
  • Into the SubjectSession parameter, enter 002.

Configuring the Classifier

Subject-specific electrode location and Mu rhythm frequency are part of the classifier's configuration. They are entered into the Classifier parameter on the Filtering tab; there, click the Edit Matrix button associated with the Classifier parameter.

  • Set Number of columns to 4, and Number of rows to 2; then, click Set new matrix size to apply your changes.
  • In the first column, labeled input channel, enter the location of the feedback electrode. If you did not specify electrode locations when configuring the spatial filter, enter the channel number associated with the feedback electrode.
  • In the second column, labeled input element (bin), enter feedback frequency in Hz, immediately followed with Hz, as in 12Hz.
  • In the third and fourth columns, enter 1 as output channel, and 1 as the weight.
  • Finally, save your configuration to parms/Subjects/<Subject>002.prm, or whereever you find appropriate.

Next Step

In the next step, you will learn how to actually perform a Mu rhythm feedback session using the configuration created in the present step.

See also

User Tutorial:Mu Rhythm BCI Tutorial, User Reference:SpatialFilter, User Reference:LinearClassifier