Communications Toolbox    
quantiz

Produce a quantization index and a quantized output value

Syntax

Description

index = quantiz(sig,partition) returns the quantization levels in the real vector signal sig using the parameter partition. partition is a real vector whose entries are in strictly ascending order. If partition has length n, then index is a column vector whose kth entry is

[index,quants] = quantiz(sig,partition,codebook) is the same as the syntax above, except that codebook prescribes a value for each partition in the quantization and quants contains the quantization of sig based on the quantization levels and prescribed values. codebook is a vector whose length exceeds the length of partition by one. quants is a row vector whose length is the same as the length of sig. quants is related to codebook and index by

where ii is an integer between 1 and length(sig).

[index,quants,distor] = quantiz(sig,partition,codebook) is the same as the syntax above, except that distor estimates the mean square distortion of this quantization data set.

Examples

The command below rounds several numbers between 1 and 100 up to the nearest multiple of ten. quants contains the rounded numbers, and index tells which quantization level each number is in.

See Also
lloyds, dpcmenco, dpcmdeco


  qaskenco randerr