Communications Blockset | ![]() ![]() |
Map integer symbols from one coding scheme to another
Library
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.
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
![]() | CRC-N Syndrome Detector | DBPSK Demodulator Baseband | ![]() |