|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--ocvolume.vq.codebook
last updated on June 15, 2002
description: codebook for Vector Quantization component
calls: centroid, point
called by: volume, train
input: speech signal
output: set of centroids, set of indices
| Field Summary | |
protected centroid[] |
centroids
centroids array |
protected int |
codebook_size
codebook size - number of codewords (codevectors) default is: 256 |
protected int |
dimension
dimension |
protected double |
MIN_DISTORTION
minimum distortion |
protected point[] |
pt
training points |
protected double |
SPLIT
split factor (should be in the range of 0.01 <= SPLIT <= 0.05) |
| Constructor Summary | |
codebook(point[] tmpPt)
constructor to train a codebook with given training points and default codebook size (256) calls: none called by: trainCodebook |
|
codebook(point[] tmpPt,
int size)
constructor to train a codebook with given training points and codebook size calls: none called by: trainCodebook |
|
codebook(java.sql.ResultSet rs,
int d,
int cbk_size)
constructor to load a codebook from a Result Set calls: centroid called by: volume |
|
codebook(java.lang.String inputFile)
constructor to load a saved codebook from external file calls: centroid called by: volume |
|
| Method Summary | |
double |
getDistortion(point[] pts)
calculates the distortion calls: none called by: volume |
protected void |
initialize()
creates a codebook using LBG algorithm which includes K-means calls: centroid called by: codebook |
int[] |
quantize(point[] pts)
quantize the input array of points in k-dimensional space calls: none called by: volume |
void |
saveToDB(java.lang.String word)
save codebook to database calls: database called by: train |
void |
saveToFile(java.lang.String filepath)
save codebook to txt file calls: none called by: train |
protected void |
split()
splitting algorithm to increase number of centroids by multiple of 2 calls: centroid called by: codebook |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected final double SPLIT
protected final double MIN_DISTORTION
protected int codebook_size
protected centroid[] centroids
protected point[] pt
protected int dimension
| Constructor Detail |
public codebook(point[] tmpPt,
int size)
tmpPt - training vectorssize - codebook sizepublic codebook(point[] tmpPt)
tmpPt - training vectors
public codebook(java.sql.ResultSet rs,
int d,
int cbk_size)
rs - the Result Set from databased - dimension of the points in the codebookcbk_size - size of codebookpublic codebook(java.lang.String inputFile)
inputFile - file location| Method Detail |
protected void initialize()
public void saveToDB(java.lang.String word)
word - word that the codebook is trained forpublic void saveToFile(java.lang.String filepath)
filepath - external file pathprotected void split()
public int[] quantize(point[] pts)
pts - points to be quantized
public double getDistortion(point[] pts)
pts - points to calculate the distortion with
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||