Package com.webkitchen.eeg.analysis.filterdesign

Provides classes for designing Infinite Impulse Response (IIR) filters.

See:
          Description

Class Summary
FilterAlgorithm Specifies the algorithm/function used to design a filter, such as Butterworth, Bessel, or Chebyshev.
FilterDesigner Creates IIRFilters designed according to the algorithm and type provided in FilterSpecification objects.
FilterRange Specifies the range type used to design a filter, such as Bandpass, Lowpass, Highpass or Bandstop.
FilterSpecification Contains the filter specification information required for the FilterDesigner to create an IIRFilter.
IIRFilter Processes digital signal input to filter for specific frequencies.
 

Exception Summary
FilterDesignException Runtime exception thrown when the FilterDesigner is unable to create a new IIRFilter, usually due to inconsistent settings in the FilterSpecification.
 

Package com.webkitchen.eeg.analysis.filterdesign Description

Provides classes for designing Infinite Impulse Response (IIR) filters. To create a new IIRFilter, first create a FilterSpecification object which defines the filter specification. Then pass the FilterSpecification to the FilterDesigner's createFilter method.

This is based on Jim Peters' "Fidlib" digital filter designer code, which is based, in part, on Tony Fisher's "mkfilter" package.

Original source code and information on Jim Peters' Fidlib can be found at:
http://uazu.net/fiview/

Original source code and information on Tony Fisher's mkfilter can be found at:
http://www-users.cs.york.ac.uk/~fisher/mkfilter/

Sample Use

The following code sample shows sample usage:
public class SampleFilter implements IPlayerSampleListener
{
    private IIRFilter filter;

    public SampleFilter()
    {
        FilterSpecification spec = new FilterSpecification();
        spec.setDescription("Alpha band");
        spec.setAlgorithmType(FilterAlgorithm.BUTTERWORTH);
        spec.setRangeType(FilterRange.BANDPASS);
        spec.setOrder(5);
        spec.setRate(256);
        spec.setFrequency0(8);
        spec.setFrequency1(12);
        spec.setAutoAdjust(true);

        FilterDesigner designer = new FilterDesigner()
        filter = designer.createFilter(spec);
    }

    public void receiveSample(double rawSample)
    {
        double alphaValue = filter.process(rawSample);
        notifyListeners(alphaValue);
    }

    ...
}