correlation value as an output to application module

Forum for software developers to discuss BCI2000 software development
Locked
shjlynn
Posts: 22
Joined: 27 Dec 2010, 08:28

correlation value as an output to application module

Post by shjlynn » 26 Jul 2012, 01:18

hi,

I'm trying to write a new signal processing module to combine with other part of BCI2000 system.
In my new classifying algorithm, using frequency features as classifier patterns, which are extracted from motor-imagery EEG data during offline analysis, so during online processing, correlation is calculated between every new incoming sampleblock data and Left/Right pattern to decide cursor move to right or left.

So my question is : In the cursor task control paradigm, can I use the correlation value to real-time control the cursor's movement. If possible, how to decide how big every step should be?

thank you

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

Re: correlation value as an output to application module

Post by mellinger » 26 Jul 2012, 06:10

Hi,
correlation is calculated between every new incoming sampleblock data and Left/Right pattern to decide cursor move to right or left.
I'm not sure what that means in exact terms, but I suppose you have a single pattern that you use to discriminate between left and right, and you compute correlation between that pattern, and incoming data features for each sample block.

in BCI2000, the output signal of the signal processing module, i.e. the control signal, is supposed to have zero mean, and unit variance, with mean and variance being calculated from an equal amount of data from each possible target/task condition.

There exists a Normalizer filter which should be last in your Signal Processing chain. You can do an offline analysis of the output of your correlation computation, in order to determine its mean and variance, and then use the Normalizer filter's gain and offset parameters in order to remove that mean, and divide by the square root of that variance.

Or, you let the Normalizer filter do continuous adaptation of mean and offset.

For more information about the Normalizer filter, see
http://www.bci2000.org/wiki/index.php/U ... Normalizer

Regards,
Juergen

shjlynn
Posts: 22
Joined: 27 Dec 2010, 08:28

Re: correlation value as an output to application module

Post by shjlynn » 27 Jul 2012, 12:31

Hi, thank you
what if I only make use of "SpatialFilter ", "ExpressionFilter" in the filter chain, between them, I write a my own signal processing filter that are used to extract frequency feature and classify left and right. So in my design, the output of the SignalProcessing Module to application is the correlation value(range (0 1)) between incoming sampledata and Left/right motor imgery pattern. And directly take the correlation value as control signal, without Normalization.

Will that work?

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

Re: correlation value as an output to application module

Post by mellinger » 27 Jul 2012, 12:49

I don't know what your application module looks like, but it will expect a certain range of input which is large enough for the user to recognize any feedback, and staying within certain limits so feedback does not saturate (e.g., cursor constantly staying at the edge of the monitor, or whatever).

Thus, for any kind of feedback, be it your own written application module, or the CursorTask application module coming with BCI2000, you will need to make sure that the above conditions are met, i.e. you will need to somehow obtain a measure of your signal's mean, and a measure of your signal's variance, and linearly transform your signal according to that measurement.

To make things easier, BCI2000 defines that the control signal should have zero mean, and unit variance. Thus, an application module need not be informed about any signal range, which improves modularity because less information needs to be shared between SignalProcessing and Application module.

Of course, you may write a SignalProcessing module that has any scaling of output. Just don't expect it to work with existing Application modules.

HTH,
Juergen

shjlynn
Posts: 22
Joined: 27 Dec 2010, 08:28

Re: correlation value as an output to application module

Post by shjlynn » 27 Jul 2012, 13:09

Hi, Juergen

I use the Cursor task as the application module. I thought maybe I still need Normalizer filter at the end of filter chain, otherwise, the output of signalprocessing filter, i.e. correlation value, is just ranging from 0 to 1 which is not large enough to move the cursor in big steps, even when the incoming data matches the pattern very well.

I think if I set the correlation value to (0 1) when classifying results belong to left, and (-1 0) when it belongs to right. I guess that will work for a normal cursor movement control.

best
Haijun
mellinger wrote:I don't know what your application module looks like, but it will expect a certain range of input which is large enough for the user to recognize any feedback, and staying within certain limits so feedback does not saturate (e.g., cursor constantly staying at the edge of the monitor, or whatever).

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

Re: correlation value as an output to application module

Post by mellinger » 27 Jul 2012, 13:31

I think if I set the correlation value to (0 1) when classifying results belong to left, and (-1 0) when it belongs to right. I guess that will work for a normal cursor movement control.
So it seems you have not a single correlation pattern that is able to discriminate between left and right, but two correlation patterns that detect "left" and "right" separately? Why so?

Also, are you doing two-dimensional feedback, moving up when your classification result is "left", and to the left when your classification result is "right"? Otherwise, you should choose (-1 0) for "left", and (1 0) for "right". Still, this will just be a crude form of normalization, resulting in a loss of information in comparison to the usual way of normalizing the control signal.

Regards,
Juergen

Locked

Who is online

Users browsing this forum: No registered users and 2 guests