diff options
author | Tom Rondeau <tom@trondeau.com> | 2015-06-15 14:29:11 -0400 |
---|---|---|
committer | Tom Rondeau <tom@trondeau.com> | 2015-10-15 10:40:24 -0400 |
commit | 4bafcfc25404be0e1f2ed5cb4836494f6ccae4b5 (patch) | |
tree | d31eb53671b65af4a8598bd3fa6d4d1f527b5c43 /gr-fec/python/fec/LDPC/Generate_LDPC_matrix.py | |
parent | 7c0ff8a410528ca3eed769c595d91e2b89f30a0f (diff) |
fec: LDPC: massive code clean up and change.
Squashed a number of commits to get to this point. Separated the H and
G matrix concepts, make two different encoders and two different
decoders. Removed gsl from API; now only an internal dep that we can
replace more easily later.
Working examples.
Diffstat (limited to 'gr-fec/python/fec/LDPC/Generate_LDPC_matrix.py')
-rw-r--r-- | gr-fec/python/fec/LDPC/Generate_LDPC_matrix.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gr-fec/python/fec/LDPC/Generate_LDPC_matrix.py b/gr-fec/python/fec/LDPC/Generate_LDPC_matrix.py index a984b3b796..696d957604 100644 --- a/gr-fec/python/fec/LDPC/Generate_LDPC_matrix.py +++ b/gr-fec/python/fec/LDPC/Generate_LDPC_matrix.py @@ -26,7 +26,7 @@ from Generate_LDPC_matrix_functions import * # use with the LDPC Richardson Urbanke encoder. A significant amount # of matrix manipulation is required, so this process should be done # before using the encoder at run-time. This process can take quite -# a while, with more time required for larger matrices. +# a while, with more time required for larger matrices. # Not all attempts to create a parity check matrix will be # successful. The script will terminate and output error messages @@ -35,8 +35,8 @@ from Generate_LDPC_matrix_functions import * # Because random number generation and # shuffling methods are used, it is not possible to predict what -# starting conditions will result in success. It requires a bit of -# trial and error. +# starting conditions will result in success. It requires a bit of +# trial and error. # ----------------------------------------------------------------- # @@ -49,9 +49,9 @@ q = 5 # row weight 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 +# matrix to start. The matrices generated by the # regular_LDPC_code_contructor function will never be full rank. So, -# use the get_full_rank_H_matrix function. +# use the get_full_rank_H_matrix function. newH = get_full_rank_H_matrix(parity_check_matrix.H) # At this point, the matrix is no longer regular. (The row/column @@ -62,7 +62,7 @@ newH = get_full_rank_H_matrix(parity_check_matrix.H) # can take a while... [bestH,g] = get_best_matrix(newH,100) -# Print out some of the resulting properties. +# Print out some of the resulting properties. n = bestH.shape[1] k = n - bestH.shape[0] print "Parity check matrix properties:" @@ -73,7 +73,7 @@ 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: +# Save the matrix to an alist file for future use: alist_filename = "n_%04i_k_%04i_gap_%02i.alist" % (n,k,g) parity_check_matrix.write_alist_file(alist_filename,bestH) -print '\nMatrix saved to alist file:', alist_filename, "\n"
\ No newline at end of file +print '\nMatrix saved to alist file:', alist_filename, "\n" |