| Communications Toolbox | ![]() |
Syntax
Description
y = log(x)
computes the logarithm of each element in the Galois array x. That is, y is an integer array that solves the equation A.^y = x, where A is the primitive element used to represent elements in x. More explicitly, the base A of the logarithm is gf(2,x.m) or gf(2,x.m,x.prim_poly). All elements in x must be nonzero because the logarithm of zero is undefined.
Examples
The code below illustrates how the logarithm operation inverts exponentiation.
m = 4; x = gf([8 1 6; 3 5 7; 4 9 2],m); y = log(x); primel = gf(2,m); % Primitive element in the field z = primel .^ y; % This is now the same as x. ck = isequal(x,z) ck = 1
The code below shows that the logarithm of 1 is 0 and that the logarithm of the base (primel) is 1.
| lloyds | marcumq | ![]() |