com.jsyn.unitgen
Class FilterBiquad

java.lang.Object
  extended by com.jsyn.unitgen.UnitGenerator
      extended by com.jsyn.unitgen.UnitFilter
          extended by com.jsyn.unitgen.TunableFilter
              extended by com.jsyn.unitgen.FilterBiquad
All Implemented Interfaces:
UnitSink, UnitSource
Direct Known Subclasses:
FilterBiquadCommon, FilterBiquadShelf

public abstract class FilterBiquad
extends TunableFilter

Base class for a set of IIR filters.

See Also:
FilterBandStop, FilterBandPass, FilterLowPass, FilterHighPass, FilterTwoPoleTwoZero

Field Summary
 UnitInputPort amplitude
           
 
Fields inherited from class com.jsyn.unitgen.TunableFilter
frequency
 
Fields inherited from class com.jsyn.unitgen.UnitFilter
input, output
 
Fields inherited from class com.jsyn.unitgen.UnitGenerator
FALSE, TRUE
 
Constructor Summary
FilterBiquad()
           
 
Method Summary
 void generate(int start, int limit)
          Generic generate(int start, int limit) method calls this filter's recalculate() and performBiquadFilter(int, int) methods.
 void performBiquadFilter(int start, int limit)
          Each filter calls performBiquadFilter() through the generate(int, int) method.
 
Methods inherited from class com.jsyn.unitgen.UnitFilter
getInput, getOutput
 
Methods inherited from class com.jsyn.unitgen.UnitGenerator
addPort, convertHalfLifeToMultiplier, flattenOutputs, generate, getFramePeriod, getFrameRate, getPortByName, getPorts, getSynthesisEngine, isEnabled, pullData, setCircuit, setFrameRate, setSynthesisEngine, start, stop
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

amplitude

public UnitInputPort amplitude
Constructor Detail

FilterBiquad

public FilterBiquad()
Method Detail

generate

public void generate(int start,
                     int limit)
Generic generate(int start, int limit) method calls this filter's recalculate() and performBiquadFilter(int, int) methods.

Specified by:
generate in class UnitGenerator
Parameters:
start - offset into port buffers
limit - limit offset into port buffers for loop

performBiquadFilter

public void performBiquadFilter(int start,
                                int limit)
Each filter calls performBiquadFilter() through the generate(int, int) method. This method has converted Robert Bristow-Johnson's coefficients for the Direct I form in this way: Here is the equation that JSyn uses for this filter: y(n) = A0*x(n) + A1*x(n-1) + A2*x(n-2) - B1*y(n-1) - B2*y(n-2) Here is the equation that Robert Bristow-Johnson uses: y[n] = (b0/a0)*x[n] + (b1/a0)*x[n-1] + (b2/a0)*x[n-2] - (a1/a0)*y[n-1] - (a2/a0)*y[n-2] So to translate between JSyn coefficients and RBJ coefficients:
 JSyn => RBJ
 A0 => b0/a0
 A1 => b1/a0
 A2 => b2/a0
 B1 => a1/a0
 B2 => a2/a0
 

Parameters:
start -
limit -