Difference between revisions of "User Reference:SourceFilter"

From BCI2000 Wiki
Jump to: navigation, search
(Remarks)
(Parameters)
 
Line 30: Line 30:
 
*4: at 70Hz.
 
*4: at 70Hz.
 
The low pass filter is realized as a 2nd order Butterworth IIR filter.
 
The low pass filter is realized as a 2nd order Butterworth IIR filter.
 +
 +
===UnfilteredChannels===
 +
 +
This is a list of indices to the channels should be left unfiltered (for example, hardware triggers and other auxiliary channels).
  
 
==Remarks==
 
==Remarks==

Latest revision as of 18:56, 23 May 2014

Function

Most EEG amplifiers offer filtering in hardware. Generally, they have a line noise hum filter, or "notch filter", built in, and perform some high pass filtering. For amplifiers that do not provide these filters themselves, there is the SourceFilter as a software solution.

Unlike other filters, the SourceFilter filter will be applied immediately after data acquisition, and it will modify the data which will be saved to disk, i.e., it will behave just as if it were a hardware filter built into the amplifier.

Parameters

NotchFilter

Configures the notch filter. The proper setting depends on your country.

  • 0: disabled,
  • 1: at 50Hz (Europe, Asia, Africa, parts of South America)
  • 2: at 60Hz (North America, parts of South America).

The notch filter is realized as a 2x3rd order Chebychev bandstop.

HighPassFilter

Configures the high pass filter:

  • 0: disabled,
  • 1: at 0.1Hz.
  • 2: at 1Hz.

The high pass filter is realized as a 1st order IIR filter.

LowPassFilter

Configures the low pass filter:

  • 0: disabled,
  • 1: at 9Hz,
  • 2: at 30Hz,
  • 3: at 40Hz,
  • 4: at 70Hz.

The low pass filter is realized as a 2nd order Butterworth IIR filter.

UnfilteredChannels

This is a list of indices to the channels should be left unfiltered (for example, hardware triggers and other auxiliary channels).

Remarks

Generally, the SourceFilter will be available in source modules connecting to amplifiers that require it. Adding the SourceFilter to modules that do not yet contain it requires recompilation.

To add the SourceFilter to a new or existing source module, edit its CMakeLists.txt file by adding a line

BCI2000_INCLUDE( "SOURCEFILTER" )

above the line containing BCI2000_ADD_SIGNAL_SOURCE_MODULE. Re-run CMake, and recompile.

If you are not using CMake, add the following files to the project:

BCI2000/src/shared/modules/signalsource/SourceFilter.cpp
BCI2000/src/shared/modules/signalprocessing/IIRFilterBase.cpp
BCI2000/src/extlib/math/FilterDesign.cpp

Also, make sure that the following include paths are set in your project:

BCI2000/src/shared/modules/signalsource
BCI2000/src/shared/modules/signalprocessing
BCI2000/src/extlib/math/

After recompiling and linking, your source module will use the SourceFilter to preprocess recorded data.

See also

User Reference:Filters, Programming Howto:Building BCI2000