Jump to content

Template:Tutorial Spatial Filter

From BCI2000 Wiki
Revision as of 19:07, 8 January 2008 by Mellinger (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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/fragments/spatial_filters/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/fragments/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.