Function File: [C, err] = egolaydec (R)

Decode Extended Golay code.

Given R, the received Extended Golay code, this function tries to decode it using the Extended Golay code parity check matrix. Extended Golay code (24,12) which can correct up to 3 errors.

The received code R, needs to be of length Nx24, for encoding. We can decode several codes at once, if they are stacked as a matrix of 24 columns, each code in a separate row.

The generator used in here is same as obtained from the function egolaygen.

The function returns C, the error-corrected code word from the received word. If decoding failed, err value is 1, otherwise it is 0.

Extended Golay code (24,12) which can correct up to 3 errors. Decoding algorithm follows from Lin & Costello.

Ref: Lin & Costello, pg 128, Ch4, "Error Control Coding", 2nd ed, Pearson.

msg = rand (10, 12) > 0.5;
c1 = egolayenc (msg);
c1(:,1) = mod (c1(:,1) + 1, 2)
c2 = egolaydec (c1)

See also: egolaygen, egolayenc.

Package: communications