Produce generator polynomials for cyclic code
pol = cyclpoly(n,k)
pol = cyclpoly(n,k,
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
pol = cyclpoly(n,k, searches
for one or more nontrivial generator polynomials for cyclic codes
having codeword length
n and message length
pol depends on the argument
shown in the table below.
|opt||Significance of pol||Format of pol|
|One generator polynomial having the smallest possible weight||Row vector representing the polynomial|
|One generator polynomial having the greatest possible weight||Row vector representing the polynomial|
|All generator polynomials||Matrix, each row of which represents one such polynomial|
|a positive integer, L||All generator polynomials having weight L||Matrix, each row of which represents one such polynomial|
The weight of a binary polynomial is the number of nonzero terms
it has. If no generator polynomial satisfies the given conditions,
pol is empty and a warning message is
Cyclic Code Generator Polynomials
Create [15,4] cyclic code generator polynomials.
Use the input
'all' to show all possible generator polynomials for a [15,4] cyclic code. Use the input
'max' to show that is one such polynomial that has the largest number of nonzero terms.
c1 = cyclpoly(15,4,'all')
c1 = 3×12 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 = cyclpoly(15,4,'max')
c2 = 1×12 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.
c3 = cyclpoly(15,4,3)
Warning: No cyclic generator polynomial satisfies the given constraints.
c3 = 
omitted, polynomials are constructed by converting decimal integers to base
p. Based on the decimal ordering,
the first polynomial it finds that satisfies the appropriate conditions. This algorithm is
similar to the one used in
Introduced before R2006a