


% -*- texinfo -*-
% @deftypefn {Function File} {} egolaydec (@var{R})
%
% Given @var{R}, the received Extended Golay code, this function tries to
% decode @var{R} using the Extended Golay code parity check matrix.
% Extended Golay code (24,12) which can correct upto 3 errors.
%
% The received code @var{R}, needs to be of length Nx24, for encoding. We can
% decode several codes at once, if they are stacked as a matrix of 24columns,
% each code in a separate row.
%
% The generator G used in here is same as obtained from the
% function egolaygen.
%
% The function returns the error-corrected code word from the received
% word. If decoding failed, the second return value is 1, otherwise it is 0.
%
% Extended Golay code (24,12) which can correct upto 3
% errors. Decoding algorithm follows from Lin & Costello.
%
% Ref: Lin & Costello, pg 128, Ch4, 'Error Control Coding', 2nd ed, Pearson.
%
% @example
% @group
% M=[rand(10,12)>0.5];
% C1=egolayenc(M);
% C1(:,1)=mod(C1(:,1)+1,2)
% C2=egolaydec(C1)
% @end group
% @end example
%
% @end deftypefn
% @seealso{egolaygen,egolayenc}