1 ## Copyright (C) 2007 Muthiah Annamalai <muthiah.annamalai@uta.edu>
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} {} reedmullergen (@var{R},@var{M})
19 ## Definition type construction of Reed Muller code,
20 ## of order @var{R}, length @math{2^M}. This function
21 ## returns the generator matrix for the said order RM code.
23 ## RM(r,m) codes are characterized by codewords,
24 ## @code{sum ( (m,0) + (m,1) + @dots{} + (m,r)}.
25 ## Each of the codeword is got through spanning the
26 ## space, using the finite set of m-basis codewords.
27 ## Each codeword is @math{2^M} elements long.
28 ## see: Lin & Costello, "Error Control Coding", 2nd Ed.
30 ## Faster code constructions (also easier) exist, but since
31 ## finding permutation order of the basis vectors, is important, we
32 ## stick with the standard definitions. To use decoder
33 ## function reedmullerdec, you need to use this specific
34 ## generator function.
38 ## G=reedmullergen(2,4);
43 ## @seealso{reedmullerdec,reedmullerenc}
44 function G=reedmullergen(R,M)
58 row=repmat([a,b],[1,2^(M-idx)]);
72 prod=V(p(:,1),:).*V(p(:,2),:);
74 prod=prod.*V(p(:,idx),:);