Function File: p = bchpoly ()
Function File: p = bchpoly (n)
Function File: p = bchpoly (n, k)
Function File: p = bchpoly (prim, k)
Function File: p = bchpoly (n, k, prim)
Function File: p = bchpoly (…, probe)
Function File: [p, f] = bchpoly (…)
Function File: [p, f, c] = bchpoly (…)
Function File: [p, f, c, par] = bchpoly (…)
Function File: [p, f, c, par, t] = bchpoly (…)

Calculates the generator polynomials for a BCH coder. Called with no input arguments bchpoly returns a list of all of the valid BCH codes for the codeword length 7, 15, 31, 63, 127, 255 and 511. A three column matrix is returned with each row representing a separate valid BCH code. The first column is the codeword length, the second the message length and the third the error correction capability of the code.

Called with a single input argument, bchpoly returns the valid BCH codes for the specified codeword length n. The output format is the same as above.

When called with two or more arguments, bchpoly calculates the generator polynomial of a particular BCH code. The generator polynomial is returned in p as a vector representation of a polynomial in GF(2). The terms of the polynomial are listed least-significant term first.

The desired BCH code can be specified by its codeword length n and its message length k. Alternatively, the primitive polynomial over which to calculate the polynomial can be specified as prim. If a vector representation of the primitive polynomial is given, then prim can be specified as the first argument of two arguments, or as the third argument. However, if an integer representation of the primitive polynomial is used, then the primitive polynomial must be specified as the third argument.

When called with two or more arguments, bchpoly can also return the factors f of the generator polynomial p, the cyclotomic coset for the Galois field over which the BCH code is calculated, the parity check matrix par and the error correction capability t. It should be noted that the parity check matrix is calculated with cyclgen and limitations in this function means that the parity check matrix is only available for codeword length up to 63. For codeword length longer than this par returns an empty matrix.

With a string argument probe defined, the action of bchpoly is to calculate the error correcting capability of the BCH code defined by n, k and prim and return it in p. This is similar to a call to bchpoly with zero or one argument, except that only a single code is checked. Any string value for probe will force this action.

In general the codeword length n can be expressed as 2^m-1, where m is an integer. However, if [n,k] is a valid BCH code, then a shortened BCH code of the form [n-x,k-x] can be created with the same generator polynomial

See also: cyclpoly, encode, decode, cosets.

Package: communications