Input data dimension inconsistency in P300 Linear Classifier

Forum for discussion on different signal processing algorithms
Locked
Ray Ma
Posts: 14
Joined: 15 Feb 2010, 16:39

Input data dimension inconsistency in P300 Linear Classifier

Post by Ray Ma » 26 Apr 2010, 23:11

Hi,

I noticed that there's an inconsistency between the dimensions of input variables in the following code:

Code: Select all

GenericFilter::ProcessFilters( const GenericSignal& Input, GenericSignal& Output )
{
  const GenericSignal* currentInput = &Input;
  ...
}
Here, I used 8 channels, 400Hz sampling rate, and after setting the "epochLength" to be 400ms, the "Input" is 8 x 8, whereas the "currentInput" is 8 x 160. The "Input" comes in 8-sample-point bundles from the ADC, while 400Hz x 400ms = 160 sample points.

This is causing the "currentInput" to be all-zeros. Since it is the input to the P300 Linear Classifier, the classifier is getting all-zero inputs and generating all-zero outputs.

Some further exploration seemed to suggest the following code was the source of the dimension mismatch, when the currentFilter is the P3TemporalFilter, it introduced the mismatch at the first arrival of 8-sample-point bundle:

Code: Select all

GenericFilter::ProcessFilters( const GenericSignal& Input, GenericSignal& Output )
{ ...  
  for( ... )
  { ...
    GenericSignal& currentOutput = OwnedSignals()[ currentFilter ];
  }
}
Could anybody share some thoughts how to solve this problem? Thanks very much!

Ray

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

Post by mellinger » 27 Apr 2010, 09:26

Ray,

the GenericFilter::ProcessFilters() code is common to all BCI2000 modules. The dimensions of a filter's output signal depends on the SignalProperties requested by that filter during its Preflight() member.

Regarding the P3TemporalFilter, its output is actually supposed to be all zeros most of the time. Only when an epoch has finished, and the number of epochs in the associated stimulus code's epoch buffer matches the EpochsToAverage parameter, the P3TemporalFilter computes the epoch average, and sets the StimulusCodeRes and StimulusTypeRes states to that stimulus code and its stimulus type, respectively. The application module monitors these two state variables, accumulates LinearClassifier output for all values of StimulusCodeRes, and decides which target was selected based on the associated control signals.

More information is available on the the P3TemporalFilter's wiki page.

Regards,
Juergen

Locked

Who is online

Users browsing this forum: No registered users and 1 guest