summaryrefslogtreecommitdiff
path: root/gr-fec/python/fec/LDPC/Generate_LDPC_matrix.py
diff options
context:
space:
mode:
authorMark Bauer <markb5@illinois.edu>2021-06-09 15:52:54 -0400
committermormj <34754695+mormj@users.noreply.github.com>2021-06-16 06:38:49 -0400
commitc2961061793b538a8a87133755acead8088ae2ab (patch)
tree45a70498042ba308a50697c766e636d33ae24277 /gr-fec/python/fec/LDPC/Generate_LDPC_matrix.py
parentcdf17740c6b9606e41acb5d5a9a95b2ee36931b2 (diff)
applied formatter to code
Signed-off-by: Mark Bauer <markb5@illinois.edu>
Diffstat (limited to 'gr-fec/python/fec/LDPC/Generate_LDPC_matrix.py')
-rw-r--r--gr-fec/python/fec/LDPC/Generate_LDPC_matrix.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/gr-fec/python/fec/LDPC/Generate_LDPC_matrix.py b/gr-fec/python/fec/LDPC/Generate_LDPC_matrix.py
index 53e9fa6b29..4e0c622e15 100644
--- a/gr-fec/python/fec/LDPC/Generate_LDPC_matrix.py
+++ b/gr-fec/python/fec/LDPC/Generate_LDPC_matrix.py
@@ -37,11 +37,11 @@ from .Generate_LDPC_matrix_functions import (
# First, generate a regular LDPC parity check matrix. Specify
# the properties desired. For example:
-n = 200 # number of columns, corresponds to codeword length
-p = 3 # column weight
-q = 5 # row weight
+n = 200 # number of columns, corresponds to codeword length
+p = 3 # column weight
+q = 5 # row weight
-parity_check_matrix = LDPC_matrix(n_p_q = [n,p,q])
+parity_check_matrix = LDPC_matrix(n_p_q = [n, p, q])
# Richardson and Urbanke's preprocessing method requires a full rank
# matrix to start. The matrices generated by the
@@ -55,7 +55,7 @@ newH = get_full_rank_H_matrix(parity_check_matrix.H)
# Next, some preprocessing steps need to be performed as described
# Richardson and Urbanke in Modern Coding Theory, Appendix A. This
# can take a while...
-[bestH,g] = get_best_matrix(newH,100)
+[bestH, g] = get_best_matrix(newH, 100)
# Print(out some of the resulting properties.)
n = bestH.shape[1]
@@ -63,12 +63,12 @@ k = n - bestH.shape[0]
print("Parity check matrix properties:")
print("\tSize :", bestH.shape)
print("\tRank :", linalg.matrix_rank(bestH))
-print("\tRate : %.3f" % ((k*1.0) / n))
+print("\tRate : %.3f" % ((k * 1.0) / n))
print("\tn :", n, " (codeword length)")
print("\tk :", k, " (info word length)")
print("\tgap : %i" % g)
# Save the matrix to an alist file for future use:
-alist_filename = "n_%04i_k_%04i_gap_%02i.alist" % (n,k,g)
-write_alist_file(alist_filename,bestH)
-print('\nMatrix saved to alist file:', alist_filename, "\n")
+alist_filename = "n_%04i_k_%04i_gap_%02i.alist" % (n, k, g)
+write_alist_file(alist_filename, bestH)
+print("\nMatrix saved to alist file:", alist_filename, "\n")