com.jsyn.unitgen
Class Integrate

java.lang.Object
  extended by com.jsyn.unitgen.UnitGenerator
      extended by com.jsyn.unitgen.Integrate

public class Integrate
extends UnitGenerator

IntegrateUnit unit.

Output accumulated sum of the input signal. This can be used to transform one signal into another, or to generate ramps between the limits by setting the input signal positive or negative. For a "leaky integrator" use a FilterOnePoleOneZero.

 output = output + input;
 if( output < lowerLimit )
        output = lowerLimit;
 else if( output > upperLimit )
        output = upperLimit;
 

See Also:
FilterOnePoleOneZero

Field Summary
 UnitInputPort input
           
 UnitInputPort lowerLimit
          Output will be stopped internally from going below this value.
 UnitOutputPort output
           
 UnitInputPort upperLimit
          Output will be stopped internally from going above this value.
 
Fields inherited from class com.jsyn.unitgen.UnitGenerator
FALSE, TRUE
 
Constructor Summary
Integrate()
           
 
Method Summary
 void generate(int start, int limit)
          Perform essential synthesis function.
 
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

input

public UnitInputPort input

lowerLimit

public UnitInputPort lowerLimit
Output will be stopped internally from going below this value. Default is -1.0.


upperLimit

public UnitInputPort upperLimit
Output will be stopped internally from going above this value. Default is +1.0.


output

public UnitOutputPort output
Constructor Detail

Integrate

public Integrate()
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