Communications Toolbox    
bchpoly

Produce parameters or generator polynomial for binary BCH code

Syntax

Description

bchpoly produces a figure window containing a table that lists valid codeword and message lengths of binary BCH codes, as well as the corresponding error-correction capabilities. The codeword lengths listed are 7, 15, 31, 63, 127, 255, and 511. The codeword lengths, message length, and error-correction capabilities are denoted by N, K, and T, respectively.

params = bchpoly produces a three-column matrix containing the same information that is in the table mentioned in the syntax above. The first column of params gives the codeword length, the second column gives the message length, and the third column gives the error-correction capability.

params = bchpoly(n) produces a matrix params containing valid codeword and message lengths of binary BCH codes in its first and second columns, respectively. If n < 1024, then params has a third column that lists the corresponding error-correction capabilities. The codeword lengths listed in the first column of params are all equal to max(7,2^ceil(log2(n+1))-1). This expression gives the smallest number of the form 2m-1 that is at least as big as n, where m is an integer greater than or equal to 3.

genpoly = bchpoly(n,k) produces a generator polynomial for a binary BCH code having codeword length n and message length k. genpoly is a row vector that gives the coefficients, in order of ascending powers, of the generator polynomial. n must have the form 2m-1 for some integer m greater than or equal to 3. k must be a valid message length, as reported in the second column of the output of the command genpoly = bchpoly(n). The primitive polynomial used for the GF(2m) calculations is the default primitive polynomial, gfprimdf(m).

genpoly = bchpoly(prim_poly,k) produces a generator polynomial for a binary BCH code having codeword length n and message length k. prim_poly represents a degree-m primitive polynomial for the field GF(2m). Both prim_poly and genpoly are row vectors that represent polynomials by giving the coefficients in order of ascending powers. Given the degree m of the primitive polynomial, the message length n is 2m-1. k must be a valid message length, as reported in the second column of the output of the command genpoly = bchpoly(n).

The remaining syntaxes, of the form

return some or all of the output variables listed in the table below.

Additional Output Variables for bchpoly(...,k) 
Output Variable
Significance
Format
factors
Irreducible factors of the generator polynomial
Binary matrix, each row of which gives the coefficients of a factor polynomial in order of ascending powers
cst
Cyclotomic cosets of the field GF(2m)
Same as gfcosets(m)
h
Parity-check matrix of the code
(n-k)-by-n binary matrix
t
Error-correction capability of the code
Positive integer

Examples

The script below uses bchpoly to find out what message lengths are valid for a BCH code with codeword length 24-1. It then chooses one of the possible message lengths and uses bchpoly to find the generator polynomial and parity-check matrix for such a code.

The full output is below.

See Also
cyclpoly, encode, decode

References

Peterson, W. Wesley, and E. J. Weldon, Jr., Error-correcting Codes, 2nd ed., Cambridge, Mass., MIT Press, 1972.


  bchenco bi2de