User`s guide
Uniform Encoder
5-470
5Uniform Encoder
Purpose Quantize and encode a floating-point input to an integer output.
Library Quantizers
Description The Uniform Encoder block performs the following two operations on each
floating-point sample in the input vector or matrix:
1 Quantizes the value using the same precision
2 Encodes the quantized floating-point 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 B is specified by the Bits
parameter and V is specified by 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.
The number of bits, B, can be any integer value between 2 and 32, inclusive.
Inputs greater than (1-2
1-B
)V or less than -V saturate at those respective
values. The real and imaginary components of complex inputs saturate
independently.
In the second step, the quantized floating-point value is uniquely mapped
(encoded) to one of 2
B
integer values. If the Output type is set to Unsigned
integer
, the smallest quantized floating-point value, -V, is mapped to the
integer 0, and the largest quantized floating-point value, (1-2
1-B
)V, is mapped
to the integer 2
B
-1. Intermediate quantized floating-point 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.
If the
Output type is set to Signed integer, the smallest quantized
floating-point value, -V, is mapped to the integer -2
B-1
, and the largest
quantized floating-point value, (1-2
1-B
)V, is mapped to the integer 2
B-1
-1.
Intermediate quantized floating-point 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.