|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbe.hogent.tarsos.sampled.pitch.Annotation
public final class Annotation
An annotation has one time stamp, one pitch and an optional probability. Also the source of the annotation needs to be defined.
Constructor Summary | |
---|---|
Annotation(double timeStamp,
double pitchInHz,
PitchDetectionMode annotationSource)
Create a new annotation with the given data. |
|
Annotation(double timeStamp,
double pitchInHz,
PitchDetectionMode annotationSource,
double salience)
Create a new annotation with the given data. |
Method Summary | |
---|---|
int |
compareTo(Annotation o)
|
boolean |
equals(java.lang.Object o)
|
double |
getPitch(PitchUnit unit)
Return the pitch in the requested unit. |
double |
getProbability()
The probability for the annotation. |
PitchDetectionMode |
getSource()
|
double |
getStart()
Returns the starting time in seconds. |
int |
hashCode()
|
static Annotation |
parse(java.lang.String line)
Parses an annotation as written by the toString() method. |
static double |
percentAnnotated(java.util.List<Annotation> annotations,
double audioLenght)
Calculates a maximum possible number of annotations and compares it with the actual number of annotations. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Annotation(double timeStamp, double pitchInHz, PitchDetectionMode annotationSource, double salience)
timeStamp
- The starting time (in seconds).pitchInHz
- The pitch in Hz.annotationSource
- The source of the annotation.salience
- A probability between zero and one (inclusive) defining the
saliance of the pitch.public Annotation(double timeStamp, double pitchInHz, PitchDetectionMode annotationSource)
timeStamp
- The starting time (in seconds).pitchInHz
- The pitch in Hz.annotationSource
- The source of the annotation.Method Detail |
---|
public double getStart()
public PitchDetectionMode getSource()
public double getProbability()
public double getPitch(PitchUnit unit)
unit
- The unit requested.
public int compareTo(Annotation o)
compareTo
in interface java.lang.Comparable<Annotation>
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public static Annotation parse(java.lang.String line)
line
- The line to parse.
public static double percentAnnotated(java.util.List<Annotation> annotations, double audioLenght)
annotations
- A list of annotations for an audio file.audioLenght
- The length of the annotated audio.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |