| Communications Toolbox | ![]() |
Generate a file to accelerate Galois field computations
Syntax
Description
gftable(m,prim_poly)
generates a file that can help accelerate computations in the field GF(2^m) as described by the nondefault primitive polynomial prim_poly. The integer m is between 1 and 16. The integer prim_poly represents a primitive polynomial for GF(2^m) using the format described in Specifying the Primitive Polynomial. The function places the file, called userGftable.mat, in your current working directory. If necessary, the function overwrites any writable existing version of the file.
Note
If prim_poly is the default primitive polynomial for GF(2^m) listed in the table on the gf reference page, then this function has no effect. A MAT-file in your MATLAB installation already includes information that facilitates computations with respect to the default primitive polynomial.
|
Examples
In the example below, you would expect t3 to be similar to t1 and significantly smaller than t2, assuming that you do not already have a userGftable.mat file that includes the (m, prim_poly) pair (8, 501).
% Sample code to check how much gftable improves speed. tic; a = gf(repmat([0:2^8-1],1000,1),8); b = a.^100; t1 = toc; tic; a = gf(repmat([0:2^8-1],1000,1),8,501); b = a.^100; t2 = toc; gftable(8,501); % Include this primitive polynomial in the file. tic; a = gf(repmat([0:2^8-1],1000,1),8,501); b = a.^100; t3 = toc;
See Also
gf, Speed and Nondefault Primitive Polynomials
| gfsub | gftrunc | ![]() |