Some efficient algorithms have been developed for first-order
codes. Consider the
code generated by
Decoding: We can translate the binary received signal
to a
sequence by the mapping
is equivalent to finding the codeword that maximizes
the correlation
. The operation of
computing the correlation can be performed efficiently by means of the
Hadamard transform.
Let
denote the Hadamard transform of
, where
is the
Hadamard matrix. For decoding
the
code we would use the Hadamard matrix
and
, respectively. The
in binary is the vector
thus computes the
correlation of
with the mappings of all the codewords. We
simply find the coordinate in the transform with the largest value and
determine the codeword from it.
There is one last trick. The
code has
codewords in
it, and we only get
values out of the Hadamard transform just
described. However, we note that if we complement each bit, by
. Thus we can look
at the sign and on that basis get the other half of the codewords.
.
.
where
. if 