Skip to content

Commit 10d87c7

Browse files
committed
Updated doc-strings.
1 parent b998b01 commit 10d87c7

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

commpy/channelcoding/convcode.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class Trellis:
8686
2
8787
>>> print trellis.number_states
8888
4
89-
print trellis.number_inputs
89+
>>> print trellis.number_inputs
9090
2
9191
>>> print trellis.next_state_table
9292
[[0 2]

commpy/channelcoding/gfields.py

+15
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ def __mul__(self, x):
7373
raise ValueError, "Two sets of elements cannot be multiplied"
7474

7575
def power_to_tuple(self):
76+
"""
77+
Convert Galois field elements from power form to tuple form representation.
78+
"""
7679
y = zeros(len(self.elements))
7780
for idx, i in enumerate(self.elements):
7881
if 2**i < 2**self.m:
@@ -82,6 +85,9 @@ def power_to_tuple(self):
8285
return GF(y, self.m)
8386

8487
def tuple_to_power(self):
88+
"""
89+
Convert Galois field elements from tuple form to power form representation.
90+
"""
8591
y = zeros(len(self.elements))
8692
for idx, i in enumerate(self.elements):
8793
if i != 0:
@@ -98,13 +104,19 @@ def tuple_to_power(self):
98104
return GF(y, self.m)
99105

100106
def order(self):
107+
"""
108+
Compute the orders of the Galois field elements.
109+
"""
101110
orders = zeros(len(self.elements))
102111
power_gf = self.tuple_to_power()
103112
for idx, i in enumerate(power_gf.elements):
104113
orders[idx] = (2**self.m - 1)/(gcd(i, 2**self.m-1))
105114
return orders
106115

107116
def cosets(self):
117+
"""
118+
Compute the cyclotomic cosets of the Galois field.
119+
"""
108120
coset_list = []
109121
x = self.tuple_to_power().elements
110122
mark_list = zeros(len(x))
@@ -127,6 +139,9 @@ def cosets(self):
127139
return coset_list
128140

129141
def minpolys(self):
142+
"""
143+
Compute the minimal polynomials for all elements of the Galois field.
144+
"""
130145
minpol_list = array([])
131146
full_gf = GF(arange(2**self.m), self.m)
132147
full_cosets = full_gf.cosets()

0 commit comments

Comments
 (0)