Communications Toolbox | ![]() ![]() |
Converting and Simplifying Element Formats
This section describes how to convert between the exponential and polynomial formats for Galois field elements, as well as how to simplify a given representation.
Converting to Simplest Polynomial Format
The gftuple
function produces the simplest polynomial representation of an element of GF(pm), given either an exponential representation or a polynomial representation of that element. This can be useful for generating the list of elements of GF(pm) that other functions require.
Using gftuple
requires three arguments: one representing an element of GF(pm), one indicating the primitive polynomial that MATLAB should use when computing the output, and the prime p. The table below indicates how gftuple
behaves when given the first two arguments in various formats.
The four examples that appear in the table above all produce the same vector tp = [2, 1]
, but their different inputs to gftuple
correspond to the lines of the table. Each example expresses the fact that
where A is a root of the (default) primitive polynomial 2 + x+ x2 for GF(32).
Example
This example shows how gfconv
and gftuple
combine to multiply two polynomial-format elements of GF(34). Initially, gfconv
multiplies the two polynomials, treating the primitive element as if it were a variable. This produces a high-order polynomial, which gftuple
simplifies using the polynomial equation that the primitive element satisfies. The final result is the simplest polynomial format of the product.
p = 3; m = 4; a = [1 2 0 1]; b = [2 2 1 2]; notsimple = gfconv(a,b,p) % a times b, using high powers of alpha notsimple = 2 0 2 0 0 1 2 simple = gftuple(notsimple,m,p) %Highest exponent of alpha is m-1 simple = 2 1 0 1
![]() | Default Primitive Polynomials | Example: Generating a List of Galois Field Elements | ![]() |