comnum.unpack_symbols#

comnum.unpack_symbols(symbols, m)#

Unpack symbols of m bits into bits, the most significant first.

Parameters:
  • symbols (array_like) – the symbols, below 2^m.

  • m (int) – bits per symbol, 1 to 16.

Returns:

m bits per symbol (uint8).

Return type:

numpy.ndarray

Raises:

ValueError – for an input that is not an array of numbers of the expected shape.

Examples

>>> import comnum
>>> comnum.unpack_symbols([11, 12], 4).tolist()
[1, 0, 1, 1, 1, 1, 0, 0]