Search code examples
matlabquantization

is it possible to get code books from code words in the vector quantization?


i was working in matlab for vector quatization as we know in vector Quantization, if we provide set of code words as an input we get code vectors so what i did , i used LPG and Loyed algorithms to do that by :-

          training set=randn(2,100) == code word 
             distortion=0.001
         [code book]=Vector-Quantization (training set,distortion)

the result was some locations of code word now , i want to be the locations of code book as a subset of locations of code vectors ? ali


Solution

  • A codebook can be thought of as a 2D array.
    A codeword is one row in that 2D array.

    If you are given a codeword you cannot reconstruct a codebook as the codeword only contains the information held within that row.

    If you know the size of the codebook is 256, and you have 256 codewords then you just have to place all the codewords in order to "reconstruct" the codebook.
    Alternatively, if you know the codebook was sorted by distortion values (very common) then you can calculate the distortion of each row and sort accordingly.

    I hope this answer is of help to you as I'm not sure I fully understand your question.