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

Deinterleaved codewords incorrect order #42

Open
tweej opened this issue Mar 24, 2021 · 0 comments
Open

Deinterleaved codewords incorrect order #42

tweej opened this issue Mar 24, 2021 · 0 comments

Comments

@tweej
Copy link

tweej commented Mar 24, 2021

Hi,

Thank you for your 2016 paper and presentation.

I am trying to experiment with the {de}interleaver from your repository, and have simply copied the relevant functions into a single file. When I try to hamming encode, interleave, deinterleave, and hamming decode a payload, the order of the deinterleaved codewords is incorrect. (Using SF8, any coding rate)

For example, {0xA, 0xB, 0xC, 0xD, 0xE, 0xF, 0x1, 0x5} becomes {0x1, 0xB, 0xE, 0x5, 0xC, 0xF, 0xA, 0xD}. The correct bytes are all there, but they are in the wrong order.

If I change the deinterleave function for the SF8 case so that the order elements are inserted into codewords matches the SF8 case in interleave (0,7,2,1,4,3,6,5) I get the output I expect.

if (ppm == 8)
{
    codewords.push_back(block[0]);
    codewords.push_back(block[7]);
    codewords.push_back(block[2]);
    codewords.push_back(block[1]);
    codewords.push_back(block[4]);
    codewords.push_back(block[3]);
    codewords.push_back(block[6]);
    codewords.push_back(block[5]);
}

I think this is a bug, but I'm not sure whether interleave is incorrect, deinterleave is incorrect, or maybe even both.

The code: gr-lora.cc.txt

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

1 participant