You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Reed-Solomon code RSC(n,k) is supposed to correct at most n - k erasures, while the following snippet shows that this error-erasure decoder does not work as expected.
F=GF(59)
n, k=40, 12C=codes.GeneralizedReedSolomonCode(F.list()[:n], k)
D=codes.decoders.GRSErrorErasureDecoder(C)
erasure_num=n-k# work as expected if changed to values less than n - kmessage=vector(F, list(range(1, k+1)))
codeword=C.encode(message)
foriinrange(erasure_num):
codeword[i] =F.from_integer(1)
erasure=vector(GF(2), [1] *erasure_num+ [0] * (n-erasure_num))
print(D.decode_to_message((codeword, erasure)))
# prints (1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) instead of (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
Expected Behavior
The decoded message should be (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
Actual Behavior
It prints (1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) instead
Additional Information
I'm not very familiar with coding theory, but it seems that when there are n-k erasures and no errors, the decoding process is essentially solving a linear equation, and the following snippet works for my case.
Steps To Reproduce
A Reed-Solomon code RSC(n,k) is supposed to correct at most n - k erasures, while the following snippet shows that this error-erasure decoder does not work as expected.
Expected Behavior
The decoded message should be
(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
Actual Behavior
It prints
(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
insteadAdditional Information
I'm not very familiar with coding theory, but it seems that when there are n-k erasures and no errors, the decoding process is essentially solving a linear equation, and the following snippet works for my case.
Environment
Checklist
The text was updated successfully, but these errors were encountered: