Forward Error-Correcting coding with Hadamard Transform
Algorythms for Fast Hadamard Trasform
Forward Fast Hadamard Transform
as being used it in MT63 and MFSK/Olivia.
The algorythm is copied from
the C++ source.

Please note that this is not a very
correct (signs, calculation order, etc.)
form of the Hadamard Transform
Inverse Fast Hadamard Transform
as being used in MT63 and MFSK/Olivia.
This algorythm is copied from the C++ source.
ASCII character encoding and decoding with FHT
Here we encode the character '2' (ASCII code = 50)
We set the vector to 0 except for element
number 50 which we set to 1.

Note, that we can encode 64 characters this way and another 64 by choosing a negative value.
Here we do the inverse transform and we obtain the codeword.

Note that all the values are either + or - 1 which makes it easy to use them as bits to be sent over any bit-transmitting modulation.
We transform the data back and obtain our initial vector
and thus can see immediately the character that was encoded with that codeword. BTW: when we see a negative spike then an ASCII char. above 64 had been sent.
When the noise comes into play
White (Gaussian) noise generator
Here we can see what happens when we add noise
to the transmission (red samples are signals corrupted by noise)
Let's count transmission errors
(number of bits flipped by the noise)
Decoding with soft samples
Now decode the transmission with the FHT.
Knowing that only one of the 64 elements
should be non-zero we pick up the highest
one and we make no error - it is number 50.
The energy of a sequence (the sum of signal squares)
The highest amplitude
The RMS of the other amplitudes
which we assume is noise
The Signal-to-Noise ratio at the FEC decoder:
MT63 and MFSK/Olivia display this number
to give an idea about the decoding margin.
Decoding with hard samples
We repeat the decoding with hard samples.
Suppose our receiver can only see 0 or 1 (blue samples below) and is not able to see shades of grey
The decoder output is similar, although the peak
is closer to the noise background. In general soft samples decoding yields better performance.