Communications Toolbox | ![]() ![]() |
Produce generator polynomials for a cyclic code
Syntax
Description
For all syntaxes, a polynomial is represented as a row containing the coefficients in order of ascending powers.
pol = cyclpoly(n,k)
returns the row vector representing one nontrivial generator polynomial for a cyclic code having codeword length n
and message length k
.
pol = cyclpoly(n,k,
searches for one or more nontrivial generator polynomials for cyclic codes having codeword length opt
)
n
and message length k
. The output pol
depends on the argument opt
as shown in the table below.
The weight of a binary polynomial is the number of nonzero terms it has. If no generator polynomial satisfies the given conditions, then the output pol
is empty and an error message is displayed.
Examples
The first command below produces representations of three generator polynomials for a [15,4] cyclic code. The second command shows that 1 + x + x2 + x3+ x5+ x7+ x8+ x11 is one such polynomial having the largest number of nonzero terms.
c1 = 1 1 0 0 0 1 1 0 0 0 1 1 1 0 0 1 1 0 1 0 1 1 1 1 1 1 1 1 0 1 0 1 1 0 0 1 c2 = 1 1 1 1 0 1 0 1 1 0 0 1
This command shows that no generator polynomial for a [15,4] cyclic code has exactly three nonzero terms.
Algorithm
If opt
is '
min
'
, '
max
'
, or omitted, then polynomials are constructed by converting decimal integers to base p
. Based on the decimal ordering, gfprimfd
returns the first polynomial it finds that satisfies the appropriate conditions. This algorithm is similar to the one used in gfprimfd
.
![]() | cyclgen | ddemod | ![]() |