| Signal Processing Blockset™ | ![]() |
Quantizers
dspquant2

The Scalar Quantizer Decoder block transforms the zero-based input index values into quantized output values. The set of all possible quantized output values is defined by the Codebook values parameter.
Use the Codebook values parameter to specify a matrix containing all possible quantized output values. You can select how you want to enter the codebook values using the Source of codebook parameter. When you select Specify via dialog, type the codebook values into the block parameters dialog box. When you select Input port, port C appears on the block. The block uses the input to port C as the Codebook values parameter.
The input to this block is a vector of integer index values, where 0 ≤ index <N and N is the number of distinct codeword vectors in the codebook matrix. Use the Action for out of range index value parameter to determine what happens when an input index value is outside this range. When you want any index value less than 0 to be set to 0 and any index value greater than or equal to N to be set to N -1, select Clip. When you want to be warned when clipping occurs, select Clip and warn. When you want the simulation to stop and the block to display an error when the index values are out of range, select Error.
The data type of the index values input at port I can be uint8, uint16, uint32, int8, int16, or int32. The data type of the codebook values input at port C can be double, single, or Fixed-point.
The output of the block is the quantized output values. If, for the Source of codebook parameter, you select Specify via dialog, the Codebook and output data type parameter appears. You can use this parameter to specify the data type of the codebook and quantized output values. In this case, the data type of the output values can be Same as input, double, single, Fixed-point, or User-defined. If, for the Source of codebook parameter you select Input port, the quantized output values have the same data type as the codebook values input at port C.

Choose Specify via dialog to type the codebook values into the block parameters dialog box. Select Input port to specify the codebook using input port C.
Use this parameter to determine the block's behavior when an input index value is out of range, where 0 ≤ index <N and N is the length of the codebook vector. Select Clip, when you want any index values less than 0 to be set to 0 and any index values greater than or equal to N to be set to N -1. Select Clip and warn, when you want to be warned when clipping occurs. Select Error, when you want the simulation to stop and the block to display an error when the index values are outside the range.
Enter a vector of quantized output values that correspond to each index value. Tunable.
Use this parameter to specify the data type of the codebook and quantized output values. The data type can be Same as input, double, single, Fixed-point, or User-defined. This parameter becomes visible when you select Specify via dialog for the Source of codebook parameter.

Select to output a signed fixed-point signal. Otherwise, the signal is unsigned. This parameter is only visible if, from the Codebook and output data type list, you select Fixed-point.
Specify the word length, in bits, of the fixed-point output data type. This parameter is only visible if, from the Codebook and output data type list, you select Fixed-point.
Specify the scaling of the fixed-point output by either of the following two methods:
Choose Best precision to have the output scaling automatically set such that the output signal has the best possible precision.
Choose User-defined to specify the output scaling in the Fraction length parameter.
This parameter is only visible if, from the Codebook and output data type list, you select Fixed-point or when you select User-defined and the specified output data type is a fixed-point data type.
For fixed-point output data types, specify the number of fractional bits, or bits to the right of the binary point. This parameter is only visible when you select Fixed-point or User-defined for the Codebook and output data type parameter and User-defined for the Set fraction length in output to parameter.

Specify any built-in or fixed-point data type. You can specify fixed-point data types using the following Simulink Fixed Point functions: sfix, ufix, sint, uint, sfrac, and ufrac. This parameter is only visible when you select User-defined for the Codebook and output data type parameter.
Gersho, A. and R. Gray. Vector Quantization and Signal Compression. Boston: Kluwer Academic Publishers, 1992.
| Port | Supported Data Types |
|---|---|
I |
|
C |
|
Q(U) |
|
For more information on what data types are supported for each quantizer mode, see Data Type Support.
| Quantizer | Simulink |
| Scalar Quantizer Design | Signal Processing Blockset |
| Scalar Quantizer Encoder | Signal Processing Blockset |
| Uniform Encoder | Signal Processing Blockset |
| Uniform Decoder | Signal Processing Blockset |
![]() | Scalar Quantizer (Obsolete) | Scalar Quantizer Design | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |