Galois field array
Specify a matrix of 0
s and 1
s.
x = [0 1 1; 0 1 0; 1 1 1];
Create a GF(2) array from x
.
x_gf = gf(x)
x_gf = GF(2) array. Array elements = 0 1 1 0 1 0 1 1 1
Set the order of the Galois field to 16, where the order equals . Specify a matrix of elements that range from 0 to . Create the Galois field array.
m = 4; x = [3 2 9; 1 2 1]; y = gf(x,m)
y = GF(2^4) array. Primitive polynomial = D^4+D+1 (19 decimal) Array elements = 3 2 9 1 2 1
Create a sequence of integers. Create a Galois field array in GF().
x = [17 8 11 27]; y = gf(x,5)
y = GF(2^5) array. Primitive polynomial = D^5+D^2+1 (37 decimal) Array elements = 17 8 11 27
Determine all possible primitive polynomials for GF().
pp = primpoly(5,'all')
Primitive polynomial(s) = D^5+D^2+1 D^5+D^3+1 D^5+D^3+D^2+D^1+1 D^5+D^4+D^2+D^1+1 D^5+D^4+D^3+D^1+1 D^5+D^4+D^3+D^2+1
pp = 6×1
37
41
47
55
59
61
Create a Galois field array using the primitive polynomial that has a decimal equivalent of 59.
z = gf(x,5,'D5+D4+D3+D+1')
z = GF(2^5) array. Primitive polynomial = D^5+D^4+D^3+D+1 (59 decimal) Array elements = 17 8 11 27
x
— Input matrixInput matrix, specified as a matrix with values greater than or equal to zero. The function uses this value to create a GF array.
Data Types: double
m
— Order of primitive polynomialOrder of primitive polynomial, specified as a positive integer from 1 through 16. The function uses this value to calculate the distinct number of elements in the GF.
Data Types: double
prim_poly
— Primitive polynomialm
) (default) | binary row vector | character vector | string scalar | positive integerPrimitive polynomial, specified as one of these options:
Binary row vector — This vector specifies coefficients of
prim_poly
in the order of ascending powers.
Character vector or a string scalar — This value defines
prim_poly
in a textual representation. For more details,
refer to polynomial character vector.
Positive integer — This value defines prim_poly
in the
range [(2m + 1), (2m+1 –
1)].
If prim_poly
is not specified, see Default Primitive Polynomials for the list of default primitive
polynomial used for each Galois field array
GF(2m
).
Data Types: double
| char
| string
x_gf
— Galois field arrayGalois field array, returned as a variable that MATLAB recognizes as a Galois field
array, rather than an array of integers. As a result, when you manipulate the variable,
MATLAB works within the Galois field the variable specifies. For example, if you apply
the log
function to a Galois array, MATLAB computes the
logarithm in the Galois field for that Galois array and not in the field of real or
complex numbers.
This table lists the default primitive polynomial used for each Galois field
array GF(2m
). To use a different primitive
polynomial, specify prim_poly
as an input argument.
prim_poly
must be in the range
[(2m
+ 1),
(2m
+1 – 1)] and must indicate an
irreducible polynomial. For more information, see Primitive Polynomials and Element Representations.
Value of m | Default Primitive Polynomial | Integer Representation |
---|---|---|
1 | D + 1 | 3 |
2 | D2 + D + 1 | 7 |
3 | D3 + D + 1 | 11 |
4 | D4 + D + 1 | 19 |
5 | D5 + D2 + 1 | 37 |
6 | D6 + D + 1 | 67 |
7 | D7 + D3 + 1 | 137 |
8 | D8 + D4 + D3 + D2 + 1 | 285 |
9 | D9 + D4 + 1 | 529 |
10 | D10 + D3 + 1 | 1033 |
11 | D11 + D2 + 1 | 2053 |
12 | D12 + D6 + D4 + D + 1 | 4179 |
13 | D13 + D4 + D3 + D + 1 | 8219 |
14 | D14 + D10 + D6 + D + 1 | 17475 |
15 | D15 + D + 1 | 32771 |
16 | D16 + D12 + D3 + D + 1 | 69643 |
This table lists the operations supported for Galois field arrays.
Operation | Description |
---|---|
+ - | Addition and subtraction of Galois arrays |
* / \ | Matrix multiplication and division of Galois arrays |
.* ./ .\ | Elementwise multiplication and division of Galois arrays |
^ | Matrix exponentiation of Galois array |
.^ | Elementwise exponentiation of Galois array |
' .' | Transpose of Galois array |
==, ~= | Relational operators for Galois arrays |
all | True if all elements of a Galois vector are nonzero |
any | True if any element of a Galois vector is nonzero |
conv | Convolution of Galois vectors |
convmtx | Convolution matrix of Galois field vector |
deconv | Deconvolution and polynomial division |
det | Determinant of square Galois matrix |
dftmtx | Discrete Fourier transform matrix in a Galois field |
diag | Diagonal Galois matrices and diagonals of a Galois matrix |
fft | Discrete Fourier transform |
filter (gf) | One-dimensional digital filter over a Galois field |
ifft | Inverse discrete Fourier transform |
inv | Inverse of Galois matrix |
length | Length of Galois vector |
log | Logarithm in a Galois field |
lu | Lower-Upper triangular factorization of Galois array |
minpol | Find the minimal polynomial for a Galois element |
mldivide | Matrix left division \ of Galois arrays |
polyval | Evaluate polynomial in Galois field |
rank | Rank of a Galois array |
reshape | Reshape Galois array |
roots | Find polynomial roots across a Galois field |
size | Size of Galois array |
tril | Extract lower triangular part of Galois array |
triu | Extract upper triangular part of Galois array |
You have a modified version of this example. Do you want to open this example with your edits?