Page 1 of 1

FeedbackDemo

Posted: 20 May 2019, 10:29
by tristanvenot
Hi,

I am a Master degree student working on a project of BCI and I am trying to understand how the feedback demo of the ball reacting to a cortex activity work. I don't know how the position in Y-axis evolves since i don't know how to access to the code which deals with the control signal : I found the part of the code for its incrementation :

Code: Select all

void FeedbackDemoTask::DoFeedback( const GenericSignal& ControlSignal, bool& doProgress )
{
  mCursorPosX += mCursorSpeedX;
  mCursorPosY -= mCursorSpeedY * ControlSignal( 0, 0 );
  mpCursor->Left = mCursorPosX;
  mpCursor->Top = mCursorPosY - mpCursor->Height / 2;
  if( mpCursor->Top < 0 )
    mpCursor->Top = 0;
  else if( mpCursor->Top > mpForm->Height - mpCursor->Height )
    mpCursor->Top = mpForm->Height - mpCursor->Height;

  if( mCursorPosX + mpCursor->Width / 2 >= mpForm->Width - mpTarget->Width )
  { // Right margin hit:
    doProgress = true;
    int result = ::floor( mCursorPosY * Parameter( "NumberTargets" ) / mpForm->Height ) + 1;
    if( result < 1 )
      result = 1;
    else if( result > Parameter( "NumberTargets" ) )
      result = Parameter( "NumberTargets" );
    State( "ResultCode" ) = result;
  }
}
But I don't know where the ControlSignal is modified and how.

Thank you very much in advance,
Regards,
Tristan Venot

Re: FeedbackDemo

Posted: 20 May 2019, 11:22
by mellinger
Hi,

the control signal is the output of the signal processing module. Its dimensions are controlled by the LinearClassifier filter:
https://www.bci2000.org/mediawiki/index ... Classifier

The control signal is also zero mean and unit variance in all of its dimensions, and normalization is provided by the Normalizer filter:
https://www.bci2000.org/mediawiki/index ... Normalizer

Between signal processing and application module, data is sent and received through a socket connection as a BCI2000 signal message but there is little to learn from the respective code, which is part of the BCI2000 framework. Rather, the information that you need is probably here:
https://www.bci2000.org/mediawiki/index ... n_Overview

Let me know if you need further information.

Re: FeedbackDemo

Posted: 22 May 2019, 09:43
by tristanvenot
Hi,

Thank you very much, that was exactly the information I was looking for!

Regards,
Tristan V.