jAudioFeatureExtractor.AudioFeatures
Class Derivative

java.lang.Object
  extended by jAudioFeatureExtractor.AudioFeatures.FeatureExtractor
      extended by jAudioFeatureExtractor.AudioFeatures.MetaFeatureFactory
          extended by jAudioFeatureExtractor.AudioFeatures.Derivative

public class Derivative
extends MetaFeatureFactory

Class implementing the most basic discrete derivative of a dependant feature. Extends the MetaFeatureFactory abstract class.

Author:
Daniel McEnnis

Field Summary
 
Fields inherited from class jAudioFeatureExtractor.AudioFeatures.MetaFeatureFactory
fe_
 
Fields inherited from class jAudioFeatureExtractor.AudioFeatures.FeatureExtractor
definition, dependencies, offsets, parent
 
Constructor Summary
Derivative()
          Basic constructor that initializes the metaFeature class variables appropiaretely for factory use
Derivative(MetaFeatureFactory mff)
          A convenience consrtuctor that extends the basic constructor to allow specifying a dependant MetaFeatureFactory object.
 
Method Summary
 java.lang.Object clone()
          Create an identical copy of this feature.
 MetaFeatureFactory defineFeature(FeatureExtractor fe)
          Factory class for creating a new FeatureExtraction object.
 double[] extractFeature(double[] samples, double sampling_rate, double[][] other_feature_values)
          Extracts the difference between adjacent points as a basic implementation of a discrete dirivative.
 java.lang.String getElement(int index)
          Function permitting an unintelligent outside function (ie.
 FeatureDefinition getFeatureDefinition()
          Overridden to regenerate the feature definition.
 void setElement(int index, java.lang.String value)
          Function permitting an unintelligent outside function (ie.
 
Methods inherited from class jAudioFeatureExtractor.AudioFeatures.MetaFeatureFactory
chainMetaFeatureFactory, setParent, setWindow
 
Methods inherited from class jAudioFeatureExtractor.AudioFeatures.FeatureExtractor
getDepenedencies, getDepenedencyOffsets
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Derivative

public Derivative()
Basic constructor that initializes the metaFeature class variables appropiaretely for factory use


Derivative

public Derivative(MetaFeatureFactory mff)
A convenience consrtuctor that extends the basic constructor to allow specifying a dependant MetaFeatureFactory object.

Parameters:
mff - dependant MetaFeatureFactory object
Method Detail

defineFeature

public MetaFeatureFactory defineFeature(FeatureExtractor fe)
Factory class for creating a new FeatureExtraction object. Recursively constructs the new object if there exists a dependant MetaFeatureFactory object.

Specified by:
defineFeature in class MetaFeatureFactory
Parameters:
fe - base feature that this feature is to be bvased upon.
Returns:
fully constructed MetaFeatureFactory object ready for feature extraction.

extractFeature

public double[] extractFeature(double[] samples,
                               double sampling_rate,
                               double[][] other_feature_values)
                        throws java.lang.Exception
Extracts the difference between adjacent points as a basic implementation of a discrete dirivative.

Specified by:
extractFeature in class FeatureExtractor
Parameters:
samples - signal to be analyzed. Not used by this feature
sampling_rate - sampling rate of the signal. Not used by this feature
other_feature_values - provides most recent and next most recent values to be compared
Returns:
discrete derivative of the underlying feature
Throws:
java.lang.Exception - Throws an informative exception if the feature cannot be calculated.

getElement

public java.lang.String getElement(int index)
                            throws java.lang.Exception
Function permitting an unintelligent outside function (ie. EditFeatures frame) to get the default values used to populate the table's entries. The correct index values are inferred from definition.attribute value.

As a metafeature, recursively calls children for the feature requested.

Overrides:
getElement in class FeatureExtractor
Parameters:
index - which of AreaMoment's attributes should be edited.
Throws:
java.lang.Exception

setElement

public void setElement(int index,
                       java.lang.String value)
                throws java.lang.Exception
Function permitting an unintelligent outside function (ie. EditFeatures frame) to set the default values used to popylate the table's entries. Like getElement, the correct index values are inferred from the definition.attributes value.

As a metafeature, recursively calls children to set the feature requested.

Overrides:
setElement in class FeatureExtractor
Parameters:
index - attribute to be set
value - new value of the attribute
Throws:
java.lang.Exception

clone

public java.lang.Object clone()
Create an identical copy of this feature. This permits FeatureExtractor to use the prototype pattern to create new composite features using metafeatures.

Specified by:
clone in class FeatureExtractor

getFeatureDefinition

public FeatureDefinition getFeatureDefinition()
Overridden to regenerate the feature definition. Perhaps its should be kept purely virtual, but currently, attributes and dimensions are recalculated for each iteration. This is necessary so that changes in children's defintions get propogated back to the top level. As of 05-08-05 LPC is the only feature that requires this.

Overrides:
getFeatureDefinition in class FeatureExtractor