Engee documentation

Uniform Encoder

Quantise and encode floating point input data into integer output data.

uniform encoder

Description

Block Uniform Encoder performs the operation of quantisation and conversion of input floating point data into integer output data.

The block adheres to uniform coding, conforming to the definition of uniform coding in "ITU-T Recommendation G.701".

For more information on how the block calculates the encoded integer output signal, refer to the section Extras.

Ports

Input

Input - input signal
vector | matrix

Floating point input signal as a vector or matrix.

Input signals greater than or less than are saturated at the corresponding values.

The real and imaginary components of complex input data are converted independently.

Data types: Float32 | Float64

Support for complex numbers: Yes

Output

Output - decoded output signal
vector | matrix

Output data of the encoder returned as a vector or matrix.

The block quantises each sample in the floating-point input data and converts the quantised floating-point value to an integer.

See Algorithms for more information on how the block calculates the output data.

Data types: Int8, Int16, Int32, UInt8, UInt16, UInt32

Support for complex numbers: Yes

Parameters

Main

Peak - the largest amplitude of the input signal
1 (by default) | non-negative scalar

Specify the largest amplitude of the input signal as a non-negative scalar.

Actual or imaginary input values greater than or less than , are saturated (independently for complex inputs) within these limits.

Bits - number of bits
8 (by default) | an integer in the range [2, 32].

Specify the number of bits , required by the block to represent integer output data. The number of bits can be any integer between 2 and 32 inclusive.

The number of levels at which the block quantises floating-point input data is equal to .

Output type - output data type
Unsigned integer (by default) | Signed integer

Specify the data type for block output:

  • ` Unsigned integer - the block maps the smallest floating-point quantised value to integer 0 and the largest floating-point quantised value to integer . It linearly (uniformly) maps intermediate floating point quantised values to intermediate integers in the range ]. To improve efficiency, the block automatically selects an unsigned output data type (UInt8, UInt16, or UInt32) with a minimum number of bits equal to or greater than .

  • Signed integer - block maps the smallest floating-point quantised value to an integer , and the largest floating-point quantised value to an integer . It linearly maps intermediate floating point quantised values to intermediate integers in the range ]. The block automatically selects a signed output data type (Int8, Int16 or Int32) with a minimum number of bits equal to or greater than .

This table summarises the output data types that the block uses.

Bits

Unsigned Integer

Signed Integer.

2 to 8

UInt8

Int8

9 to 16

UInt16

Int16

17 to 32

UInt32

Int32

Extras

*Algorithms.

Block Uniform Encoder performs these two operations on each floating point sample in the input data.

  1. Quantises the value with the same precision.

  2. Encodes the quantised floating point value into an integer.

In the first step, the block quantises the input value to one of equally spaced levels in the range ], where you specify in the Bits parameter and in the Peak parameters. The quantisation process rounds both positive and negative input data down to the nearest quantisation level, except for those that are exactly on the quantisation boundary. It independently quantises the real and imaginary components of complex input data.

In a second step, the block uniquely converts (encodes) the quantised floating point value into one of integer values.

When you set the Output type to Unsigned integer, the block converts the smallest floating-point quantised value to an integer 0, and the largest floating-point quantised value to an integer . It linearly (uniformly) converts intermediate floating-point quantised values to intermediate integers in the range ]. To improve efficiency, the block automatically selects an unsigned output data type (UInt8, UInt16 or UInt32) with a minimum number of bits equal to or greater than .

When the Output type parameters are set to Signed integer, the smallest floating point quantised value is converted to an integer , and the largest floating point quantised value is converted to an integer . Intermediate floating point quantised values are linearly converted to intermediate integers in the range ]. The block automatically selects a signed output data type (Int8, Int16 or Int32) with a minimum number of bits equal to or greater than .

References