-3

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

  • 1
    Your question is very unclear. Please add more information and clarify what is your issue. If you have code which is not producing the required result, post it and the expected results and explain them. – buzjwa Sep 03 '15 at 08:04
  • i did edit my question – Ali Al-Qamaji Sep 03 '15 at 09:59
  • Still vague. Please provide a [mcve] detailing what you've tried, why it does not work for you and what to expected output is. – Adriaan Sep 03 '15 at 10:02

1 Answers1

0

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.

Sterls
  • 723
  • 12
  • 22
  • as you and me know that vector quantization compress the image , i mean for given training set with ,distortion and no.of code book we can get the locations of code book how represents the training set but for my field that is not all the story , and now my question , how can i make the code books be such a subset from training set ?? i deployed 100 sensor node ( training set,code word,blue dots )(N=100) and then i applied that to the VQ algorithm as a result i got red dots (M=16) , BUT red dots not belong to any of locations of blue dots how can i make code books come from blue dots ? – Ali Al-Qamaji Sep 07 '15 at 19:30