com.jsyn.unitgen
Class SchmidtTrigger

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

public class SchmidtTrigger
extends UnitFilter

SchmidtTrigger unit.

Output logic level value with hysteresis. Transition high when input exceeds setLevel. Only go low when input is below resetLevel. This can be used to reject low level noise on the input signal. The default values for setLevel and resetLevel are both 0.0. Setting setLevel to 0.1 and resetLevel to -0.1 will give some hysteresis. The outputPulse is a single sample wide pulse set when the output transitions from low to high.

 if( output == 0.0 )
        output = (input > setLevel) ? 1.0 : 0.0;
 else if( output > 0.0 )
        output = (input <= resetLevel) ? 0.0 : 1.0;
 else
        output = previous_output;
 

See Also:
Compare

Field Summary
 UnitOutputPort outputPulse
           
 UnitInputPort resetLevel
           
 UnitInputPort setLevel
           
 
Fields inherited from class com.jsyn.unitgen.UnitFilter
input, output
 
Fields inherited from class com.jsyn.unitgen.UnitGenerator
FALSE, TRUE
 
Constructor Summary
SchmidtTrigger()
           
 
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

setLevel

public UnitInputPort setLevel

resetLevel

public UnitInputPort resetLevel

outputPulse

public UnitOutputPort outputPulse
Constructor Detail

SchmidtTrigger

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