Communications Blockset | ![]() ![]() |
Quantize a signal, indicating quantization index, coded signal, and distortion
Library
Description
The Sampled Quantizer Encode block encodes an input signal using scalar quantization. The block outputs the quantization levels (or quantization index) of the input signal, the encoded signal, and the mean square distortion.
The input can be either a scalar, a sample-based vector, or a frame-based row vector. This block processes each vector element independently. Each output signal is a vector of the same length as the input signal.
The Quantization partition parameter is a length-n real vector whose entries are in strictly ascending order. The first output signal corresponding to an input signal of x is:
The Quantization codebook parameter, whose length exceeds the length of Quantization partition by one, prescribes a value for each partition in the quantization. The first element of Quantization codebook is the value for the interval between negative infinity and the first element of Quantization partition. The second output signal from this block contains the quantization of the input based on the quantization levels and prescribed values.
At a given time, the third output signal measures the mean square distortion between the input and the second output, considering the stream of data up through that time.
You can use the function lloyds
in the Communications Toolbox with a representative sample of your data as training data, to obtain appropriate partition and codebook parameters.
Dialog Box
Pair Block
See Also
Enabled Quantizer Encode; lloyds
(Communications Toolbox)
![]() | Rician Noise Generator | Scatter Plot | ![]() |