# reed solomon encoding.

Started by November 16, 2005
```I'm having a little trouble understanding reed solomon encoding. I'm
currently creating a datamatrix encoder which uses reed solomon to
generate error correction code words. As an example I'm basically trying
to generate 5 check characters  for the numbers: 142 164 186.

The polynomial divisor for generating 5 check characters is:

g(x) = x^5 + 62x^4 + 111x^3 +144x^2 + 68x + 23

however I'm not quite following how I use this on my 3 numbers to generate
those check characters. The 5 check characters that should be generated are
114 25 5 88 102. Could anyone possibly explain to me how this works?

Kind regards, Deon

```
```"decipher" <dxb04u@cs.nott.ac.uk> wrote in message
news:k9OdnY0LHo86o-benZ2dnUVZ_sednZ2d@giganews.com...
> I'm having a little trouble understanding reed solomon encoding.
...
> As an example I'm basically trying
> to generate 5 check characters  for the numbers: 142 164 186.
>
> The polynomial divisor for generating 5 check characters is:
>
> g(x) = x^5 + 62x^4 + 111x^3 +144x^2 + 68x + 23
>
> however I'm not quite following how I use this on my 3 numbers to generate
> those check characters. The 5 check characters that should be generated
> are
> 114 25 5 88 102. Could anyone possibly explain to me how this works?

Assuming that your information polynomial is u(x) = 142x^2 + 164x + 186,
multiply u(x) by x^5 and then divide the result by g(x) to get a quotient
q(x)
and a remainder r(x) = r4 x^4 + r3 x^3 + r2 x^2 + r1 x + r0o f degree 4
or less.  Your  codeword then is
x^5 u(x) - r(x) = 142x^7 + 164x^6 + 186x^5 - r4 x^4 - r3x^3 - r2x^2 - r1x -
r0.
Since x^5 u(x) = q(x)g(x) + r(x), we see that x^5 u(x) - r(x) = q(x)g(x) is
a multiple of g(x).

Note:  if you don't get the same answer 114 25 5 88 102, it may be
that u(x) should have been 186x^2 + 164x + 142

```
```thanks very much for the quick reply. Ok I think i kind of follow you. Is
it possible to work these 5 values out by hand as thats what I'm about to
try?? ... :)
```
```decipher wrote:
> thanks very much for the quick reply. Ok I think i kind of follow you. Is
> it possible to work these 5 values out by hand as thats what I'm about to
> try?? ... :)

The worked examples in this might help:

http://www.bbc.co.uk/rd/pubs/whp/whp031.shtml
```