-
Notifications
You must be signed in to change notification settings - Fork 184
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
LDPC soft decoding not working #106
Comments
What is your expected result? I have just executed the code snippet provided and I get the following results. Soft error = 0.8970588235294118
Hard error = 11.470588235294118 There are fewer errors with Soft decoding than with Hard decoding so it doesn't seem to be a ruin. |
Hi. Apparently, there is something wrong with your execution. The error should be sub-one as it is the mean of the difference between two bitstreams. I executed the code on two different machines (windows and Linux) with Spyder3 and Python3 and the result is 0 for hard decision and ~0.85 for soft decision. |
Are you sure that you run the exact same code? For instance, you use |
Yes. I just tried a new machine with a fresh installation. As for the indices of the matrices, I noticed that the output is different in the two cases. In the hard case, the first array has only zeros, and the second one has ones and zeros, which happen to be exactly what I sent. in the soft case, the first array has ones and zeros (as expected) and the second array has the output LLRs. Did my example execute on your system? |
I have try the codes, got the results: |
Another change: |
You are right! Thanks for pointing this out! This may explain why the LDPC test is passing while the example from this issue shows a bug. The minus is a quick and efficient workaround but a real med-term solution would be to unify all the LLR definitions across CommPy. I may do it someday if I find some free time and if someone wants to help through a PR, don't hesitate!
What is this other test? And you are welcome. It is a real pleasure to see that our work on CommPy is useful to some of you 😄! |
Hi guys, I also have noticed a few issues with the LDPC encoder/decoder functionalities. However, I suspect the problem is not in the decoder function but in the encoder function instead. The definition of the LLR is indeed swapped, but this is not a critical issue since just a sign change in the input LLRs would fix it. In my case, I did a few tests with DVB.S2 LDPC codes (same ones implemented in MATLAB) + QAM modulation and both the encoder and the soft decoder are working perfectly for the AWGN channel. The problem appears when I try to use other codes with different parity-check matrix structures. The function
This requirement is probably due to some optimization to reduce the complexity of the encoder. I have tried to use LDPC codes from the AR4JA family and I also got wrong decoding results with CommPy functions, despite the fact that they worked fine in MATLAB. As far as I could verify, parity-check matrices of AR4JA codes are not triangular, whereas the DVB.S2 are triangular. Thus, I suspect the problem lies in the encoder. |
Hi, I have written the encoder and I can confirm that it only functions for a specific type of parity-check matrices. This is a limitation to simplify the algorithm. I never had the time to implement a more universal version. The name of the function and the comment clearly mention this limit to avoid any confusion. Could a small test on the input with an error raising in case of invalid matrix be useful? Furthermore, if any of you wish to write a general encoder, I will be glad to help, review it and accept the PR. |
I'm using commpy to simulate an OFDM transmission/reception. I wanted to add a channel coding block. I used LDPC with a matrix from "David MacKay's Gallager Code resources", in particular, 408.33.844 with N = 408, K=204 (can be found here: http://www.inference.org.uk/mackay/codes/EN/C/408.33.844).
The message is modulated/demodulated in QAM using the same library. The hard decision decoding is working fine. yet when I switch to the soft decisions, it goes into ruins. A sample code is below. Is there something I'm doing wrong? or is it a code problem/limitation? I can't find anything in the documentation that can help.
The text was updated successfully, but these errors were encountered: