Package Filters

Class FastIIRFilter

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

public class FastIIRFilter extends Object implements Filter
This has the same functionality as IirfFilterm. It still works on a series of biquad pairs, the difference being that all the biquad pairs are merged into a single history and a single loop through the filter coefficients. This is more confusing to read, but it runs a fair bit quicker than having to call into multiple FilterPair objects and keeping separate history for each pair.
Author:
Doug Gillespie
  • Constructor Summary

    Constructors
    Constructor
    Description
    FastIIRFilter(int channel, double sampleRate, FilterParams filterParams)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Gets the delay of the filter - rarely used, but can be important for some processing tasks.
    void
    Calculates the poles and zeros for the filter and sets up any memory buffers required during real time operation.
    double
    runFilter(double aVal)
    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

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FastIIRFilter

      public FastIIRFilter(int channel, double sampleRate, FilterParams filterParams)
  • Method Details

    • 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
    • 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 aVal)
      Description copied from interface: Filter
      Runs the filter on a single data value
      Specified by:
      runFilter in interface Filter
      Returns:
      New data value
    • 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.