diff main/comm/inst/egolaydec.m @ 10707:2d15bf604652 octave-forge

egolaydec/egolayenc: use egolaygen and avoid repeating code
author carandraug
date Tue, 21 Aug 2012 01:12:21 +0000
parents 8f1434f40544
children
line wrap: on
line diff
--- a/main/comm/inst/egolaydec.m	Tue Aug 21 00:59:49 2012 +0000
+++ b/main/comm/inst/egolaydec.m	Tue Aug 21 01:12:21 2012 +0000
@@ -56,25 +56,10 @@
     error ("extended golay code is (24,12), use rx codeword of 24 bit column size");
   endif
 
-  I = eye (12);
-                                %P is 12x12 matrix
-  P = [1 0 0 0 1 1 1 0 1 1 0 1;
-       0 0 0 1 1 1 0 1 1 0 1 1;
-       0 0 1 1 1 0 1 1 0 1 0 1;
-       0 1 1 1 0 1 1 0 1 0 0 1;
-       1 1 1 0 1 1 0 1 0 0 0 1;
-       1 1 0 1 1 0 1 0 0 0 1 1;
-       1 0 1 1 0 1 0 0 0 1 1 1;
-       0 1 1 0 1 0 0 0 1 1 1 1;
-       1 1 0 1 0 0 0 1 1 1 0 1;
-       1 0 1 0 0 0 1 1 1 0 1 1;
-       0 1 0 0 0 1 1 1 0 1 1 1;
-       1 1 1 1 1 1 1 1 1 1 1 0;];
-
-  H = [I; P]; %partiy check matrix transpose.
-
   dec_error = [];
-  C         = zeros (size (R));
+  [~, P] = egolaygen ();
+  H      = [eye(12); P]; # parity check matrix transpose
+  C      = zeros (size (R));
 
   for rspn = 1:rows (R)
     RR   = R(rspn,:);