net.beadsproject.beads.analysis
Class FeatureExtractor<R,P>

java.lang.Object
  extended by net.beadsproject.beads.analysis.FeatureExtractor<R,P>
Direct Known Subclasses:
FFT, Frequency, GnuplotDataWriter, MelSpectrum, MFCC, Peaks, Power, ReBin, SpectralCentroid

public abstract class FeatureExtractor<R,P>
extends java.lang.Object

FeatureExtractor is an abstract base class for classes that perform some kind of analysis on incoming data. Both the incoming data (P) and the generated data (R) are generic types. Implementing classes use the method #process(P) to process data.

Author:
ollie

Field Summary
protected  java.lang.String[] featureDescriptions
          An array of Strings providing descriptions of the feature data.
protected  R features
          The current feature data.
protected  java.lang.String name
          The name of the FeatureExtractor.
protected  int numFeatures
          The number of features.
 
Constructor Summary
FeatureExtractor()
          Instantiates a new FeatureExtractor.
 
Method Summary
 java.lang.String[] getFeatureDescriptions()
          Gets the feature descriptions.
 R getFeatures()
          Gets the current features of type R, specified in the class def.
 java.lang.String getName()
          Gets the name.
 int getNumberOfFeatures()
          Gets the number of features.
abstract  void process(P data)
          Process some data of type P (specified by the class def).
 void setName(java.lang.String name)
          Sets the name.
 void setNumberOfFeatures(int numFeatures)
          Sets the number of features.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numFeatures

protected int numFeatures
The number of features.


features

protected R features
The current feature data.


name

protected java.lang.String name
The name of the FeatureExtractor.


featureDescriptions

protected java.lang.String[] featureDescriptions
An array of Strings providing descriptions of the feature data.

Constructor Detail

FeatureExtractor

public FeatureExtractor()
Instantiates a new FeatureExtractor. This constructor names the FeatureExtractor with the name of the implementing class.

Method Detail

process

public abstract void process(P data)
Process some data of type P (specified by the class def). This method must be overidden by implementing classes.

Parameters:
data - the data.

getFeatures

public R getFeatures()
Gets the current features of type R, specified in the class def.

Returns:
the features.

getNumberOfFeatures

public int getNumberOfFeatures()
Gets the number of features.

Returns:
the number of features.

setNumberOfFeatures

public void setNumberOfFeatures(int numFeatures)
Sets the number of features.

Parameters:
numFeatures - the new number of features.

setName

public void setName(java.lang.String name)
Sets the name.

Parameters:
name - the new name.

getName

public java.lang.String getName()
Gets the name.

Returns:
the name.

getFeatureDescriptions

public java.lang.String[] getFeatureDescriptions()
Gets the feature descriptions. Implementing classes should make sure that this array has meaningful content.

Returns:
the feature descriptions.