Communications Blockset    
Data Mapper

Map integer symbols from one coding scheme to another

Library

Utility Functions

Description

The Data Mapper block accepts integer inputs and produces integer outputs. You can select one of four mapping modes: Binary to Gray, Gray to Binary, User Defined, or Straight Through.

The input can be either a scalar, a sample-based vector, or a frame-based column vector.

Gray coding is an ordering of binary numbers such that all adjacent numbers differ by only one bit. However, the inputs and outputs of this block are integers, not binary vectors. As a result, the first two mapping modes perform code conversions as follows:

As an example, the table below shows both the Binary to Gray and Gray to Binary mappings for integers in the range 0 to 7. In the Binary to Gray Mode Output column, notice that binary representations in successive rows differ by exactly one bit. In the Gray to Binary Mode columns, notice that sorting the rows by Output value creates a Gray code ordering of Input binary representations.

Binary to Gray Mode
Gray to Binary Mode
Input
Output
Input
Output
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. For example, the vector [1,5,0,4,2,3] defines the following mapping:

When you select the Straight Through mode, the output equals the input.

Dialog Box

Mapping mode
The type of data mapping that the block performs.
Symbol set size
Symbol set size of M restricts this block's inputs and outputs to integers in the range 0 to M-1.
Mapping vector
A vector of length M that contains the integers from 0 to M-1. The order of the elements of this vector specifies the mapping of inputs to outputs. This field is active only when Mapping mode is set to User Defined.

  CRC-N Syndrome Detector DBPSK Demodulator Baseband