hichamjanati / pyldpc

Creation of LDPC codes & simulation of coding and decoding binary data. Applications to sound and image files.
BSD 3-Clause "New" or "Revised" License
121 stars 34 forks source link

what is the mean of function parity_check_matrix? #4

Closed Porlockzzz closed 4 years ago

Porlockzzz commented 4 years ago

Did the funcition builds a regular Parity-Check Matrix H? But why the Matrix i get is not a Parity-Check Matrix,such as [1 0 1 0 0 0 0 1 1 1 0 0 0 0 0] [0 0 0 0 0 0 0 0 0 0 1 0 0 0 0] [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] [0 1 0 0 0 1 0 0 1 0 0 1 0 0 1] [0 0 0 0 0 0 0 0 0 1 0 0 0 0 0] [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] [0 0 0 0 0 1 1 0 0 1 0 0 0 1 1] [0 0 0 0 0 0 0 0 1 0 0 0 0 0 0] [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] [0 1 0 0 0 1 1 0 1 0 0 0 1 0 0] [0 0 0 0 0 0 0 0 0 0 0 0 0 1 0] [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]

Porlockzzz commented 4 years ago

Can you give me some reference materials if you are busy?thank you

hichamjanati commented 4 years ago

How can I help you if you don't provide me with the code you ran to get this output ... Please tell me exactly what you did to get this matrix and with which version of pyldpc so that I can reproduce this behavior.

Porlockzzz commented 4 years ago

Sorry,this my code

import numpy as np
from pyldpc import make_ldpc, encode, decode, get_message
n = 10
d_v = 4
d_c = 5
H, G = make_ldpc(n, d_v, d_c, systematic=True, sparse=True)
print(H)

And output is [[0 0 0 1 1 1 1 1 0 0] [0 0 0 0 0 0 0 0 1 0] [0 0 1 1 1 1 0 0 0 1] [0 0 0 0 0 0 0 0 1 0] [1 0 1 1 0 0 1 0 0 1] [0 0 0 0 0 0 0 1 0 0] [0 1 1 1 0 1 0 0 1 0] [0 0 0 0 0 0 1 0 0 0]]

so maybe is not a Parity-Check Matrix?

hichamjanati commented 4 years ago

Indeed this is weird, I'll dig in and will get back to you on that.

hichamjanati commented 4 years ago

It's fixed. Please clone the repo and install it locally with python setup.py develop for the latest version. Thanks for pointing this out.

hichamjanati commented 4 years ago

About the reference, if you are interested in LDPC codes in general, I recommend you to check https://www.researchgate.net/publication/283225722_Introducing_Low_Density_Parity_Check_LDPC_Codes

Porlockzzz commented 4 years ago

Thanks for the reference,You did a great fixed:)