2

I'm using uencode to quantize matrix this way:

quantized = uencode(impact_factor_matrix,5);

where impact_fator_matrix is a 512x512 matrix of floating point values basically between 0 and 3 a small fragment of this matrix looks like this:

0,0199035905058660 0,0172736449099186 0,0180819705503344

0,0622572806364690 1,13389341902768 1

0,0606586901989121 1,27920429813366 1

so using uencode gives me levels that I need but I can't figure what ranges is used by this function to assign values to quantization levels to be specific for this 3x3 example I get

16 16 16

16 31 31

16 31 31

I can't find out what ranges are used to assiggn to quantization levels. How is this calculated. Thanks in advance.

Community
  • 1
  • 1
hesar
  • 529
  • 4
  • 8
  • You are using the default value for `v`, which is 1, and therefore all values of `imapct_facotr_matrix` larger than one are saturated at 31. try `uencode( impact_factor_matrix, 5, 3 );` – Shai Jul 28 '14 at 12:28
  • 4
    http://www.mathworks.co.uk/help/signal/ref/uencode.html output y are unsigned integers with magnitudes in the range [0, 2n-1]. Elements of the input u outside of the range [-1,1] are treated as overflows and are saturated. So in your case the range is 0:31 (but everything above 1.0 is saturated – nicolas Jul 28 '14 at 12:31
  • @seb this is total range but I need to know midranges :P I don't know how to expalin this: 0-0.11 = 1; 0.11 - 0.22 = 2; and so on – hesar Jul 28 '14 at 13:05
  • You mean something like: `n=5;[ [0:2^n-1]./2^n; [1:2^n]./2^n; [0:2^n-1];].'` – nicolas Jul 28 '14 at 13:12
  • I did not actually try, so there might be an offset to use. Anyway I don't think there is a special Matlab function, so unless someone knows one, you might need to compute it yourself, similar to what I wrote (again there might be boundaries issues so better try) – nicolas Jul 28 '14 at 13:21

0 Answers0