com.jsyn.unitgen
Class FilterOneZero

java.lang.Object
  extended by com.jsyn.unitgen.UnitGenerator
      extended by com.jsyn.unitgen.UnitFilter
          extended by com.jsyn.unitgen.FilterOneZero
All Implemented Interfaces:
UnitSink, UnitSource

public class FilterOneZero
extends UnitFilter

First Order, One Zero filter using the following formula:

 y( n ) = A0 * x( n ) + A1 * x( n - 1 )
 
where y(n) is Output, x(n) is Input and x(n-1) is Input at the prior sample tick. Setting A1 positive gives a low-pass response; setting A1 negative gives a high-pass response. The bandwidth of this filter is fairly high, so it often serves a building block by being cascaded with other filters. If A0 and A1 are both 0.5, then this filter is a simple averaging lowpass filter, with a zero at SR/2 = 22050 Hz. If A0 is 0.5 and A1 is -0.5, then this filter is a high pass filter, with a zero at 0.0 Hz. A thorough description of the digital filter theory needed to fully describe this filter is beyond the scope of this document. Calculating coefficients is non-intuitive; the interested user is referred to one of the standard texts on filter theory (e.g., Moore, "Elements of Computer Music", section 2.4).


Field Summary
 UnitVariablePort a0
           
 UnitVariablePort a1
           
 
Fields inherited from class com.jsyn.unitgen.UnitFilter
input, output
 
Fields inherited from class com.jsyn.unitgen.UnitGenerator
FALSE, TRUE
 
Constructor Summary
FilterOneZero()
           
 
Method Summary
 void generate(int start, int limit)
          Perform essential synthesis function.
 
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

a0

public UnitVariablePort a0

a1

public UnitVariablePort a1
Constructor Detail

FilterOneZero

public FilterOneZero()
Method Detail

generate

public void generate(int start,
                     int limit)
Description copied from class: UnitGenerator
Perform essential synthesis function.

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