Class defining a Trellis corresponding to a k/n - rate convolutional code.
Parameters : | memory : 1D ndarray of ints
g_matrix : 2D ndarray of ints (octal representation)
feedback : int, optional
code_type : {‘default’, ‘rsc’}, optional
|
---|
Examples
>>> from numpy import array
>>> import commpy.channelcoding.convcode as cc
>>> memory = array([2])
>>> g_matrix = array([[05, 07]]) # G(D) = [1+D^2, 1+D+D^2]
>>> trellis = cc.Trellis(memory, g_matrix)
>>> print trellis.k
1
>>> print trellis.n
2
>>> print trellis.total_memory
2
>>> print trellis.number_states
4
print trellis.number_inputs
2
>>> print trellis.next_state_table
[[0 2]
[0 2]
[1 3]
[1 3]]
>>>print trellis.output_table
[[0 3]
[3 0]
[1 2]
[2 1]]
Attributes
Methods
visualize([trellis_length, state_order, ...]) | Plot the trellis diagram. |
Methods
__init__(memory, g_matrix[, feedback, code_type]) | |
visualize([trellis_length, state_order, ...]) | Plot the trellis diagram. |