Produce generator polynomials for binary cyclic code
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 = 
N — Codeword length
Codeword length, specified as a positive integer.
K — Message length
Message length, specified as a positive integer.
opt — Weight option
'min' (default) |
'all' | positive integer
Weight option, specified as:
'min'— one generator polynomial with the smallest possible weight
'max'— one generator polynomial with the greatest possible weight
'all'— all generator polynomials
Positive Integer — all generator polynomials with this weight
pol — Generator polynomial coefficients
row vector | matrix
Generator polynomial coefficients, returned as a row vector or matrix containing binary values that indicate the coefficients of generator polynomials in order of ascending powers. When the output is a matrix, each row represents an individual polynomial.
Generator polynomials are parameters that are required in order to
K] cyclic block codes. Cyclic codes
have algebraic properties that allow a polynomial to determine the coding process
completely. The generator polynomial is a degree-(
K) divisor of the polynomial
N – 1. For more
information, see Configure Parameters for Linear Block Codes.
Generator polynomials are found by looping through degree-(
K) polynomials and finding those that are divisors of the polynomial
N – 1. If
opt is omitted,
cyclpoly returns the first
polynomial it finds that satisfies this condition. If
the generator polynomial with either the smallest or greatest possible weight respectively. If
all the polynomials it finds that satisfies this condition in a matrix of binary row vectors,
which each row representing an individual polynomial.
Introduced before R2006a