Documentation |
pol = cyclpoly(n,k)
pol = cyclpoly(n,k,opt)
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,opt) searches for one or more nontrivial generator polynomials for cyclic codes having codeword length n and message length k. The output pol depends on the argument opt as shown in the table below.
opt | Significance of pol | Format of pol |
---|---|---|
'min' | One generator polynomial having the smallest possible weight | Row vector representing the polynomial |
'max' | One generator polynomial having the greatest possible weight | Row vector representing the polynomial |
'all' | All generator polynomials M | 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, the output pol is empty and a warning message is displayed.
The first command below produces representations of three generator polynomials for a [15,4] cyclic code. The second command shows that 1 + x + x^{2} + x^{3}+ x^{5}+ x^{7}+ x^{8}+ x^{11 }is one such polynomial having the largest number of nonzero terms.
c1 = cyclpoly(15,4,'all') c2 = cyclpoly(15,4,'max')
The output is
c1 = Columns 1 through 10 1 1 0 0 0 1 1 0 0 0 1 0 0 1 1 0 1 0 1 1 1 1 1 1 0 1 0 1 1 0 Columns 11 through 12 1 1 1 1 0 1 c2 = Columns 1 through 10 1 1 1 1 0 1 0 1 1 0 Columns 11 through 12 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. > In cyclpoly at 131 c3 = []