Skip to content

← neural package

FilterBankCommonSpatialPattern

Extract signal components across multiple bands whose variance optimally discriminates between two conditions.

FBCSP generalizes the basic CSP method to multiple bands (yielding number of bands times number of pattern pairs times 2 channels), and like CSP it can be used as an adaptive preprocessing step for a multichannel signal, such as EEG, EMG, or MEG, whose variance shall subsequently be used in a classification setup (e.g., to predict some binary target variable, for instance in order to discriminate between two possible cognitive states). The resulting components will usually yield better spectral features than the raw channels, leading to better classification accuracy. This node will calibrate itself if it receives a non-streaming (offline) chunk that has a time, space, and instance axis, and which has a target value for each instance (similarly to how machine learning nodes operate). Instances correspond to labeled trials, the space axis represents the channels which are being filtered, and time are the time points of each trial segment. FBCSP should be preceded at least by a highpass filter (e.g., FIR or IIR prior to segmentation). FBCSP only works for two classes. FBCSP is a state-of-the-art spatio-spectral filtering method and is on par with the alternative Spectrally Weighted Common Spatial Patterns (Spec-CSP) method. The main differences are that FBCSP uses predefined bands, while Spec-CSP optimizes the bands on the fly, which can work better, but can also fall short if the optimization ran into a bad local optimum. Since the method can be used with a number of standard frequency bands, it can be used in cases where the correct frequency band is not known, and as such it can be useful in settings where there is little established a priori knowledge on those bands, for instance EEG collected in non-traditional tasks. Since FBCSP will generate a relatively large number of features compared to CSP (by default on the order of 30), many of which are going to be uninformative, it is advisable to use a sparse classifier, such as sparse logistic regression on the resulting features. Tip: a continuous time series with markers can be segmented into multiple labeled trials / segments using the Assign Target Markers node followed by the Segmentation node. Version 1.0.0

Ports/Properties

data

Data to process.

verbose name
Data
default value
None
port type
DataPort
value type
Packet (can be None)
data direction
INOUT

nof

Number of pattern pairs to compute per band. This determines the number of output channels for the band ( which is 2x this value) and thus the dimensionality of the feature space. Typical values are 2-4; while one can generate more features ( up to the number of input channels), these will be increasingly less useful to the classifier.

verbose name
Number Of Pattern Pairs Per Band
default value
3
port type
IntPort
value type
int (can be None)

bands

Frequency bands of interest. This is a list of pairs of [low, high] entries, each of which defines another frequency band of interest. Example syntax: [[10,15],[7,30],[15,25]].

verbose name
Frequency Bands
default value
[[0.5, 3], [4, 7], [8, 12], [13, 30], [31, 42]]
port type
ListPort
value type
list (can be None)

shrinkage

Shrinkage coefficient for covariance matrix estimation.

verbose name
Shrinkage
default value
0
port type
FloatPort
value type
float (can be None)

min_fft_size

Minimum size of the FFT used in spectrum calculation. The chosen value is the greater of this and the next power of 2 greater than the length of the signal.

verbose name
Min Fft Size
default value
256
port type
IntPort
value type
int (can be None)

window_func

Type of window function to use. The data can optionally be windowed using this function, which is especially useful when multiple small overlapped windows are used.

verbose name
Window Function
default value
hann
port type
EnumPort
value type
str (can be None)

window_param

Window parameter. Needed to determine the shape of the window if using kaiser, gaussian, slepian, or chebwin.

verbose name
Window Parameter
default value
None
port type
ListPort
value type
list (can be None)

window_length

Length of overlapped windows in case of Welch spectral estimation. Using a smaller value (e.g., 1/4-1/8th of the chunk length) yields a smoother spectrum. The default is 1/2 of the chunk length.

verbose name
Window Length
default value
None
port type
IntPort
value type
int (can be None)

window_unit

Unit in which the window length is given.

verbose name
Window Length Unit
default value
samples
port type
EnumPort
value type
str (can be None)

overlap_length

Amount of overlap of successive windows in Welch method. The default is half of the window length.

verbose name
Overlap Length
default value
None
port type
IntPort
value type
int (can be None)

overlap_unit

Unit in which the overlap window length is given.

verbose name
Overlap Window Length Unit
default value
samples
port type
EnumPort
value type
str (can be None)

initialize_once

Do not recalibrate on subsequent offline chunks, even if they include target labels. If False, this node will recalibrate itself on any offline chunk that has data plus target labels.

verbose name
Calibrate Only Once
default value
True
port type
BoolPort
value type
bool (can be None)

cond_field

The name of the instance data field that contains the conditions to be discriminated. This parameter will be ignored if the packet has previously been processed by a DescribeStatisticalDesign node.

verbose name
Cond Field
default value
TargetValue
port type
StringPort
value type
str (can be None)

set_breakpoint

Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

verbose name
Set Breakpoint (Debug Only)
default value
False
port type
BoolPort
value type
bool (can be None)

metadata

User-definable meta-data associated with the node. Usually reserved for technical purposes.

verbose name
Metadata
default value
{}
port type
DictPort
value type
dict (can be None)