Bandpass filter on AR filter chain

Forum for software developers to discuss BCI2000 software development
Locked
august
Posts: 8
Joined: 14 Aug 2011, 04:03

Bandpass filter on AR filter chain

Post by august » 24 Aug 2011, 03:59

I'm the newby to BCI2000. I'm working to implement the bandpass filter on AR filter chain. For now, I could create the NewBCI2000Filter following by the instruction from the Wiki. And I just did a step by step for the sample of LowPass filter but it also has some error too. So how could I implement the bandpass filter either by AR filter chain or other method? Please help

Best regard,
Aug

august
Posts: 8
Joined: 14 Aug 2011, 04:03

Re: Bandpass filter on AR filter chain

Post by august » 24 Aug 2011, 04:26

OK, I got it for the low pass filter :D and still working on the bandpass :idea:

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

Re: Bandpass filter on AR filter chain

Post by mellinger » 24 Aug 2011, 06:56

It might be of interest to you that there is a IIRFilterBase class in the src/shared/modules/signalprocessing directory, which may be used together with src/extlib/math/FilterDesign to create a user-configurable IIR filter.

There also exists a SourceFilter in src/shared/modules/signalsource which provides user-configurable high-pass, low-pass, and notch filters using IIRFilterBase and FilterDesign. For your project, it might be most efficient to copy and rename that filter, and adapt it to your needs. FilterDesign provides a Bandpass option as well as a the Lowpass/Highpass options used in the SourceFilter.

Juergen

august
Posts: 8
Joined: 14 Aug 2011, 04:03

Re: Bandpass filter on AR filter chain

Post by august » 31 Aug 2011, 05:17

mellinger wrote:It might be of interest to you that there is a IIRFilterBase class in the src/shared/modules/signalprocessing directory, which may be used together with src/extlib/math/FilterDesign to create a user-configurable IIR filter.

There also exists a SourceFilter in src/shared/modules/signalsource which provides user-configurable high-pass, low-pass, and notch filters using IIRFilterBase and FilterDesign. For your project, it might be most efficient to copy and rename that filter, and adapt it to your needs. FilterDesign provides a Bandpass option as well as a the Lowpass/Highpass options used in the SourceFilter.

Juergen
Dear Juergen,

Thank you very much for your advised, I'm trying to edit the SourceFilter as your advise. But I still have some problem, I would like to know how to build that SourceFilter or it was already in BCI2000Luncher or anything else, how could I get the result from this filter, guide me please. Sorry for my noob and newby :)

Best regard,
Aug

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

Re: Bandpass filter on AR filter chain

Post by mellinger » 31 Aug 2011, 10:05

Dear August,

you are welcome to ask questions here. BCI2000 is evolving constantly, so not everything is documented on the wiki. Your questions help us know how to improve documentation.

The SourceFilter is a special filter which is used in certain source modules, e.g. in the gMOBIlab and gMOBIlabPlus source modules. These amplifiers don't have hardware filters built-in, so the SourceFilter is provided as a substitute. The SourceFilter is special in that it operates on the signal acquired from the amplifier before it gets saved to disk -- all other BCI2000 filters only operate after the signal has been saved to disk, so they don't affect the recording.

There is currently no signal processing module that contains the SourceFilter, but the following should work:
*Choose a Signal Processing Module that most closely resembles your needs.
*Edit that Signal Processing Module's CMakeLists.txt file. Above the line beginning with BCI2000_ADD_..., add a line that says
BCI2000_INCLUDE( "SOURCEFILTER" )
*Edit the module's PipeDefinition.cpp file. Add two lines
#include "SourceFilter.h"
Filter( SourceFilter, 2.0 )
*The second argument to the Filter() statement is a string that defines the filter's position in the filter chain, by string comparison with other filters' position strings. If you don't want the SourceFilter to appear first in the chain, you may choose a different string there.

Regards,
Juergen

august
Posts: 8
Joined: 14 Aug 2011, 04:03

Re: Bandpass filter on AR filter chain

Post by august » 05 Sep 2011, 04:57

mellinger wrote:Dear August,

you are welcome to ask questions here. BCI2000 is evolving constantly, so not everything is documented on the wiki. Your questions help us know how to improve documentation.

The SourceFilter is a special filter which is used in certain source modules, e.g. in the gMOBIlab and gMOBIlabPlus source modules. These amplifiers don't have hardware filters built-in, so the SourceFilter is provided as a substitute. The SourceFilter is special in that it operates on the signal acquired from the amplifier before it gets saved to disk -- all other BCI2000 filters only operate after the signal has been saved to disk, so they don't affect the recording.

There is currently no signal processing module that contains the SourceFilter, but the following should work:
*Choose a Signal Processing Module that most closely resembles your needs.
*Edit that Signal Processing Module's CMakeLists.txt file. Above the line beginning with BCI2000_ADD_..., add a line that says
BCI2000_INCLUDE( "SOURCEFILTER" )
*Edit the module's PipeDefinition.cpp file. Add two lines
#include "SourceFilter.h"
Filter( SourceFilter, 2.0 )
*The second argument to the Filter() statement is a string that defines the filter's position in the filter chain, by string comparison with other filters' position strings. If you don't want the SourceFilter to appear first in the chain, you may choose a different string there.

Regards,
Juergen
Dear Juergen,

Thank you very much for your willing to help. But I still have a problem with "Unknown CMake command "BCI2000_INCLUDE"." when I try to build the project. So any suggestion? Thanks again.

Best regard,
Aug

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

Re: Bandpass filter on AR filter chain

Post by mellinger » 05 Sep 2011, 08:15

August,

you need to update to the latest version of BCI2000 from SVN. There has been a change to the CMake system recently.

Regards,
Juergen

august
Posts: 8
Joined: 14 Aug 2011, 04:03

Re: Bandpass filter on AR filter chain

Post by august » 25 Sep 2011, 09:36

mellinger wrote:August,

you need to update to the latest version of BCI2000 from SVN. There has been a change to the CMake system recently.

Regards,
Juergen
Dear Juergen,

Thank you so much for your willing to help :)

Best regard,
Aug

Locked

Who is online

Users browsing this forum: No registered users and 1 guest