Communications Toolbox | ![]() ![]() |
Find primitive polynomials for a Galois field
Syntax
pol = gfprimfd(m); pol = gfprimfd(m,opt
); pol = gfprimfd(m,opt
,p);
Description
m
= 1, then pol
= [1 1].pol = gfprimfd(m)
returns the row vector representing one primitive polynomial for GF(2m
). m
is a positive integer.
pol = gfprimfd(m,
searches for one or more primitive polynomials for GF(2opt
)
m
), where m
is a positive integer. If m
> 1, then the output pol
depends on the argument opt
as shown in the table below.
pol = gfprimfd(m,
is the same as opt
,p)
pol = gfprimfd(m,
opt
)
except that 2 is replaced by a prime number p
.
Examples
The code below seeks primitive polynomials for GF(32) having various other properties. Notice that fourterms
is empty because no primitive polynomial for GF(32) has exactly four nonzero terms. Also notice that manyterms
represents a single polynomial having five terms, while fiveterms
represents all of the five-term primitive polynomials for GF(32).
p = 2; m = 5; % Work in GF(32). manyterms = gfprimfd(5,'max') fiveterms = gfprimfd(5,5) fourterms = gfprimfd(5,4)
manyterms = 1 1 1 1 0 1 fiveterms = 1 1 1 1 0 1 1 1 1 0 1 1 1 1 0 1 1 1 1 0 1 1 1 1 No primitive polynomial satisfies the given constraints. fourterms = []
Algorithm
gfprimfd
tests for primitivity using gfprimck
. If opt
is '
min
'
, '
max
'
, or omitted, then polynomials are constructed by converting decimal integers to base p
. Based on the decimal ordering, gfprimfd
returns the first polynomial it finds that satisfies the appropriate conditions.
See Also
gfprimck
, gfprimdf
, gftuple
, gfminpol
![]() | gfprimdf | gfrank | ![]() |