be.hogent.tarsos.dsp.pitch
Class PitchDetectionResult

java.lang.Object
  extended by be.hogent.tarsos.dsp.pitch.PitchDetectionResult

public class PitchDetectionResult
extends java.lang.Object

A class with information about the result of a pitch detection on a block of audio. It contains:

The separate pitched or unpitched boolean can coexist with a defined pitch. E.g. if the algorithm detects 220Hz in a noisy signal it may respond with 220Hz "unpitched".

For performance reasons the object is reused. Please create a copy of the object if you want to use it on an other thread.

Author:
Joren Six

Constructor Summary
PitchDetectionResult()
           
PitchDetectionResult(PitchDetectionResult other)
          A copy constructor.
 
Method Summary
 PitchDetectionResult clone()
           
 float getPitch()
           
 float getProbability()
           
 boolean isPitched()
           
 void setPitch(float pitch)
           
 void setPitched(boolean pitched)
           
 void setProbability(float probability)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PitchDetectionResult

public PitchDetectionResult()

PitchDetectionResult

public PitchDetectionResult(PitchDetectionResult other)
A copy constructor. Since PitchDetectionResult objects are reused for performance reasons, creating a copy can be practical.

Parameters:
other -
Method Detail

getPitch

public float getPitch()
Returns:
The pitch in Hertz.

setPitch

public void setPitch(float pitch)

clone

public PitchDetectionResult clone()
Overrides:
clone in class java.lang.Object

getProbability

public float getProbability()
Returns:
A probability (noisiness, (a)periodicity, salience, voicedness or clarity measure) for the detected pitch. This is somewhat similar to the term voiced which is used in speech recognition. This probability should be calculated together with the pitch. The exact meaning of the value depends on the detector used.

setProbability

public void setProbability(float probability)

isPitched

public boolean isPitched()
Returns:
Whether the algorithm thinks the block of audio is pitched. Keep in mind that an algorithm can come up with a best guess for a pitch even when isPitched() is false.

setPitched

public void setPitched(boolean pitched)