com.meapsoft.composers
Class VQComposer
java.lang.Object
com.meapsoft.MEAPUtil
com.meapsoft.composers.Composer
com.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
Fields inherited from class com.meapsoft.MEAPUtil |
bigEndian, bitsPerSamp, exceptionHandler, frameLatency, mixerToUse, numChannels, progress, samplingRate, signed, slash, stereo, verbose, version, writeMEAPFile |
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 |
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
VQComposer
public VQComposer(FeatFile trainFN,
EDLFile outFN)
VQComposer
public VQComposer(java.lang.String[] args)
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)