Page 1 of 1

Bandpass filter on AR filter chain

Posted: 24 Aug 2011, 03:59
by august
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

Re: Bandpass filter on AR filter chain

Posted: 24 Aug 2011, 04:26
by august
OK, I got it for the low pass filter :D and still working on the bandpass :idea:

Re: Bandpass filter on AR filter chain

Posted: 24 Aug 2011, 06:56
by mellinger
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

Re: Bandpass filter on AR filter chain

Posted: 31 Aug 2011, 05:17
by august
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

Re: Bandpass filter on AR filter chain

Posted: 31 Aug 2011, 10:05
by mellinger
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

Re: Bandpass filter on AR filter chain

Posted: 05 Sep 2011, 04:57
by august
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

Re: Bandpass filter on AR filter chain

Posted: 05 Sep 2011, 08:15
by mellinger
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

Re: Bandpass filter on AR filter chain

Posted: 25 Sep 2011, 09:36
by august
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