Class ARSV1Filter

java.lang.Object
com.io7m.aradine.filter.statevar1.ARSV1Filter
All Implemented Interfaces:
ARSV1FilterType

public final class ARSV1Filter extends Object implements ARSV1FilterType

A variable state filter providing simultaneous low/high/bandreject/bandpass outputs.

This filter benefits from oversampling to improve stability; call processOneFrame(double) multiple times with the same input sample, and discard all but the last output.

See Also:
  • "https://www.earlevel.com/main/2003/03/02/the-digital-state-variable-filter/"
  • Constructor Details

    • ARSV1Filter

      public ARSV1Filter()
      Construct a new filter.
  • Method Details

    • setCutoff

      public void setCutoff(double newCutoff)
      Description copied from interface: ARSV1FilterType

      Specify a new frequency cutoff value.

      Specified by:
      setCutoff in interface ARSV1FilterType
      Parameters:
      newCutoff - The cutoff
    • setQ

      public void setQ(double newQ)
      Description copied from interface: ARSV1FilterType

      Specify a new Q value.

      Specified by:
      setQ in interface ARSV1FilterType
      Parameters:
      newQ - The Q
    • cutoff

      public double cutoff()
      Specified by:
      cutoff in interface ARSV1FilterType
      Returns:
      The current cutoff value
    • q

      public double q()
      Specified by:
      q in interface ARSV1FilterType
      Returns:
      The current Q value
    • reset

      public void reset()
      Description copied from interface: ARSV1FilterType
      Reset all internal state variables, leaving cutoff and q untouched.
      Specified by:
      reset in interface ARSV1FilterType
    • lowPassOutput

      public double lowPassOutput()
      Specified by:
      lowPassOutput in interface ARSV1FilterType
      Returns:
      The low pass output of the most recent filter evaluation
    • highPassOutput

      public double highPassOutput()
      Specified by:
      highPassOutput in interface ARSV1FilterType
      Returns:
      The high pass output of the most recent filter evaluation
    • bandPassOutput

      public double bandPassOutput()
      Specified by:
      bandPassOutput in interface ARSV1FilterType
      Returns:
      The band pass output of the most recent filter evaluation
    • bandRejectOutput

      public double bandRejectOutput()
      Specified by:
      bandRejectOutput in interface ARSV1FilterType
      Returns:
      The band reject output of the most recent filter evaluation
    • processOneFrame

      public void processOneFrame(double input)
      Description copied from interface: ARSV1FilterType
      Process a single frame of input.
      Specified by:
      processOneFrame in interface ARSV1FilterType
      Parameters:
      input - The input