about the xDAWN filter

Concerning processing components: filters, file load/save, visualizations, communication ...
Post Reply
ddvlamin
Posts: 160
Joined: Thu Aug 13, 2009 8:39 am
Location: Ghent University
Contact:

about the xDAWN filter

Post by ddvlamin »

Hi,

I wanted to analyze our P300 recordings in Matlab and to this end I also wanted to computer the xDAWN spatial filters. Based on the paper it seemed easy to do in Matlab as it can be simply computed by a generalized eigenvalue decomposition. However, when I did the computation in Matlab, this resulted in different spatial filters as the one obtained from OpenViBE.

The one OpenVibe computed looked like that

Image

and the one I computed looked like that

Image

So I went looking in the code of OpenViBE and it appears you don't solve the least squares problem as stated in the paper to compute the "noise free" evoked potentials? I think you computed the average off all evoked potentials, which also seems a reasonable approach as it should be a estimate that is close to the one computed by the least squares (intuitively). So I recomputed the whole thing but now according to the averaged evoked potentials and this resulted in the following filter

Image

which still looks very similar to my first computed spatial filter in the second picture. Meaning that indeed the least-square approach and the averaging approach result in very similar filters. So I looked further to see what is different in the OpenVibe code and found that you computed the numerator matrix

Code: Select all

(l_oAveragedERPMatrix*itpp::inv(l_oDMatrix.transpose()*l_oDMatrix)*l_oAveragedERPMatrix.transpose())
So my question is what is the inverse doing there (I don't see that in the paper). To verify this I also computed the inverse there and then this resulted in the following filter

Image

which looks very similar (although still not the same) as the filter computed by OpenViBE.

So my question is, what am I doing wrong?

EDIT: seems like the OpenViBE filter works definitely better than the one I computed, so I'm doing something wrong, but what....

This is roughly the code I used in Matlab

Code: Select all

A = ((D'*D)\(D'*data'));
[W,dd]=eig((data*data')\(A'*D'*D*A));
where D and A represent the same matrices as in the paper and data is the signal (filtered in some passband)

Best regards,
Dieter Devlaminck
Last edited by ddvlamin on Tue Nov 09, 2010 2:55 pm, edited 1 time in total.

ddvlamin
Posts: 160
Joined: Thu Aug 13, 2009 8:39 am
Location: Ghent University
Contact:

Re: about the xDAWN filter

Post by ddvlamin »

Ok, never mind, I found my mistake, I constructed the matrix D in the wrong way (accidentally I included all trials, which of course defeats the purpose of the method).

There doesn't seem to be much difference between taking the least squares estimate and the classic average.

this topic can be deleted as it doesn't serve any purpose, except showing my stupidity :)

yrenard
Site Admin
Posts: 645
Joined: Fri Sep 01, 2006 3:39 pm
Contact:

Re: about the xDAWN filter

Post by yrenard »

Dear ddvlamin,

sorry for late reaction to your messages. I'm happy that you find your mistake on your own. By the way are you experiencing any problem with the xDAWN based speller ? A few people are reporting bad results since the 0.8.0 release.

Regards,
Yann

Post Reply