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

Multiple FEC decoders interfere with each other #483

Closed
mhostetter opened this issue May 7, 2023 · 1 comment
Closed

Multiple FEC decoders interfere with each other #483

mhostetter opened this issue May 7, 2023 · 1 comment
Labels
bug Something isn't working fec Forward error correction

Comments

@mhostetter
Copy link
Owner

The JIT-compiled decoders only use the finite field arithmetic from the first code.

Reproducer

import numpy as np

import galois

print("BCH 1")
bch_1 = galois.BCH(1023, 983)
message = galois.GF2.Random(bch_1.k).view(np.ndarray)
codeword = bch_1.encode(message)
decoded, N_corrected = bch_1.decode(codeword, errors=True)
print(N_corrected)

print("BCH 2")
bch_2 = galois.BCH(2047, 1992)
message = galois.GF2.Random(bch_2.k).view(np.ndarray)
codeword = bch_2.encode(message)
decoded, N_corrected = bch_2.decode(codeword, errors=True)
print(N_corrected)

print("BCH 1")
bch_1 = galois.BCH(1023, 983)
message = galois.GF2.Random(bch_1.k).view(np.ndarray)
codeword = bch_1.encode(message)
decoded, N_corrected = bch_1.decode(codeword, errors=True)
print(N_corrected)

print("BCH 2")
bch_2 = galois.BCH(2047, 1992)
message = galois.GF2.Random(bch_2.k).view(np.ndarray)
codeword = bch_2.encode(message)
decoded, N_corrected = bch_2.decode(codeword, errors=True)
print(N_corrected)

Actual

$ python3 .\test_bch.py
BCH 1
0
BCH 2
-1
BCH 1
0
BCH 2
-1

Expected

$ python3 .\test_bch.py
BCH 1
0
BCH 2
0
BCH 1
0
BCH 2
0
@mhostetter mhostetter added fec Forward error correction bug Something isn't working labels May 7, 2023
mhostetter added a commit that referenced this issue May 8, 2023
mhostetter added a commit that referenced this issue May 8, 2023
mhostetter added a commit that referenced this issue May 9, 2023
@mhostetter
Copy link
Owner Author

Released in v0.3.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fec Forward error correction
Projects
None yet
Development

No branches or pull requests

1 participant