0

I have a Reed-Solomon encoder/decoder. After manipulating data and evaluating the results, I have experienced the following 3 cases:

  1. The decoder decodes the message correctly and does not throw an error
  2. The decoder decodes the message to a wrong result, without complaining - effectively producing a false positive. The chance should be very low, but can happen, even if the number of manipulated data is far below the error correction ability (even after changing a single bit...)
  3. The decoder fails (throws an error), if more data is manipulated, than what is allowed by its error correction ability.

Are all 3 cases valid for a proper Reed-Solomon decoder? I am especially unsure about case 2, where the decoder would produce a wrong result (without throwing an error), even if there are much fewer errors than what is allowed by its correction abilities...?

JoeFrizz
  • 611
  • 1
  • 9
  • 18

1 Answers1

2
  1. mis-correction below error correction ability

This would indicate a bug in the code. A RS decoder should never fail if there are less than ⌊(n-k)/2⌋ errors.

  1. correction detects when there more errors then error correction ability

Even if there are more than ⌊(n-k)/2⌋ errors, there is a good chance that a RS decoder will still detect an uncorrectable error, as most error patterns would not result in a received codeword that is within ⌊(n-k)/2⌋ or fewer error symbols of a valid codeword, since a working RS decoder should only produce a valid codeword or indicate an uncorrectable error. Miscorrection of more than ⌊(n-k)/2⌋ errors involves the decoder creating an additional ⌊(n-k)/2⌋ or fewer error symbols, resulting in a valid codeword, but one that differs from the original by n-k+1 or more symbols.

Detecting an uncorrectable error can be done by regenerating syndromes for the corrected codeword, but it's usually caught sooner when solving the error locator polynomial (normally done by looping through all possible locator values), when it produces fewer locators than it should due to duplicate or missing roots.

I wrote some interactive RS demo programs in C, for both 4 bit and 8 bit fields, that include the 3 most common decoders (PGZ (matrix), BM (discrepancy), SY (extended Euclid)). Note the SY - extended Euclid decoders in my examples emulate a hardware register oriented solution, two registers, always shift left, each register holds two polynomials where the split shifts left along with the register. The right half of each register is reversed (least significant coefficient first). The wiki article example may be easier to follow.

http://rcgldr.net/misc/eccdemo4.zip

http://rcgldr.net/misc/eccdemo8.zip

rcgldr
  • 27,407
  • 3
  • 36
  • 61
  • I "hoped" that the RS decoder never does mis-correction/false positives but out of interest: if everything (including error detection capabilities) is embedded within the generated message, isn't there a slight chance to produce a wrong solution - I mean if a lot of data is corrupted... so is it impossible or just unlikely? – JoeFrizz Oct 27 '18 at 12:47
  • @JoeFrizz - Yes, there is a chance of miscorrection anytime there is more than ⌊(n-k)/2⌋ errors in a received codeword. How unlikely is somewhat affected by the range of values in a symbol. for GF(2^8), there are 256 possible values and only some combinations of error locations and values will be within ⌊(n-k)/2⌋ error symbols of a valid code word. GF(929) (929 is a prime number) or GF(2^12) would have lower chance of miscorrection. – rcgldr Oct 27 '18 at 15:33
  • @JoeFrizz - I updated my answer with two links to example interactive RS programs. Maybe you can see what is different between the decoders in these examples versus what you are testing. – rcgldr Oct 27 '18 at 21:03
  • Thank you for the examples - they provide information in great detail. – JoeFrizz Oct 28 '18 at 13:21
  • According to your statement, that the 2nd case would indicate an error, I am trying to fix my implementation... thank you very much for the help – JoeFrizz Oct 28 '18 at 13:23