Vector Quantizer Decoder
Find vector quantizer codeword that corresponds to given, zero-based index value
Library
Quantizers
dspquant2
Description
The Vector Quantizer Decoder block associates each input index value with a codeword, a column vector of quantized output values defined in the Codebook values parameter. When you input multiple index values into this block, the block outputs a matrix of quantized output vectors. This matrix is created by horizontally concatenating the codeword vectors that correspond to each index value.
You can select how you want to enter the codebook values using the Source of
codebook parameter. When you select Specify via
dialog
, you can type the codebook values into the block parameters
dialog box. Select Input port
and port C appears on the
block. The block uses the input to port C as the Codebook values
parameter.
The Codebook values parameter is a k-by-N matrix of values, where k ≥ 1 and N ≥ 1. Each column of this matrix is a codeword vector, and each codeword vector corresponds to an index value. The index values are zero based; therefore, the first codeword vector corresponds to an index value of 0, the second codeword vector corresponds to an index value of 1, and so on.
The input to this block is a vector of index values, where 0 ≤ index < N and N is the number of columns of the codebook
matrix. Use the Action for out of range index value parameter to
determine how the block behaves when an input index value is out of this range. 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
. When you want to be warned when any index values
less than 0 are set to 0 and any index values greater than or equal to
N are set to N-1, select Clip and
warn
. When you want the simulation to stop and display an error when
the index values are out of range, select Error
.
Data Type Support
The input to the block can be the index values and the codebook values. The data
type of the index input to the block at port I can be
uint8
, uint16
,
uint32
, int8
,
int16
, or int32
. The data
type of the codebook values can be double
,
single
, or Fixed-point.
The output of the block is the quantized output values. These quantized output
values always have the same data type as the codebook values. When the codebook
values are specified via an input port, the block assigns the same data type to the
Q(U) output port. When the codebook values are specified via the dialog, use the
Codebook and output data type parameter to specify the data
type of the Q(U) output port. The data type of the codebook and quantized output can
be Same as input
, double
,
single
, Fixed-point
,
User-defined
, or Inherit via back
propagation
.
Dialog Box
The Main pane of the Vector Quantizer Decoder block dialog appears as follows.
- Action for out of range index value
Choose the behavior of the block 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. SelectClip and warn
when you want to be warned when any index values less than 0 are set to 0 and any index values greater than or equal to N are set to N-1. SelectError
when you want the simulation to stop and display an error when the index values are out of range.- Source of codebook
Choose
Specify via dialog
to type the codebook values into the block parameters dialog box. SelectInput port
to specify the codebook values using the block's input port, C.- Codebook values
Enter a k-by-N matrix of quantized output values, where 1 ≤ k and 1 ≤ N . Each column of your matrix corresponds to an index value. This parameter is visible if, from the Source of codebook list, you select
Specify via dialog
.
The Data Types pane of the Vector Quantizer Decoder block dialog appears as follows.
- Codebook and output data type
Specify the data type of the codebook and quantized output values. You can select one of the following:
A rule that inherits a data type, for example,
Inherit: Same as input
.A built in data type, such as
double
An expression that evaluates to a valid data type, for example,
fixdt(1,16)
Click the Show data type assistant button
to display the Data Type Assistant, which helps you set the Output data type parameter.
See Control Data Types of Signals (Simulink) for more information.
This parameter is available only when you set the Source of codebook parameter to
Specify via dialog
. If you set the Source of codebook parameter toInput port
, the output values have the same data type as the input codebook values.
Codebook and Output Data Type Assistant Parameters
Select how you would like to specify the data type properties of the Codebook and output data type. You can choose:
Inherit
— Lets you specify a rule for inheriting a data type, for example,Inherit: Same as input
Built in
— Lets you specify a built in data type, for example,double
Fixed point
— Lets you specify the fixed-point attributes of the data type.Expression
— Lets you specify an expression that evaluates to a valid data type, for example,fixdt(1,16)
Specify the Signedness for the Codebook and output data type.
Specify the Scaling for the Codebook and output data type.
For more information see Scaling in the DSP System Toolbox™ User's Guide.
Specify the Word length for the Codebook and output data type.
Specify the Fraction length for the Codebook and output data type.
Specify the data type override mode. You can select one of the following options:
Inherit
— Inherits the data type override setting specified for the model.Off
— Ignores the data type override setting specified for the model and uses the fixed-point data type you specify
This parameter appears only when you set the Mode parameter
to Built in
or Fixed Point
.
For more information, see Specify Data Types Using Data Type Assistant (Simulink).
References
Gersho, A. and R. Gray. Vector Quantization and Signal Compression. Boston: Kluwer Academic Publishers, 1992.
Supported Data Types
Port | Supported Data Types |
---|---|
I |
|
C |
|
Q(U) |
|
See Also
Quantizer (Simulink) | Simulink |
Scalar Quantizer Decoder | DSP System Toolbox |
Uniform Encoder | DSP System Toolbox |
Uniform Decoder | DSP System Toolbox |
Vector Quantizer Encoder | DSP System Toolbox |
Extended Capabilities
Version History
Introduced before R2006a