Communications Toolbox    
gfweight

Calculate the minimum distance of a linear block code

Syntax

Description

The minimum distance, or minimum weight, of a linear block code is defined as the smallest positive number of nonzero entries in any n-tuple that is a codeword.

wt = gfweight(genmat) returns the minimum distance of the linear block code whose generator matrix is genmat.

wt = gfweight(genmat,'gen') returns the minimum distance of the linear block code whose generator matrix is genmat.

wt = gfweight(parmat,'par') returns the minimum distance of the linear block code whose parity-check matrix is parmat.

wt = gfweight(genpoly,n) returns the minimum distance of the cyclic code whose codeword length is n and whose generator polynomial is represented by genpoly. genpoly is a row vector that gives the coefficients of the generator polynomial in order of ascending powers.

Examples

The commands below illustrate three different ways to compute the minimum distance of a (7,4) cyclic code.

See Also
hammgen, cyclpoly, bchpoly


  gftuple hammgen