Uniform Encoder
Quantize and encode floatingpoint input into integer output
Libraries:
DSP System Toolbox /
Quantizers
Description
The Uniform Encoder block performs the following two operations on each floatingpoint sample in the input vector or matrix:
Quantizes the value using the same precision
Encodes the quantized floatingpoint 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 ITUT Recommendation G.701.
Examples
Ports
Input
Output
Parameters
Block Characteristics
Data Types 

Direct Feedthrough 

Multidimensional Signals 

VariableSize Signals 

ZeroCrossing Detection 

Algorithms
The Uniform Encoder block performs the following two operations on each floatingpoint sample in the input.
Quantizes the value using the same precision
Encodes the quantized floatingpoint value to an integer value
In the first step, the block quantizes an input value to one of 2^{B} uniformly spaced levels in the range [−V, (1−2^{1−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. The real and imaginary components of complex inputs are quantized independently.
In the second step, the quantized floatingpoint value is uniquely mapped (encoded) to
one of 2^{B} integer values. When the
Output type is set to Unsigned
integer
, the smallest quantized floatingpoint value
−V is mapped to the integer 0 and the largest quantized
floatingpoint value
(1−2^{1−B})V is mapped
to the integer 2^{B}−1. Intermediate
quantized floatingpoint values are linearly (uniformly) mapped to the intermediate
integers in the range [0, 2^{B}−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 floatingpoint value
−V is mapped to the integer
−2^{B−1}, and the largest quantized
floatingpoint value
(1−2^{1−B})V is mapped
to the integer 2^{B−1}−1. Intermediate
quantized floatingpoint values are linearly mapped to the intermediate integers in the
range [−2^{B−1},
2^{B−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, ITUT 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