Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

G, H and P in Linear Block Code #3

Open
geomimo opened this issue Jul 6, 2019 · 1 comment
Open

G, H and P in Linear Block Code #3

geomimo opened this issue Jul 6, 2019 · 1 comment

Comments

@geomimo
Copy link

geomimo commented Jul 6, 2019

As I know the forms of G and H are [Ik;P] and [P^T; In-k] but you set G as a concatenation of [P;Ik] and H as [In-k;P^T]. Am I wrong??

def HtoG(H):
  
    n = np.shape(H)[1]
    k = n - np.shape(H)[0]
    P = HtoP(H)
    Ik = np.eye(k)
    G = np.concatenate((P, Ik), axis=1)
    return G.astype(int)


def GtoH(G):
    k = np.shape(G)[0]
    n = np.shape(G)[1]
    P = GtoP(G)
    PT = np.transpose(P)
    Ik = np.eye(n - k)
    H = np.concatenate((Ik, PT), axis=1)
    return H.astype(int)
@varun19299
Copy link

They're equivalent upto a column swap. GtoP seems to take that into account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants