whistleClassifier.training
Class TrainingDataSet

java.lang.Object
  extended by whistleClassifier.training.TrainingDataSet
All Implemented Interfaces:
java.io.Serializable

public class TrainingDataSet
extends java.lang.Object
implements java.io.Serializable

Training contours from a single file, each contour representing one whistle.

For each species, several of these will probably be held in a TrainingDataGroup

Author:
Doug Gillespie
See Also:
TrainingDataGroup, Serialized Form

Field Summary
private  int ffthop
           
private  int fftLength
           
private  int nContours
           
private  float sampleRate
           
static long serialVersionUID
           
private  java.lang.String sourceDataType
           
private  java.lang.String species
           
private  java.lang.String storageSource
           
private  java.util.ArrayList<TrainingContour> trainingContours
           
private  long trainingTime
           
 
Constructor Summary
TrainingDataSet(java.lang.Class sourceDataClass, java.lang.String species, float sampleRate, int fftLength, int ffthop)
           
 
Method Summary
 int addContour(double[] t, double[] f)
           
 int addContour(WhistleContour contour)
           
 int getFfthop()
           
 int getFftLength()
           
 int getNumContours()
          Get the number of contours in the data set.
 int getNumFragments(WhistleFragmenter fragmenter)
          Get the number of fragments based on the fragment length
 float getSampleRate()
           
 java.lang.String getSourceDataType()
           
 java.lang.String getSpecies()
           
 java.lang.String getStorageSource()
           
 TrainingContour getTrainingContour(int iContour)
          Get a specific training contour
 java.util.ArrayList<TrainingContour> getTrainingContours()
           
 long getTrainingTime()
           
 void setFfthop(int ffthop)
           
 void setFftLength(int fftLength)
           
 void setSampleRate(float sampleRate)
           
 void setSpecies(java.lang.String species)
           
 void setStorageSource(java.lang.String storageSource)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values

species

private java.lang.String species

fftLength

private int fftLength

sampleRate

private float sampleRate

ffthop

private int ffthop

nContours

private int nContours

trainingTime

private long trainingTime

sourceDataType

private java.lang.String sourceDataType

storageSource

private java.lang.String storageSource

trainingContours

private java.util.ArrayList<TrainingContour> trainingContours
Constructor Detail

TrainingDataSet

public TrainingDataSet(java.lang.Class sourceDataClass,
                       java.lang.String species,
                       float sampleRate,
                       int fftLength,
                       int ffthop)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

addContour

public int addContour(WhistleContour contour)

addContour

public int addContour(double[] t,
                      double[] f)

getSpecies

public java.lang.String getSpecies()

getTrainingTime

public long getTrainingTime()

getSourceDataType

public java.lang.String getSourceDataType()

getTrainingContours

public java.util.ArrayList<TrainingContour> getTrainingContours()

getTrainingContour

public TrainingContour getTrainingContour(int iContour)
Get a specific training contour

Parameters:
iContour - contour index
Returns:
contour

setSpecies

public void setSpecies(java.lang.String species)

getFftLength

public int getFftLength()

setFftLength

public void setFftLength(int fftLength)

getSampleRate

public float getSampleRate()

setSampleRate

public void setSampleRate(float sampleRate)

getFfthop

public int getFfthop()

setFfthop

public void setFfthop(int ffthop)

getNumContours

public int getNumContours()
Get the number of contours in the data set.

Returns:
number of contours.

getNumFragments

public int getNumFragments(WhistleFragmenter fragmenter)
Get the number of fragments based on the fragment length

Parameters:
fragLen - length of each fragment
Returns:
number of fragments.

getStorageSource

public java.lang.String getStorageSource()

setStorageSource

public void setStorageSource(java.lang.String storageSource)