Remove the mean continuously

Forum for software developers to discuss BCI2000 software development
Locked
gsudre
Posts: 22
Joined: 05 Mar 2008, 17:03

Remove the mean continuously

Post by gsudre » 15 Jul 2008, 09:56

Hello,

I'm trying to make a small modification to the LinearClassifier so that, before it applies the weight, it removes the mean of that input over a period of time. I tried implementing it by using a 2-dimensional vector (EntriesInTable X BufferLength). I update the buffer for every iteration of the program and calculate the mean before applying the classifier weights.

The problem I have is that my processor usage goes up to 100% even before it reaches the point to update the buffer (before the buffer length is reached). Is there a better way to implement this? I can send chunks of code if necessary.

Thanks,

Gus

gschalk
Posts: 615
Joined: 28 Jan 2003, 12:37

mean subtraction ...

Post by gschalk » 15 Jul 2008, 15:16

Gus,

Calculating the mean for a particular feature for a given period of time should not take much time regardless of how it's implemented, so the 100% CPU load very strongly indicates a programming error.

What you could do is to implement an very simple IIR filter where

mean_new=(1-learning_rate)*mean_old+learning_rate*current_sample

or so. This will be computationally very simple, but as I mentioned, there is most likely a programming error in what you do at the moment.

Gerv

gsudre
Posts: 22
Joined: 05 Mar 2008, 17:03

Post by gsudre » 17 Jul 2008, 17:16

Gerv,

Thanks for the advice. The IIR filter worked fine.

Best,

Gus

Locked

Who is online

Users browsing this forum: No registered users and 0 guests