com.webkitchen.eeg.analysis
Class DualBandFilter

java.lang.Object
  extended by com.webkitchen.eeg.analysis.DualBandFilter
All Implemented Interfaces:
IChannelSampleListener, IDualBandSampleGenerator, java.util.EventListener

public class DualBandFilter
extends java.lang.Object
implements IChannelSampleListener, IDualBandSampleGenerator

Listens for new raw sample values, then filters the raw data into two frequency bands as described by our two filter specifications, and notifies listeners of the filtered values. Objects can add themselves as listeners/observers to receive copies of all new filtered samples.

See Also:
IDualBandSampleListener

Constructor Summary
DualBandFilter(FilterSpecification spec1, FilterSpecification spec2)
          Creates a new DualBandFilter that builds two IIRFilters to match the FilterSpecification parameters, and generates band sample values for the specified filter types
DualBandFilter(IIRFilter filter1, IIRFilter filter2)
          Creates a new DualBandFilter that uses the IIRFilter parameters to generate band sample values
 
Method Summary
 void addDualBandListener(IDualBandSampleListener listener)
          Attach listener to receive notification/copies of all new band values
 void receiveSample(double rawSample)
          Processes the sample to filter for our two frequency bands, and notifies our listeners of the latest band sample values
 void removeAllDualBandListeners()
          Remove all listeners from our notification list
 void removeDualBandListener(IDualBandSampleListener listener)
          Remove listener from our notification list
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DualBandFilter

public DualBandFilter(FilterSpecification spec1,
                      FilterSpecification spec2)
Creates a new DualBandFilter that builds two IIRFilters to match the FilterSpecification parameters, and generates band sample values for the specified filter types

Parameters:
spec1 - the specification we will use to design our first IIRFilter
spec2 - the specification we will use to design our second IIRFilter

DualBandFilter

public DualBandFilter(IIRFilter filter1,
                      IIRFilter filter2)
Creates a new DualBandFilter that uses the IIRFilter parameters to generate band sample values

Parameters:
filter1 - our first IIRFilter
filter2 - our second IIRFilter
Method Detail

receiveSample

public void receiveSample(double rawSample)
Processes the sample to filter for our two frequency bands, and notifies our listeners of the latest band sample values

Specified by:
receiveSample in interface IChannelSampleListener
Parameters:
rawSample - the raw sample that we will process

addDualBandListener

public void addDualBandListener(IDualBandSampleListener listener)
Attach listener to receive notification/copies of all new band values

Specified by:
addDualBandListener in interface IDualBandSampleGenerator
Parameters:
listener - the observer who wants to receive band values

removeDualBandListener

public void removeDualBandListener(IDualBandSampleListener listener)
Remove listener from our notification list

Specified by:
removeDualBandListener in interface IDualBandSampleGenerator
Parameters:
listener - the observer to remove

removeAllDualBandListeners

public void removeAllDualBandListeners()
Remove all listeners from our notification list

Specified by:
removeAllDualBandListeners in interface IDualBandSampleGenerator