Package Filters

Class IirfFilter

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

public class IirfFilter extends 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

  • Constructor Details

    • IirfFilter

      public IirfFilter(int channel, double sampleRate, FilterParams filterParams)
      Parameters:
      channel - Channel number
      filterParams - Parameters for filter operation
  • Method Details

    • setParams

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

      public void setParams(FilterParams filterParams)
      Sets parameters then calls stuff to work out all the filter coefficients, etc.
      Parameters:
      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()
    • resetFilter

      public void resetFilter()
    • 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(IIRFilterMethod 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.