Skip to content

Commit 8936040

Browse files
committed
Minors changes to insure Python 3.7 compatibility
Octal numbers: 05 => 0o5 Print as function calls
1 parent 303bb7c commit 8936040

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

commpy/channelcoding/convcode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class Trellis:
7676
>>> from numpy import array
7777
>>> import commpy.channelcoding.convcode as cc
7878
>>> memory = array([2])
79-
>>> g_matrix = array([[05, 07]]) # G(D) = [1+D^2, 1+D+D^2]
79+
>>> g_matrix = array([[0o5, 0o7]]) # G(D) = [1+D^2, 1+D+D^2]
8080
>>> trellis = cc.Trellis(memory, g_matrix)
8181
>>> print trellis.k
8282
1

commpy/examples/conv_encode_decode.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
# =============================================================================
1212

1313
# G(D) corresponding to the convolutional encoder
14-
generator_matrix = np.array([[05, 07]])
15-
#generator_matrix = np.array([[03, 00, 02], [07, 04, 06]])
14+
generator_matrix = np.array([[0o5, 0o7]])
15+
#generator_matrix = np.array([[0o3, 0o0, 0o2], [0o7, 0o4, 0o6]])
1616

1717
# Number of delay elements in the convolutional encoder
1818
M = np.array([2])
@@ -41,17 +41,17 @@
4141
#num_bit_errors = 1
4242

4343
if num_bit_errors !=0:
44-
#print num_bit_errors, "Bit Errors found!"
45-
#print message_bits
46-
#print decoded_bits[tb_depth+3:]
47-
#print decoded_bits
44+
#print(num_bit_errors, "Bit Errors found!")
45+
#print(message_bits)
46+
#print(decoded_bits[tb_depth+3:])
47+
#print(decoded_bits)
4848
break
4949
else:
50-
print "No Bit Errors :)"
51-
52-
#print "==== Message Bits ==="
53-
#print message_bits
54-
#print "==== Coded Bits ====="
55-
#print coded_bits
56-
#print "==== Decoded Bits ==="
57-
#print decoded_bits[tb_depth:]
50+
print("No Bit Errors :)")
51+
52+
#print("==== Message Bits ===")
53+
#print(message_bits)
54+
#print("==== Coded Bits =====")
55+
#print(coded_bits)
56+
#print("==== Decoded Bits ===")
57+
#print(decoded_bits[tb_depth:])

0 commit comments

Comments
 (0)