Uniform Encoder
Quantize and encode floating-point input into integer output
Libraries:
DSP System Toolbox /
Quantizers
Description
The Uniform Encoder block performs these two operations on each floating-point sample in the input vector or matrix:
Quantizes the value using the same precision
Encodes the quantized floating-point value to an integer value
For more information on how the block computes the output, see Algorithms.
The Uniform Encoder block operations adhere to the definition for uniform encoding specified in ITU-T Recommendation G.701.
Examples
Ports
Input
Output
Parameters
Block Characteristics
Data Types |
|
Direct Feedthrough |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Zero-Crossing Detection |
|
Algorithms
The Uniform Encoder block performs these two operations on each floating-point sample in the input.
Quantizes the value using the same precision
Encodes the quantized floating-point value to an integer value
In the first step, the block quantizes an input value to one of 2B uniformly spaced levels in the range [−V, (1−21−B)V], where you specify B in the Bits parameter and you specify V in the Peak parameter. The quantization process rounds both positive and negative inputs downward to the nearest quantization level, with the exception of those that fall exactly on a quantization boundary. It quantizes the real and imaginary components of complex inputs independently.
In the second step, the block uniquely maps (encodes) the quantized floating-point value to
one of 2B integer values. When you set the
Output type to Unsigned
integer
, the blocks maps the smallest quantized floating-point value
−V to the integer 0 and the largest quantized floating-point
value (1−21−B)V to the
integer 2B−1. It linearly (uniformly) maps
the intermediate quantized floating-point values to the intermediate integers in the
range [0, 2B−1]. For efficiency, the block
automatically selects an unsigned output data type
(uint8
, uint16
, or
uint32
) with the minimum number of bits equal to or
greater than B.
When the Output type is set to Signed
integer
, the smallest quantized floating-point value
−V is mapped to the integer
−2B−1, and the largest quantized
floating-point value
(1−21−B)V is mapped
to the integer 2B−1−1. Intermediate
quantized floating-point values are linearly mapped to the intermediate integers in the
range [−2B−1,
2B−1−1]. The block automatically
selects a signed output data type (int8
,
int16
, or int32
) with the
minimum number of bits equal to or greater than B.
References
[1] General Aspects of Digital Transmission Systems: Vocabulary of Digital Transmission and Multiplexing, and Pulse Code Modulation (PCM) Terms, International Telecommunication Union, ITU-T Recommendation G.701, March, 1993.
Extended Capabilities
Version History
Introduced before R2006a
See Also
Functions
Blocks
- Data Type Conversion (Simulink) | Quantizer (Simulink) | Scalar Quantizer Decoder | Uniform Decoder