Generator polynomial of Reed-Solomon code

`genpoly = rsgenpoly(n,k)`

genpoly = rsgenpoly(n,k,prim_poly)

genpoly = rsgenpoly(n,k,prim_poly,b)

[genpoly,t] = rsgenpoly(...)

`genpoly = rsgenpoly(n,k)`

returns
the narrow-sense generator polynomial of a Reed-Solomon code with
codeword length `n`

and message length `k`

.
The codeword length `n`

must have the form 2^{m}-1
for some integer m between 3 and 16.

, and `n-k`

must be an even integer. The output `genpoly`

is
a Galois row vector that represents the coefficients of the generator
polynomial in order of descending powers. The narrow-sense generator
polynomial is (X - Alpha^{1})(X - Alpha^{2})...(X - Alpha^{2t})
where:

Alpha represents a root of the default primitive polynomial for the field GF(

`n+1`

),and t represents the code's error-correction capability,

`(n-k)/2`

.

`genpoly = rsgenpoly(n,k,prim_poly)`

is
the same as the syntax above, except that `prim_poly`

specifies
the primitive polynomial for GF(`n+1`

) that has Alpha
as a root. `prim_poly`

is an integer whose binary
representation indicates the coefficients of the primitive polynomial.
To use the default primitive polynomial GF(`n+1`

),
set `prim_poly`

to `[]`

.

`genpoly = rsgenpoly(n,k,prim_poly,b)`

returns
the generator polynomial (X - Alpha^{b})(X - Alpha^{b+1})...(X - Alpha^{b+2t-1}),
where:

`b`

is an integer,Alpha is a root of

`prim_poly`

,and t is the code's error-correction capability,

`(n-k)/2`

.

`[genpoly,t] = rsgenpoly(...)`

returns `t`

,
the error-correction capability of the code.

The examples below create Galois row vectors that represent
generator polynomials for a [7,3] Reed-Solomon code. The vectors `g`

and `g2`

both
represent the narrow-sense generator polynomial, but with respect
to different primitive elements A. More specifically, `g2`

is
defined such that A is a root of the primitive polynomial D^{3} + D^{2} + 1 for GF(8), not of the default primitive polynomial D^{3} + D + 1.
The vector `g3`

represents the generator polynomial
(X - A^{3})(X - A^{4})(X - A^{5})(X - A^{6}), where
A is a root of D^{3} + D^{2} + 1
in GF(8).

g = rsgenpoly(7,3) g2 = rsgenpoly(7,3,13) % Use nondefault primitive polynomial. g3 = rsgenpoly(7,3,13,3) % Use b = 3.

The output is below.

g = GF(2^3) array. Primitive polynomial = D^3+D+1 (11 decimal) Array elements = 1 3 1 2 3 g2 = GF(2^3) array. Primitive polynomial = D^3+D^2+1 (13 decimal) Array elements = 1 4 5 1 5 g3 = GF(2^3) array. Primitive polynomial = D^3+D^2+1 (13 decimal) Array elements = 1 7 1 6 7

As another example, the command below shows that the default
narrow-sense generator polynomial for a [15,11] Reed-Solomon code
is X^{4} + (A^{3} + A^{2} + 1)X^{3} + (A^{3} + A^{2})X^{2} +
A^{3}X + (A^{2} + A + 1),
where A is a root of the default primitive polynomial for GF(16).

gp = rsgenpoly(15,11)

gp = GF(2^4) array. Primitive polynomial = D^4+D+1 (19 decimal) Array elements = 1 13 12 8 7

For additional examples, see Parameters for Reed-Solomon Codes.

`n`

and `k`

must differ by
an even integer. The maximum allowable value of `n`

is
65535.

Was this topic helpful?