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
.
Input:
-
in0
(Array1D[int]
) –The bit sequence to be encoded.
Output:
-
out0
(Array1D[int]
) –The encoded bit sequence.
Examples:
>>> convolutional_code = komm.ConvolutionalCode([[0o7, 0o5]])
>>> convolutional_encoder = komm.ConvolutionalStreamEncoder(convolutional_code)
>>> convolutional_encoder([1, 1, 1, 1])
array([1, 1, 0, 1, 1, 0, 1, 0])
>>> convolutional_encoder([1, 1, 1, 1])
array([1, 0, 1, 0, 1, 0, 1, 0])