com.meapsoft.composers
Class VQComposer

java.lang.Object
  extended bycom.meapsoft.MEAPUtil
      extended bycom.meapsoft.composers.Composer
          extended bycom.meapsoft.composers.VQComposer
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
HMMComposer

public class VQComposer
extends Composer

Program that learns a vector quantizer from a FeatFile and uses it to quantize the chunks in another FeatFile. All about VQ: http://www.data-compression.com/vq.html


Field Summary
protected  int beatsPerCodeword
           
protected  int cbSize
           
protected  boolean debug
           
static java.lang.String description
           
protected  ChunkDist dist
           
protected  int[] featdim
           
protected  FeatFile featsToQuantize
           
protected  java.lang.String outFileName
           
protected  java.util.Vector templateChunks
           
protected  FeatFile trainFile
           
 
Fields inherited from class com.meapsoft.MEAPUtil
bigEndian, bitsPerSamp, exceptionHandler, frameLatency, mixerToUse, numChannels, progress, samplingRate, signed, slash, stereo, verbose, version, writeMEAPFile
 
Constructor Summary
VQComposer(FeatFile trainFN, EDLFile outFN)
           
VQComposer(java.lang.String[] args)
           
 
Method Summary
 EDLFile compose()
          Compose an EDLFile.
protected  void learnCodebook(FeatFile trainFile)
          Use the LBG splitting algorithm to learn a VQ codebook
static void main(java.lang.String[] args)
           
 void printUsageAndExit()
           
protected  int quantizeChunk(FeatChunk f)
           
 void setBeatsPerCodeword(int nbeats)
           
 void setCodebookSize(int cb)
           
 void setFeatsToQuantize(FeatFile featFile)
           
 void setup()
          Setup the Composer - read in files, etc.
 
Methods inherited from class com.meapsoft.composers.Composer
addCommand, addCommandsToAllEDLChunks, addCommandsToAllEDLChunks, addCommandToAllEDLChunks, description, doComposer, parseCommands, printCommandLineOptions, run
 
Methods inherited from class com.meapsoft.MEAPUtil
bytes2doubles, doubles2bytes, getPaths, getProgress, openAudioWriter, openAudioWriter, openInputStream, openInputStream, parseChunkDist, parseFeatDim, parseFeatureExtractor, parseFeatureExtractor, printCommandLineOptions, setExceptionHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

description

public static java.lang.String description

outFileName

protected java.lang.String outFileName

trainFile

protected FeatFile trainFile

featsToQuantize

protected FeatFile featsToQuantize

cbSize

protected int cbSize

templateChunks

protected java.util.Vector templateChunks

beatsPerCodeword

protected int beatsPerCodeword

dist

protected ChunkDist dist

featdim

protected int[] featdim

debug

protected boolean debug
Constructor Detail

VQComposer

public VQComposer(FeatFile trainFN,
                  EDLFile outFN)

VQComposer

public VQComposer(java.lang.String[] args)
Method Detail

printUsageAndExit

public void printUsageAndExit()

setup

public void setup()
           throws java.io.IOException,
                  ParserException
Description copied from class: Composer
Setup the Composer - read in files, etc. This should be called before any call to compose() to ensure that the inputs and outputs are properly initialized.

Overrides:
setup in class Composer
Throws:
java.io.IOException
ParserException

learnCodebook

protected void learnCodebook(FeatFile trainFile)
Use the LBG splitting algorithm to learn a VQ codebook


quantizeChunk

protected int quantizeChunk(FeatChunk f)

compose

public EDLFile compose()
Description copied from class: Composer
Compose an EDLFile. This is where the magic happens.

Specified by:
compose in class Composer

setCodebookSize

public void setCodebookSize(int cb)

setBeatsPerCodeword

public void setBeatsPerCodeword(int nbeats)

setFeatsToQuantize

public void setFeatsToQuantize(FeatFile featFile)

main

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