Map integer symbols from one coding scheme to another
Communications Toolbox / Utility Blocks
The Data Mapper block accepts integer inputs and maps them to integer outputs. The mapping types include: binary to Gray coded, Gray coded to binary, and user defined. Additionally, a pass through option is available.
Gray coding is an ordering of binary numbers such that all adjacent numbers differ by only one bit.
Port_1— Input port
Input signal, specified as a scalar, vector, or matrix of integers. Elements of the input signal must be nonnegative values. The block truncates noninteger values to integer values. When the input is a matrix, the columns are treated as independent channels.
Port_2— Output signal
Output signal, returned as a scalar, column vector, or matrix. The dimensions of the output signal match those of the input signal.
Mapping mode— Mapping mode
Binary to Gray(default) |
Gray to Binary|
Mapping mode, specified as one of the four options. The mapping for the
Binary to Gray and the
Binary modes are shown in the following table when the
inputs range from 0 to 7.
|Binary to Gray Mode||Gray to Binary Mode|
|0||0 (000)||0 (000)||0|
|1||1 (001)||1 (001)||1|
|2||3 (011)||2 (010)||3|
|3||2 (010)||3 (011)||2|
|4||6 (110)||4 (100)||7|
|5||7 (111)||5 (101)||6|
|6||5 (101)||6 (110)||4|
|7||4 (100)||7 (111)||5|
When you select the
User Defined mode, you can
use any arbitrary mapping by providing a vector to specify the output
ordering. When you select the
mode, the output equals the input.
Symbol set size (M)— Symbol set size
8(default) | positive integer
Symbol set size, specified as a positive integer. This parameter restricts the inputs and outputs to integers in the range of 0 to M-1.
Mapping vector— Maps input elements to the output elements
[0 1 3 2 7 6 4 5](default) | vector
Mapping vector, specified as vector of nonnegative integers whose length
equals . This parameter defines the relationship between the input and
output integers. For example, the vector
[1 5 0 4 2 3]
defines the following mapping: