Mariner 9 Code
Mariner 9 Code
Mission Objectives:
(Mariner 8): Map 70% of Martian surface.
(Mariner 9): Study temporal changes in Martian atmosphere and
surface features.
Live TV
The problem that arises comes from the difficulties inherent with
the transmission of messages. More precisely, we wish to transmit
a message and know that in the process of transmission there will
be some altering of the message, due to weak signals, sporadic
electrical bursts and other naturally occurring noise that creeps into
the transmission medium. The problem is to insure that the
intended message (our original transmission) is obtainable from
whatever is actually received.
The Repeat Code
One simple approach to this problem is what is called a repeat code.
For instance, if we wanted to send the message BAD NEWS, we
could repeat each letter a certain number of times and send,
say,
BBBBBAAAAADDDDD NNNNNEEEEEWWWWWSSSSS.
(In this calculation we are assuming that the error in transmitting a single
symbol is independent of which position the symbol is in. This is a
common simplifying assumption ... which may not be appropriate in real
world situations.)
Probability
Using the repeat code, the probability of correctly decoding a given letter
from a block of 5 symbols is
q5 + 5q4p + 10q3p2
since there are three ways to decode correctly: 1) all the symbols are
correct, 2) one symbol is incorrect (5 ways this can happen) or 3) two
symbols are incorrect (10 ways this can happen) [notice that these are
just terms in the expansion of (q+p)5]. So we obtain
(.95)5 + 5(.95)4(.05) + 10(.95)3(.05)2 = 0.9988
and thus the probability of getting the correct eight letter message after
decoding is (0.9988)8 = 0.990, clearly a great increase over the non-
coded message ( = 0.66), but this 1% probability of getting the wrong
message might not be acceptable for certain applications.
Terminology
To increase the probability of decoding the correct message with
this type of code we would have to increase the number of repeats
- a fix which may not be desirable or even possible in certain
situations. However, as we shall see, other coding schemes could
increase the probability to 0.9999 without increasing the length of
the coded message.
One feature that a useful code must have is the ability to detect
errors. The repeat code with code words having length 5 can
always detect from 1 to 4 errors made in the transmission of a code
word, since any 5 letter word composed of more than one letter is
not a code word. However, it is possible for 5 errors to go
undetected (how?). We would say that this code is 4-error
detecting. Another feature is the ability to correct errors, i.e., being
able to decode the correct information from the error riddled
received words. The repeat code we are dealing with can always
correct 1 or 2 errors, but may decode a word with 3 or more errors
incorrectly (how?), so it is a 2-error correcting code.
Coding Needed
The actual code selected is 7-error correcting and this reduced the
probability of error in the image to only 0.01%.
1 1 -1 1 1 1 1 1 1 1
1 -1 1 -1 1 1 1 -1 1 -1
1 1 -1 1 1 1 -1 -1
1 1 1 -1 1 -1 -1 1
Hadamard Matrices
These matrices were first considered as Hadamard determinants. They were
so named because the determinant of an Hadamard matrix satisfies equality in
Hadamard's determinant theorem, which states that if X = xij is a matrix of
order n where | xij | ≤ 1 for all i and j, then
| det X | ≤ nn/2
Proof: [1] is an Hadamard matrix of order 1 and the first example above is an
Hadamard matrix of order 2. Suppose now that H is an Hadamard matrix of
order h > 2. Normalize H and rearrange the first three rows to look like:
1 ..... 1 1 ..... 1 1 ..... 1 1 ..... 1
1 ..... 1 1 ..... 1 -1 .....-1 -1 .....-1
1 ..... 1 -1 .....-1 1 ..... 1 -1 .....-1
x y z w
Where x,y,z,w are the numbers of columns of each type. As the order is h,
x+y+z+w=h
and taking the inner products of rows 1 and 2, 1 and 3, and, 2 and 3 we get
x+y-z-w=0
x-y+z-w=0
x - y - z + w = 0.
Solving this system of equations gives,
x = y = z = w = h/4.
Thus, the integer h must be divisible by 4.
Properties of Hadamard Matrices
Corollary: If H is a normalized Hadamard matrix of order 4n, then every row
(column) except the first has 2n minus ones and 2n plus ones, further n minus
ones in any row (column) overlap with n minus ones in each other row
(column).
Proof: This is a direct result of the above proof since any two rows other than
the first can take the place of the second and third rows in the proof. The same
argument can be applied to the columns.
Hadamard matrices are known for many of the possible orders, the
smallest order for which the existence of an Hadamard matrix is in doubt is
currently 668 (A solution for the previous unknown case of 428 was
announced by Kharaghani and Tayfeh-Rezaie in June 2004).
Construction of Hadamard Matrices
While there are a great many construction methods for Hadamard
matrices, we will only consider one of the simplest, the direct product
construction.
[ ]
1 1 1 1
H 1∗H 2=
H 2
H 2 [ ]
H 2
−H 2
=
1
1
1
−1
1
−1
1
−1
−1
−1
−1
1
.
Back to Mariner 9
Recall that in the Mariner 9 mission, the data consisted of binary 6-
tuples (64 grayness levels) and transmission restrictions permitted
coding that would lengthen the transmitted words to about 30 bits.
The code chosen was a Reed-Muller code. The code words are 32
bits long and there are 64 of them. The code words are the rows of
a 32 × 32 Hadamard matrix constructed by repeating our example
construction 3 more times, and their negatives.
Error Correction
The ability of a code to correct errors is directly related to the
“distance” between code words. We must make this concept
precise.
The block codes we will talk about will be subsets of the set of
all n-tuples whose coordinates come from an alphabet of size k.
We will denote this large set by V(n,k) and will often think of it
as a “vector space”, but this is not accurate unless the alphabet is
a field. In this more general setting, we do not do algebraic
operations with our “vectors” since the alphabet need not have
any algebraic properties. When we are being careful, we will use
the term word instead of “vector”.
Hamming Distance
The Hamming distance between two words in V(n,k) is the
number of places in which they differ.
The first two of these properties are obvious, but the triangle
inequality requires a little argument (this is a homework problem).
Since we will only deal with the Hamming distance (there are other
metrics used in Coding Theory), we will generally omit the
Hamming modifier and talk about the distance between words.
Minimum Distance
The minimum distance of a code C is the smallest distance
between any pair of distinct codewords in C. It is the minimum
distance of a code that measures a code's error correcting
capabilities. If the minimum distance of a code C is 2e + 1, then C
is a 2e-error detecting code since 2e or fewer errors in a codeword
will not get to another codeword and is an e-error correcting code,
since if e or fewer errors are made in a codeword, the resulting
word is closer to the original codeword than it is to any other
codeword and so can be correctly decoded (maximum-likelihood
decoding).
First, convert all the code words (and the received vector) to ± 1
vectors by turning the 0's into -1's. Take the dot product of the
received vector with each of the code words in turn. As soon as the
result is 16 or greater, decode as that code word.
For each error that occurs, the dot product will decrease by 2 (or
increase by 2 from an incorrect codeword). If no more than 7 errors
occur, the dot product with the correct code word decreases to at
least 18 and the dot product with incorrect code words increases to
at most 14 ... so correct decoding will occur. If 8 or more errors
occur, there will be dot products of at least 16 but correct decoding
is not possible.
The Green Machine
Decoding: