jAudioFeatureExtractor
Class DataModel

java.lang.Object
  extended by jAudioFeatureExtractor.DataModel

public class DataModel
extends java.lang.Object

All components that are not tightly tied to GUI. Used by console interface as well as the GUI interface.

Author:
Daniel McEnnis

Field Summary
 java.util.HashMap<java.lang.String,Aggregator> aggregatorMap
          Mapping between aggregator names and aggregator prototypes
 Aggregator[] aggregators
          List of aggreggators to apply
 Cancel cancel_
          Handle for killing in-progress analysis
 AggregatorContainer container
          wrapper object for the aggregators.
 boolean[] defaults
          list of which features are enabled by default
 FeatureDefinition[] featureDefinitions
          cached FeatureDefinitions for all available features
 java.io.OutputStream featureKey
           
 FeatureExtractor[] features
          list of all features available
 java.io.OutputStream featureValue
           
 boolean[] is_primary
          whether or a feature is a derived feature or not
 ModelListener ml_
          Reference to use for piping progress updates
 AudioMethodsPlayback.PlayThread playback_thread
          thread for playing back a recording
 RecordingInfo[] recordingInfo
          info on all recordings that are made avaiable for feature extraction
 
Constructor Summary
DataModel(java.lang.String featureXMLLocation, ModelListener ml)
          Initializes each of the arrays with all available efeatures.
 
Method Summary
 void extract(int windowSize, double windowOverlap, double samplingRate, boolean normalise, boolean perWindowStats, boolean overallStats, RecordingInfo[] info, int arff)
          Function for executing the feature extraction process against a set of files.
 void setUpdater(Updater u)
          Establish a listener for periodic updates on the feature extraction progress.
 void updateTable()
          This is the function called when features change in such a way as the main display becomes out of date.
 void validateFile(java.lang.String definitions, java.lang.String values)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ml_

public ModelListener ml_
Reference to use for piping progress updates


cancel_

public Cancel cancel_
Handle for killing in-progress analysis


defaults

public boolean[] defaults
list of which features are enabled by default


features

public FeatureExtractor[] features
list of all features available


aggregatorMap

public java.util.HashMap<java.lang.String,Aggregator> aggregatorMap
Mapping between aggregator names and aggregator prototypes


aggregators

public Aggregator[] aggregators
List of aggreggators to apply

Must be set externally. Duplicates of a class are permitted (hence not a map) but each entry in the array must be fully initialized prior to calling extract().


container

public AggregatorContainer container
wrapper object for the aggregators. This reference is null until a file extraction has been performed.


is_primary

public boolean[] is_primary
whether or a feature is a derived feature or not


featureDefinitions

public FeatureDefinition[] featureDefinitions
cached FeatureDefinitions for all available features


recordingInfo

public RecordingInfo[] recordingInfo
info on all recordings that are made avaiable for feature extraction


playback_thread

public AudioMethodsPlayback.PlayThread playback_thread
thread for playing back a recording


featureKey

public java.io.OutputStream featureKey

featureValue

public java.io.OutputStream featureValue
Constructor Detail

DataModel

public DataModel(java.lang.String featureXMLLocation,
                 ModelListener ml)
Initializes each of the arrays with all available efeatures. Place to add new features.

Parameters:
ml - reference to a controller that will handle table updates.
Method Detail

updateTable

public void updateTable()
This is the function called when features change in such a way as the main display becomes out of date. WHen executed from the consol, this value is null.


extract

public void extract(int windowSize,
                    double windowOverlap,
                    double samplingRate,
                    boolean normalise,
                    boolean perWindowStats,
                    boolean overallStats,
                    RecordingInfo[] info,
                    int arff)
             throws java.lang.Exception
Function for executing the feature extraction process against a set of files.

Parameters:
windowSize - Size of the window in samples
windowOverlap - Percent of the window to be overlapped - must be between 0 and 1.
samplingRate - Sample rate given in samples per second
normalise - indicates whether or not the file should be normalised before feature extraction
perWindowStats - should features be extracted for every window
overallStats - should features be extracted over the entire window
destinationFV - file where the extracted features should be stored
destinationFK - file where descriptions of features extracted should be stored
info - list of the files that are to be analyzed
arff - output format of the data
Throws:
java.lang.Exception

setUpdater

public void setUpdater(Updater u)
Establish a listener for periodic updates on the feature extraction progress.

Parameters:
u -

validateFile

public void validateFile(java.lang.String definitions,
                         java.lang.String values)
                  throws java.lang.Exception
Throws:
java.lang.Exception