Filters
Class IirfFilter

java.lang.Object
  extended by Filters.IirfFilter
All Implemented Interfaces:
Filter

public class IirfFilter
extends java.lang.Object
implements Filter

Author:
Doug Gillespie

Digital filtering with Infinite Impulse Response filter functions A new instance of this class must be created for each channel


Nested Class Summary
(package private)  class IirfFilter.FilterNotPair
           
(package private)  class IirfFilter.FilterPair
           
(package private)  class IirfFilter.FilterUnit
           
 
Field Summary
private  int channel
           
private  double filterGainConstant
           
private  FilterMethod filterMethod
           
private  FilterParams filterParams
           
private  IirfFilter.FilterUnit[] filterUnits
           
private  int nPoleZeroPairs
           
private  Complex[] poles
           
private  PamRawDataBlock rawDataBlock
           
private  float sampleRate
           
private  Complex[] zeros
           
 
Constructor Summary
IirfFilter(int channel, FilterParams filterParams, float sampleRate)
           
 
Method Summary
 int getFilterDelay()
          Gets the delay of the filter - rarely used, but can be important for some processing tasks.
 FilterMethod getFilterMethod()
           
 void prepareFilter()
          Calculates the poles and zeros for the filter and sets up any memory buffers required during real time operation.
 double runFilter(double aData)
          Runs the filter on a single data value
 void runFilter(double[] inputData)
          Runs the filter on an array of data
 void runFilter(double[] inputData, double[] outputData)
          Runs the filter on an array of data
 void sayFilter()
           
 void setFilterMethod(FilterMethod filterMethod)
           
 void setParams(FilterParams filterParams)
           
 void setParams(int channel, FilterParams filterParams, float sampleRate)
           
private  void setupRTOperation()
          Setup buffers and filter pairs for real time operation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

channel

private int channel

filterParams

private FilterParams filterParams

rawDataBlock

private PamRawDataBlock rawDataBlock

filterMethod

private FilterMethod filterMethod

poles

private Complex[] poles

zeros

private Complex[] zeros

nPoleZeroPairs

private int nPoleZeroPairs

sampleRate

private float sampleRate

filterUnits

private IirfFilter.FilterUnit[] filterUnits

filterGainConstant

private double filterGainConstant
Constructor Detail

IirfFilter

public IirfFilter(int channel,
                  FilterParams filterParams,
                  float sampleRate)
Parameters:
channel - Channel number
filterParams - Parameters for filter operation
Method Detail

setParams

public void setParams(int channel,
                      FilterParams filterParams,
                      float sampleRate)

setParams

public void setParams(FilterParams filterParams)

prepareFilter

public void prepareFilter()
Description copied from interface: Filter
Calculates the poles and zeros for the filter and sets up any memory buffers required during real time operation.

Specified by:
prepareFilter in interface Filter

sayFilter

public void sayFilter()

setupRTOperation

private void setupRTOperation()
Setup buffers and filter pairs for real time operation


runFilter

public void runFilter(double[] inputData)
Description copied from interface: Filter
Runs the filter on an array of data

New values overwrite the old values in the array.

Specified by:
runFilter in interface Filter

runFilter

public void runFilter(double[] inputData,
                      double[] outputData)
Description copied from interface: Filter
Runs the filter on an array of data

New values write into the output data array.

Specified by:
runFilter in interface Filter

runFilter

public double runFilter(double aData)
Description copied from interface: Filter
Runs the filter on a single data value

Specified by:
runFilter in interface Filter
Returns:
New data value

getFilterMethod

public FilterMethod getFilterMethod()

setFilterMethod

public void setFilterMethod(FilterMethod filterMethod)

getFilterDelay

public int getFilterDelay()
Description copied from interface: Filter
Gets the delay of the filter - rarely used, but can be important for some processing tasks. For an IIRF filter, this would be half the number of poles, for a moving average or median filter it would be half the filter length.

Specified by:
getFilterDelay in interface Filter
Returns:
filter delay in samples.