Page 1 of 1

CAR Filter implementation

Posted: 01 Mar 2012, 21:51
by dmgongora
Hi everyone,
I've a little question concerning the implementation of the CAR filter in the offline analysis tool. Concretely, the carFilt.m performs CAR filtering on the specified signal.

Code: Select all

spatfiltmatrix=-ones(num_chans);
for i=1:num_chans
 spatfiltmatrix(i, i)=num_chans-1;
end

signalOut=double(signal)*spatfiltmatrix;
However, by the end of the computations. Shouldn't the variable signalOut be divided by the number of channels? I mean, according to "A Practical Guide to Brain Computer Interfacing with BCI", the sum of the signal from all the channels(divided by the number of channels H) is substracted from the specified signal(s_h). But the matrix multiplication produces (H)s_h'=(H-1)s_h-SumOfTheRestOfTheChannels.

What am I missing?

Daniel

Re: CAR Filter implementation

Posted: 02 Mar 2012, 08:43
by mellinger
Hi,

that computation was clearly wrong, I fixed it on SVN. Thanks for notifying!

As you point out, the result differed from correct CAR filtering only by a constant factor of H, such that r^2 statistics were still correct. Amplitudes themselves, however, were off by a factor of H.

Regards,
Juergen

Re: CAR Filter implementation

Posted: 02 Mar 2012, 10:32
by dmgongora
OK, thanks for such a quick fix(http://www.bci2000.org/tracproj/browser ... /carFilt.m).

And thanks for such an amazing tool.

Daniel