Communications Blockset | ![]() ![]() |
Map a vector of bits to a corresponding vector of integers
Library
Description
The Bit to Integer Converter block maps groups of bits in the input vector to integers in the output vector. If M is the Number of bits per integer parameter, then the block maps each group of M bits to an integer between 0 and 2M-1. As a result, the output vector length is 1/M times the input vector length.
If the input is sample-based input, then it must be a vector whose length equals the Number of bits per integer parameter. If the input is frame-based, then it must be a column vector whose length is an integer multiple of Number of bits per integer.
The block interprets the first bit in each group as the most significant bit.
Dialog Box
Examples
If the input is [0; 1; 1; 1; 1; 1; 0; 1] and the Number of bits per integer parameter is 4, then the output is [7; 13]. The block maps the first group of four bits (0, 1, 1, 1) to 7 and the second group of four bits (1, 1, 0, 1) to 13. Notice that the output length is one-fourth of the output length.
Pair Block
![]() | Bipolar to Unipolar Converter | BPSK Demodulator Baseband | ![]() |