com.meapsoft
Class FeatExtractor

java.lang.Object
  extended bycom.meapsoft.MEAPUtil
      extended bycom.meapsoft.FeatExtractor
All Implemented Interfaces:
java.lang.Runnable

public class FeatExtractor
extends MEAPUtil

Program that extracts features from the chunks listed in the input files.


Field Summary
static int feSamplingRate
           
static int nfft
           
static int nhop
           
 
Fields inherited from class com.meapsoft.MEAPUtil
bigEndian, bitsPerSamp, exceptionHandler, frameLatency, mixerToUse, numChannels, progress, samplingRate, signed, slash, stereo, verbose, version, writeMEAPFile
 
Constructor Summary
FeatExtractor(FeatFile[] infiles, FeatFile outfile, java.util.Vector extractors)
          FeatExtractor constructor.
FeatExtractor(FeatFile infile, FeatFile outfile, java.util.Vector extractors)
          FeatExtractor constructor.
FeatExtractor(java.lang.String[] args)
          FeatExtractor constructor.
FeatExtractor(java.lang.String infile, java.lang.String outfile, java.util.Vector extractors)
          FeatExtractor constructor.
 
Method Summary
 double getHopSize()
          Get the STFT hop size used by the feature extractors.
 double getWindowSize()
          Get the STFT window size used by the feature extractors.
static void main(java.lang.String[] args)
           
 void printUsageAndExit()
           
 FeatFile processFeatFile(FeatFile f)
          Where the magic happens.
 FeatFile[] processFeatFiles()
          Where the magic happens.
 void run()
          Set everything up, process input, and write output.
 void setClearNonMetaFeatures(boolean clearNonMF)
          Should this FeatExtractor clear any non meta features?
 void setFeatureExtractorWeights(java.util.Vector v)
          Set weights associated with the different FeatureExtractors used by this object.
 void setHopSize(double hopSize)
          Set the STFT hop size for the feature extractors to use.
 void setup()
           
 void setWindowSize(double winSize)
          Set the STFT window size for the feature extractors to use.
 
Methods inherited from class com.meapsoft.MEAPUtil
bytes2doubles, doubles2bytes, getPaths, getProgress, openAudioWriter, openAudioWriter, openInputStream, openInputStream, parseChunkDist, parseFeatDim, parseFeatureExtractor, parseFeatureExtractor, printCommandLineOptions, printCommandLineOptions, setExceptionHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

feSamplingRate

public static final int feSamplingRate
See Also:
Constant Field Values

nfft

public static int nfft

nhop

public static int nhop
Constructor Detail

FeatExtractor

public FeatExtractor(java.lang.String infile,
                     java.lang.String outfile,
                     java.util.Vector extractors)
FeatExtractor constructor. If no extractors is empty, defaults to AvgMelSpec.


FeatExtractor

public FeatExtractor(FeatFile infile,
                     FeatFile outfile,
                     java.util.Vector extractors)
FeatExtractor constructor. If no extractors is empty, defaults to AvgMelSpec.


FeatExtractor

public FeatExtractor(FeatFile[] infiles,
                     FeatFile outfile,
                     java.util.Vector extractors)
FeatExtractor constructor. If no extractors is empty, defaults to AvgMelSpec.


FeatExtractor

public FeatExtractor(java.lang.String[] args)
FeatExtractor constructor. Parses command line arguments

Method Detail

printUsageAndExit

public void printUsageAndExit()

setup

public void setup()
           throws java.io.IOException,
                  ParserException
Overrides:
setup in class MEAPUtil
Throws:
java.io.IOException
ParserException

processFeatFiles

public FeatFile[] processFeatFiles()
                            throws java.io.IOException,
                                   javax.sound.sampled.UnsupportedAudioFileException
Where the magic happens. Extract features from featFiles.

Throws:
java.io.IOException
javax.sound.sampled.UnsupportedAudioFileException

processFeatFile

public FeatFile processFeatFile(FeatFile f)
                         throws java.io.IOException,
                                javax.sound.sampled.UnsupportedAudioFileException
Where the magic happens. Extract features from file.

Throws:
java.io.IOException
javax.sound.sampled.UnsupportedAudioFileException

run

public void run()
Set everything up, process input, and write output.

Specified by:
run in interface java.lang.Runnable
Specified by:
run in class MEAPUtil

setFeatureExtractorWeights

public void setFeatureExtractorWeights(java.util.Vector v)
Set weights associated with the different FeatureExtractors used by this object.


setClearNonMetaFeatures

public void setClearNonMetaFeatures(boolean clearNonMF)
Should this FeatExtractor clear any non meta features?


setWindowSize

public void setWindowSize(double winSize)
Set the STFT window size for the feature extractors to use.

Parameters:
winSize - - window size in seconds

setHopSize

public void setHopSize(double hopSize)
Set the STFT hop size for the feature extractors to use.

Parameters:
hopSize - - hop size in seconds

getWindowSize

public double getWindowSize()
Get the STFT window size used by the feature extractors.


getHopSize

public double getHopSize()
Get the STFT hop size used by the feature extractors.


main

public static void main(java.lang.String[] args)