komm.TerminatedConvolutionalCode
Terminated convolutional code. It is a linear block code obtained by terminating a $(n_0, k_0)$ convolutional code. A total of $h$ information blocks (each containing $k_0$ information bits) is encoded. The dimension of the resulting block code is thus $k = h k_0$; its length depends on the termination mode employed. There are three possible termination modes:
-
Direct truncation. The encoder always starts at state $0$, and its output ends immediately after the last information block. The encoder may not necessarily end in state $0$. The resulting block code will have length $n = h n_0$.
-
Zero termination. The encoder always starts and ends at state $0$. To achieve this, a sequence of $k \mu$ tail bits is appended to the information bits, where $\mu$ is the memory order of the convolutional code. The resulting block code will have length $n = (h + \mu) n_0$.
-
Tail-biting. The encoder always starts and ends at the same state. To achieve this, the initial state of the encoder is chosen as a function of the information bits. The resulting block code will have length $n = h n_0$.
For more details, see LC04, Sec. 12.7 and WBR01.
Attributes:
-
convolutional_code
(ConvolutionalCode
) –The convolutional code to be terminated.
-
num_blocks
(int
) –The number $h$ of information blocks.
-
mode
(TerminationMode
) –The termination mode. It must be one of
'direct-truncation'
|'zero-termination'
|'tail-biting'
. The default value is'zero-termination'
.
Examples:
>>> convolutional_code = komm.ConvolutionalCode([[0b1, 0b11]])
>>> code = komm.TerminatedConvolutionalCode(convolutional_code, num_blocks=3, mode='direct-truncation')
>>> (code.length, code.dimension, code.redundancy)
(6, 3, 3)
>>> code.generator_matrix
array([[1, 1, 0, 1, 0, 0],
[0, 0, 1, 1, 0, 1],
[0, 0, 0, 0, 1, 1]])
>>> code.minimum_distance()
2
>>> code = komm.TerminatedConvolutionalCode(convolutional_code, num_blocks=3, mode='zero-termination')
>>> (code.length, code.dimension, code.redundancy)
(8, 3, 5)
>>> code.generator_matrix
array([[1, 1, 0, 1, 0, 0, 0, 0],
[0, 0, 1, 1, 0, 1, 0, 0],
[0, 0, 0, 0, 1, 1, 0, 1]])
>>> code.minimum_distance()
3
>>> code = komm.TerminatedConvolutionalCode(convolutional_code, num_blocks=3, mode='tail-biting')
>>> (code.length, code.dimension, code.redundancy)
(6, 3, 3)
>>> code.generator_matrix
array([[1, 1, 0, 1, 0, 0],
[0, 0, 1, 1, 0, 1],
[0, 1, 0, 0, 1, 1]])
>>> code.minimum_distance()
3