jAudioFeatureExtractor.AudioFeatures
Class StandardDeviation

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

public class StandardDeviation
extends MetaFeatureFactory

Calculates the Standard Deviation of a feature over a large running window.

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
StandardDeviation()
          Basic constructor that initializes the metafeautres values properly for use as a factory.
StandardDeviation(MetaFeatureFactory mff)
          Convenience constructor to create a new factory object with the given dependant metafeature
 
Method Summary
 java.lang.Object clone()
          Create an identical copy of this feature.
 MetaFeatureFactory defineFeature(FeatureExtractor fe)
          Factory method for this class which generates a fully usable MetaFeature object.
 double[] extractFeature(double[] samples, double sampling_rate, double[][] other_feature_values)
          Calculates the standard deviation over last 100 windows
 java.lang.String getElement(int index)
          Function that must be overridden to allow this feature to be set globally by GlobalChange frame.
 FeatureDefinition getFeatureDefinition()
          Overridden to regenerate the feature definition.
 void setElement(int index, java.lang.String value)
          Function permitting an unintelligent outside function (ie.
 void setWindow(int n)
          Function permits this class to respond to a global window change request.
 
Methods inherited from class jAudioFeatureExtractor.AudioFeatures.MetaFeatureFactory
chainMetaFeatureFactory, setParent
 
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

StandardDeviation

public StandardDeviation()
Basic constructor that initializes the metafeautres values properly for use as a factory.


StandardDeviation

public StandardDeviation(MetaFeatureFactory mff)
Convenience constructor to create a new factory object with the given dependant metafeature

Parameters:
mff - metafeature factory that this newly created object should depend upon.
Method Detail

defineFeature

public MetaFeatureFactory defineFeature(FeatureExtractor fe)
Factory method for this class which generates a fully usable MetaFeature object. Using the structure stored in this Mean object, create a new FeatureExtractor with the given specific FeatureExtraction as a base. If we are calulating the mean of another meta-feature, recursively create the underlying meta feature first.

Specified by:
defineFeature in class MetaFeatureFactory
Parameters:
fe - Feature to be used as base for feature extraction
Returns:
completed metafeature.

extractFeature

public double[] extractFeature(double[] samples,
                               double sampling_rate,
                               double[][] other_feature_values)
                        throws java.lang.Exception
Calculates the standard deviation over last 100 windows

Specified by:
extractFeature in class FeatureExtractor
Parameters:
samples - signal being processed
sampling_rate - sample rate of the signal
other_feature_values - dependancies of the current signal
Returns:
standard deviation over last 100 values of dependant feature.
Throws:
java.lang.Exception - Throws an informative exception if the feature cannot be calculated.

setWindow

public void setWindow(int n)
               throws java.lang.Exception
Function permits this class to respond to a global window change request.

Overrides:
setWindow in class MetaFeatureFactory
Parameters:
n - new window length
Throws:
java.lang.Exception - thrown if the new window size is less than 2

getElement

public java.lang.String getElement(int index)
                            throws java.lang.Exception
Function that must be overridden to allow this feature to be set globally by GlobalChange frame.

Overrides:
getElement in class FeatureExtractor
Parameters:
index - the number of windows of offset to be used in calculating this feature
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 get the default values used to populate the table's entries. The correct index values are inferred from definition.attribute value.

Overrides:
setElement in class FeatureExtractor
Parameters:
index - which of AreaMoment's attributes should be edited.
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