zero phase filter in BCI2000?

Forum for software developers to discuss BCI2000 software development
Locked
shjlynn
Posts: 22
Joined: 27 Dec 2010, 08:28

zero phase filter in BCI2000?

Post by shjlynn » 01 Aug 2012, 00:04

hi,

I wonder if there is a zero-phase digital filter in BCI2000 program, which correspond to the function "filtfilt" in Matlab.

thx

Haijun

boulay
Posts: 382
Joined: 25 Dec 2011, 21:14

Re: zero phase filter in BCI2000?

Post by boulay » 01 Aug 2012, 22:56

filtfilt runs through the data forwards then backwards. Running backwards through the data is not possible online.

It might be possible to implement a zero phase filter using the FIRProcessing module, but that's beyond my ability.

If you can share some details about the application, then people might be able to give you better suggestions. For example, if you are trying to trigger a stimulus exactly at the trough of an oscillation then you might encounter other delays in the generation of your stimulus. It might be better to first determine the phase delay of your filter and the system delay of your stimulus then try to time the stimulus so that it occurs on the NEXT trough.

shjlynn
Posts: 22
Joined: 27 Dec 2010, 08:28

Re: zero phase filter in BCI2000?

Post by shjlynn » 02 Aug 2012, 13:33

hey, thank you.
I just want to use the Evelope as the output to control the cursor movement. So first, I filtfilt certain frequency bands, then do Hilbert transform and get the Evelope.
I've tried it in Matlab, only function "filtfilt" will result in good pattern, function like "filter" does not work well.

Haijun
boulay wrote:filtfilt runs through the data forwards then backwards. Running backwards through the data is not possible online.

It might be possible to implement a zero phase filter using the FIRProcessing module, but that's beyond my ability.

If you can share some details about the application, then people might be able to give you better suggestions. For example, if you are trying to trigger a stimulus exactly at the trough of an oscillation then you might encounter other delays in the generation of your stimulus. It might be better to first determine the phase delay of your filter and the system delay of your stimulus then try to time the stimulus so that it occurs on the NEXT trough.

boulay
Posts: 382
Joined: 25 Dec 2011, 21:14

Re: zero phase filter in BCI2000?

Post by boulay » 03 Aug 2012, 00:01

You can try using the HilbertSignalProcessing contributed module. I've never used it but it looks straightforward. If you have some data you can try using this module offline. Here's a recent post from Juergen about how to use these filters for offline analysis:
http://www.bci2000.org/phpbb/viewtopic. ... 4728#p4728
the MatlabFilter is useful if you want to process data online, using Matlab code.

What you want to do is to process data offline, using existing BCI2000 filters. This can be done from the command line, without using Matlab:
http://www.bci2000.org/wiki/index.php/U ... Processing

In addition, there exists a Matlab wrapper function for command line processing, which makes it very comfortable to use:
http://www.bci2000.org/wiki/index.php/U ... i2000chain
The HilbertSignalProcessing module can be found here:
http://www.bci2000.org/wiki/index.php/B ... buted_Code

Locked

Who is online

Users browsing this forum: No registered users and 2 guests