com.jsyn.unitgen
Class PeriodAnalyzer

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

public class PeriodAnalyzer
extends UnitGenerator

PitchDetector unit. UNDER_CONSTRUCTION - DO NOT USE Analyses an input signal and outputs an estimated period in frames. The frequency is frameRate/period. The confidence port tells you how accurate the estimate is. When the confidence is low, you should ignore the period. You can use a CompareUnit and a LatchUnit to hold values that you are confident of.

Note that a stable monophonic signal is required for accurate pitch tracking.

Tracking can be improved by passing the signal through a lowPass filter. This reduces the higher level harmonics which can confuse the detector.


Field Summary
 UnitOutputPort confidencePort
           
 UnitInputPort input
           
 UnitOutputPort periodPort
           
 
Fields inherited from class com.jsyn.unitgen.UnitGenerator
FALSE, TRUE
 
Constructor Summary
PeriodAnalyzer()
           
 
Method Summary
 void generate(int start, int limit)
          Perform essential synthesis function.
 void setSynthesisEngine(SynthesisEngine synthesisEngine)
           
 
Methods inherited from class com.jsyn.unitgen.UnitGenerator
addPort, convertHalfLifeToMultiplier, flattenOutputs, generate, getCircuit, getFramePeriod, getFrameRate, getPortByName, getPorts, getSynthesisEngine, isEnabled, pullData, setCircuit, setFrameRate, start, stop
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

input

public UnitInputPort input

periodPort

public UnitOutputPort periodPort

confidencePort

public UnitOutputPort confidencePort
Constructor Detail

PeriodAnalyzer

public PeriodAnalyzer()
Method Detail

setSynthesisEngine

public void setSynthesisEngine(SynthesisEngine synthesisEngine)
Overrides:
setSynthesisEngine in class UnitGenerator
Parameters:
synthesisEngine - the synthesisEngine to set

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