[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 06/17: gr-fec: LDPC python - adding a handy
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 06/17: gr-fec: LDPC python - adding a handy function |
Date: |
Thu, 14 Apr 2016 20:43:03 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch maint
in repository gnuradio.
commit 17c9c6a681b95667cdcf7a85f86cbc634d0d6913
Author: tracierenea <address@hidden>
Date: Tue Apr 5 18:16:46 2016 -0500
gr-fec: LDPC python - adding a handy function
---
.../fec/LDPC/Generate_LDPC_matrix_functions.py | 33 ++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/gr-fec/python/fec/LDPC/Generate_LDPC_matrix_functions.py
b/gr-fec/python/fec/LDPC/Generate_LDPC_matrix_functions.py
index 344e5fd..6c55d0b 100644
--- a/gr-fec/python/fec/LDPC/Generate_LDPC_matrix_functions.py
+++ b/gr-fec/python/fec/LDPC/Generate_LDPC_matrix_functions.py
@@ -685,3 +685,36 @@ def getSystematicGmatrix(GenMatrix):
# the rows below i are the dependent rows, which we discard
G = tempArray[0:i,:]
return G
+
+def getSystematicGmatrixFromH(H, verbose=False):
+ """
+ If given a parity check matrix H, this function returns a
+ generator matrix G in the systematic form: G = [I P]
+ where: I is an identity matrix, size k x k
+ P is the parity submatrix, size k x (n-k)
+ If the H matrix provided is not full rank, then dependent rows
+ will be deleted first.
+ """
+ if verbose:
+ print 'received H with size: ', H.shape
+
+ # First, put the H matrix into the form H = [I|m] where:
+ # I is (n-k) x (n-k) identity matrix
+ # m is (n-k) x k
+ # This part is just copying the algorithm from getSystematicGmatrix
+ tempArray = getSystematicGmatrix(H)
+
+ # Next, swap I and m columns so the matrix takes the forms [m|I].
+ n = H.shape[1]
+ k = n - H.shape[0]
+ I_temp = tempArray[:,0:(n-k)]
+ m = tempArray[:,(n-k):n]
+ newH = concatenate((m,I_temp),axis=1)
+
+ # Now the submatrix m is the transpose of the parity submatrix,
+ # i.e. H is in the form H = [P'|I]. So G is just [I|P]
+ k = m.shape[1]
+ G = concatenate((identity(k),m.T),axis=1)
+ if verbose:
+ print 'returning G with size: ', G.shape
+ return G
\ No newline at end of file
- [Commit-gnuradio] [gnuradio] branch maint updated (b7da9af -> bc60fdb), git, 2016/04/14
- [Commit-gnuradio] [gnuradio] 05/17: gr-fec: LDPC python function - making a better docstring, git, 2016/04/14
- [Commit-gnuradio] [gnuradio] 11/17: gr-fec, LDPC: correct the name of the python function called, git, 2016/04/14
- [Commit-gnuradio] [gnuradio] 08/17: gr-fec: free memory for G matrix at end of constructor, git, 2016/04/14
- [Commit-gnuradio] [gnuradio] 12/17: gr-fec, LDPC: use mult_matrices_mod2 function, git, 2016/04/14
- [Commit-gnuradio] [gnuradio] 04/17: gr-fec: LDPC python function - addressing an attribute error, git, 2016/04/14
- [Commit-gnuradio] [gnuradio] 06/17: gr-fec: LDPC python - adding a handy function,
git <=
- [Commit-gnuradio] [gnuradio] 09/17: gr-fec: free memory for info word in LDPC gen mtrx encoder, git, 2016/04/14
- [Commit-gnuradio] [gnuradio] 10/17: gr-fec: free memory used for the LDPC H matrix in the destructor, git, 2016/04/14
- [Commit-gnuradio] [gnuradio] 02/17: gr-fec: LDPC python function - addressing an "undefined" error, git, 2016/04/14
- [Commit-gnuradio] [gnuradio] 14/17: float(version) doesn't work with "1.9.0"; fixed nx version checking, git, 2016/04/14
- [Commit-gnuradio] [gnuradio] 17/17: Merge remote-tracking branch 'tracierenea/fec_ldpc_H_fix' into maint, git, 2016/04/14
- [Commit-gnuradio] [gnuradio] 01/17: gr-fec: Fix memory allocation issue during encoding., git, 2016/04/14
- [Commit-gnuradio] [gnuradio] 13/17: grc: update year in copyright, git, 2016/04/14
- [Commit-gnuradio] [gnuradio] 16/17: Merge remote-tracking branch 'mmueller/fix_networkx_version_checking' into maint, git, 2016/04/14
- [Commit-gnuradio] [gnuradio] 03/17: gr-fec: LPDC python function - addressing an "undefined" error, git, 2016/04/14
- [Commit-gnuradio] [gnuradio] 15/17: Merge remote-tracking branch 'gnuradio-wg-grc/maint_grcwg' into maint, git, 2016/04/14