# OpenViBE forum

The OpenViBE community
 It is currently Fri Feb 28, 2020 8:15 am

 All times are UTC

 Page 1 of 1 [ 8 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: spatial filterPosted: Wed Oct 14, 2009 11:31 am

Joined: Thu Jul 02, 2009 12:05 pm
Posts: 15
Hi there,

I am creating a new scenario on openeeg. Basically i already built the steps and placed all the boxes i need to work with.
now i am trying to properly set the parameters according with the pre-recorded data i am using.

I am stuck at spatial filter box. I wonder what values i need to put in the parameter "spatial filter coefficients".

i looked at the parameters of spatial filter box from a sample scenario of openvibe, see bellow:
Spatial Filter Coefficients: 4 0 -1 0 -1 -1 0 0 -1 0 0 4 0 -1 0 0 -1 -1 0 -1 (20 values)
Number of Output channels: 2
Number of Input channels: 10

So, I see the spatial filter coefficients are related to the input signal channels. The channel selector box of the sample scenario contains:
Channels List: C3;C4;FC3;FC4;C5;C1;C2;C6;CP3;CP4 (10 channels)

i wonder if my intuition is correct: from 10 channels to 20 values , does it make sense?

So, on my channel selector box i have the channels
Channels List: C3;C4;Cz;F3;F4;P3;P4;O1;O2; (9 channels)

as i have 9 channels on my channel selector, i must have 18 values in the spatial coefficients.
That's why i set: Spatial Filter Coefficients: 4 0 -1 0 -1 0 0 -1 0 0 4 0 -1 0 0 -1 0 -1

although, i strongly believe that the values and its positions must be properly synchronized to each channel, however i need some definitions: (p.s. i am concerned what a spatial filter does).
a) what is the spatial filter coefficients?
b) what does it do?
c) what would be the correct values to set on it according with my channels list?

cheers,

Top

 Post subject: Re: spatial filterPosted: Wed Oct 14, 2009 12:14 pm

Joined: Fri Sep 01, 2006 3:39 pm
Posts: 645
Iuri,

the spatial filter generates a number of output channels from another number of input channels, each output channel being a linear combination of the input channels.
For example, lets say ICj is the jth input channel, OCk is the kth output channel, and Sjk is the coefficient for the jth input channel and kth output channel in the Spatial filter matrix.

Then the output channels are computed this way :

OCk = Sum on j ( Sjk * ICj )

Is it clear to you what the spatial filter does ?

For the coefficient orders, all the coefficients for the first output followed by all the coefficients for the second output and so on...

In the example you point out (guess it is the motor imagery BCI), you have :
Quote:
Spatial Filter Coefficients: 4 0 -1 0 -1 -1 0 0 -1 0 0 4 0 -1 0 0 -1 -1 0 -1 (20 values)
Number of Output channels: 2
Number of Input channels: 10
Channels List: C3;C4;FC3;FC4;C5;C1;C2;C6;CP3;CP4 (10 channels)

So the output channels are :

OC1 = 4 * C3 + 0 * C4 + (-1) * FC3 + 0 * FC4 + (-1) * C5 + (-1) * C1 + 0 * C2 + 0 * C6 + (-1) * CP3 + 0 * CP4 = 4 * C3 - FC3 - C5 - C1 - CP3
OC2 = 0 * C3 + 4 * C4 + 0 * FC3 + (-1) * FC4 + 0 * C5 + 0 * C1 + (-1) * C2 + (-1) * C6 + 0 * CP3 + (-1) * CP4 = 4 * C4 - FC4 - C2 - C6 - CP4

This is basically a Surface Laplacian around C4 and C5.

For your question what would be the correct values to set on it according with my channels list, I would answer depends on what you want to do. In the case of the motor imagery, we wanted to reduce noise and this gave good results.

Hope this helps,
Best regards,
Yann

Top

 Post subject: Re: spatial filterPosted: Wed Oct 14, 2009 12:42 pm

Joined: Fri Sep 01, 2006 3:39 pm
Posts: 645
iuri,

as I was writing my last message, I realized that the documentation for the spatial filter was almost empty so I used our discussion to update this documentation. You can see it on the spatial filter dedicated page. I'm waiting for your feedback

Best regards,
Yann

Top

 Post subject: Re: spatial filterPosted: Wed Oct 14, 2009 1:46 pm

Joined: Thu Jul 02, 2009 12:05 pm
Posts: 15
and from where did you take the coefficients?
4 0 -1 0 -1 -1 0 0 -1 0 0 4 0 -1 0 0 -1 -1 0 -1

i opened the .gdf i am using, in order to see from where the coefficients come.
But i don't find any reference of them. It means, there is no such a structure in the gdf file that stores the spatial filter coefficients

are you using covariance matrices to calculate them? or i am totally wrong here. am i ?

ps. yes, i am using the sample file real-hand-movements.gdf from openvibe

very good! as the time i learn we both contribute on documentation!

Top

 Post subject: Re: spatial filterPosted: Wed Oct 14, 2009 3:24 pm

Joined: Fri Sep 01, 2006 3:39 pm
Posts: 645
Iuri,

you're right, those coefficients aren't stored in the GDF file. They are part of the signal processing pipeline we used for motor movement imagination (the GDF file only contains signal, no signal processing there).

Such coefficients could be learned or optimized offline from previously recorded signals... This is what's done e.g. in the xDAWN algorithm for P300 enhancement. But in our case, we fixed them by hand in order to have a surface laplacian as I said before.

I hope that clears the situation.
Best regards,
Yann

Top

 Post subject: Re: spatial filterPosted: Thu Oct 15, 2009 1:42 pm

Joined: Thu Jul 02, 2009 12:05 pm
Posts: 15
Yann,

I changed the spatial coefficients to some different positions in attempt to have similar results of the motor imagery sample available on openvibe.

However, the resulting presentation seems to be not calibrated. Which means, after whatever red arrow comes up (i.e. left or right), the blue bar always shows up on the right with its maximum length. Instead of be synchronized.

It turned out to be a "trial by error procedure" to get the properly results synchronized to the arrows.
as it is 18 values i get a 18! possibilities of trials to find the properly combination and succeed!
That's just nonsense

Top

 Post subject: Re: spatial filterPosted: Thu Oct 15, 2009 4:59 pm

Joined: Fri Sep 01, 2006 3:39 pm
Posts: 645
Iuri,

you are right, this is non sense. There's no chance you can optimize the filter by hand. Surface Laplacian is a very specific filter know to have particular properties, this is why we fixed it by hand - but we did not try to optimize it, we just fixed it. We did not play with the coefficients by hand !! Never. As I said before and I may have not been clear enough, such spatial filter can be trained or optimized. This is an offline process. Check the xDAWN article I pointed out for an example.

Now for what you're trying to do, obviously, you seem not to have any spatial filter trainer / optimizer available. So consider using something similar to the Surface Laplacian (that basically computes a 2D derivate over the scalp). Or avoid using spatial filter at all.

Also, it is not clear to me whether you re-trained the classifier or not...

Best regards,
Yann

Top

 Post subject: Re: spatial filterPosted: Tue Oct 20, 2009 12:24 pm

Joined: Thu Jul 02, 2009 12:05 pm
Posts: 15
Hi yann,

I need to learn about laplacian surfaces read xDAWN article again and understand the process described on it, in order to calculate the best coefficients to the spatial filter. I let you know about.

I tried to run the program without spatial classifier at all (in the offline training and in the online classifier) and it didn't present the properly results, i.e. the blue-bar was not balanced.

Yes i did re-train the classifier

cheers,

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 8 posts ]

 All times are UTC

#### Who is online

Users browsing this forum: No registered users and 1 guest

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ General    OpenViBE News    Discussion about OpenViBE    Discussion about BCI and related topics    Feature Requests Using OpenViBE components    Acquisition server and drivers    Designer    Boxes OpenViBE scenarios    Scenarios and BCI design    Tutorial scenarios OpenViBE-related development    Help for building the software    Box and application development    Driver development    Kernel development