1 ## Copyright (C) 2002 David Bateman
3 ## This program is free software; you can redistribute it and/or modify it under
4 ## the terms of the GNU General Public License as published by the Free Software
5 ## Foundation; either version 3 of the License, or (at your option) any later
8 ## This program is distributed in the hope that it will be useful, but WITHOUT
9 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 ## You should have received a copy of the GNU General Public License along with
14 ## this program; if not, see <http://www.gnu.org/licenses/>.
17 ## @deftypefn {Function File} {} ifft (@var{x})
19 ## If @var{x} is a column vector, finds the IFFT over the primitive element
20 ## of the Galois Field of @var{x}. If @var{x} is in the Galois Field
21 ## GF(2^@var{m}), then @var{x} must have @code{2^@var{m} - 1} elements.
28 error ("usage: y = ifft (x)");
32 error("ifft: argument must be a galois variable");
37 error ([ "ifft: argument must be in Galois Field GF(2^m), where", ...
38 " m is not greater than 8"]);
41 alph = gf(2, x.m, x.prim_poly);
43 if ((nc == 1) && (nr == n))
44 y = dftmtx(1/alph) * x;
45 elseif ((nc == n) && (nr == 1))
46 y = (dftmtx(1/alph) * x')';
48 error ("ifft: argument must be a vector in GF(2^m) of length 2^m-1");