CAR Filter implementation

Forum for discussion on different signal processing algorithms
Locked
dmgongora
Posts: 2
Joined: 10 Sep 2011, 21:12

CAR Filter implementation

Post by dmgongora » 01 Mar 2012, 21:51

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

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

Re: CAR Filter implementation

Post by mellinger » 02 Mar 2012, 08:43

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

dmgongora
Posts: 2
Joined: 10 Sep 2011, 21:12

Re: CAR Filter implementation

Post by dmgongora » 02 Mar 2012, 10:32

OK, thanks for such a quick fix(http://www.bci2000.org/tracproj/browser ... /carFilt.m).

And thanks for such an amazing tool.

Daniel

Locked

Who is online

Users browsing this forum: No registered users and 12 guests