diff options
Diffstat (limited to 'gr-fec/python/fec/LDPC/Generate_LDPC_matrix.py')
-rw-r--r-- | gr-fec/python/fec/LDPC/Generate_LDPC_matrix.py | 18 |
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") |