Skip to content

komm.ConvolutionalStreamEncoder

Convolutional stream encoder. Encode a bit stream using a given convolutional code. The internal state of the encoder is maintained across each call.

Attributes:

  • convolutional_code (ConvolutionalCode)

    The convolutional code.

  • state (int)

    The current state of the encoder. The default value is 0.

__call__

Parameters:

  • input (ArrayLike)

    The bit sequence to be encoded.

Returns:

  • output (NDArray[integer])

    The encoded bit sequence.

Examples:

>>> convolutional_code = komm.ConvolutionalCode([[0o7, 0o5]])
>>> encoder = komm.ConvolutionalStreamEncoder(convolutional_code)
>>> encoder([1, 1, 1, 1])
array([1, 1, 0, 1, 1, 0, 1, 0])
>>> encoder([1, 1, 1, 1])
array([1, 0, 1, 0, 1, 0, 1, 0])