com.softsynth.jsyn
Class PitchDetector

java.lang.Object
  extended by java.util.Observable
      extended by com.softsynth.jsyn.SynthObject
          extended by com.softsynth.jsyn.SynthSound
              extended by com.softsynth.jsyn.SynthUnit
                  extended by com.softsynth.jsyn.PitchDetector

public class PitchDetector
extends SynthUnit

PitchDetector unit. 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.

Version:
JSyn Version 005
Author:
(C) 1997 Phil Burk, SoftSynth.com, All Rights Reserved
See Also:
Synth, SynthChannelData

Field Summary
 SynthOutput confidence
           
 SynthInput input
           
 SynthOutput period
          Period of the waveform in frames.
 
Constructor Summary
PitchDetector()
           
PitchDetector(SynthContext synthContext)
          Create a PitchDetector that runs at Synth.RATE_AUDIO.
PitchDetector(SynthContext synthContext, int calculationRate)
           
 
Method Summary
 
Methods inherited from class com.softsynth.jsyn.SynthSound
addPort, addPort, findNamedPort, getName, getNumPorts, getPortAt, getPriority, setPriority, setStage, setStage, start, start, stop, stop
 
Methods inherited from class com.softsynth.jsyn.SynthObject
delete, deleteAll, enableDeletionByGarbageCollector, enableTracking, getPeer, getSynthContext, isTrackingEnabled, toString, track
 
Methods inherited from class java.util.Observable
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

input

public SynthInput input

period

public SynthOutput period
Period of the waveform in frames.


confidence

public SynthOutput confidence
Constructor Detail

PitchDetector

public PitchDetector(SynthContext synthContext,
                     int calculationRate)
              throws SynthException
Throws:
SynthException

PitchDetector

public PitchDetector(SynthContext synthContext)
              throws SynthException
Create a PitchDetector that runs at Synth.RATE_AUDIO.

Throws:
SynthException - If out of memory.

PitchDetector

public PitchDetector()
              throws SynthException
Throws:
SynthException