Improved ECC handout
This commit is contained in:
@ -1,14 +1,20 @@
|
||||
\section{Error Correction}
|
||||
|
||||
Error detection is helpful, but we'd also like to fix errors when we find them. One example of such a system is the QR code, which remains readable even if a significant amount of it is removed. QR codes with icons inside aren't special--they're just missing their central elements. The error-correcting codes in the QR specification allow us to recover the lost data.
|
||||
As we saw in \ref{isbn-nocorrect}, the ISBN check-digit scheme does not allow us to correct errors. \par
|
||||
QR codes feature a system that does. \par
|
||||
|
||||
\vspace{1mm}
|
||||
|
||||
Odds are, you've seen a QR code with an image in the center. Such codes aren't \say{special}---they're simply missing their central pixels. The error-correcting algorithm in the QR specification allows us to read the code despite this damage.
|
||||
\begin{figure}[h]
|
||||
\centering
|
||||
\includegraphics[width = 3cm]{qr}
|
||||
\end{figure}
|
||||
|
||||
\definition{Repeating codes}
|
||||
The simplest possible error-correcting code is a \say{repeating code}. It works just as you'd expect: \\
|
||||
Instead of sending data once, it sends multiple copies. If a few bits are damaged, they can be both detected and repaired. \\
|
||||
The simplest possible error-correcting code is a \textit{repeating code}. It works just as you'd expect: \par
|
||||
Instead of sending data once, it sends multiple copies of each bit. \par
|
||||
If a few bits are damaged, they can be both detected and repaired. \par
|
||||
|
||||
For example, consider the following three-repeat code encoding the binary string $101$:
|
||||
|
||||
@ -18,6 +24,16 @@ $$
|
||||
|
||||
If we flip any one bit, we can easily find and fix the error.
|
||||
|
||||
\problem{}
|
||||
How many repeated digits do you need to...
|
||||
\begin{itemize}
|
||||
\item[-] detect a transposition error?
|
||||
\item[-] correct a transposition error?
|
||||
\end{itemize}
|
||||
|
||||
\vfill
|
||||
|
||||
|
||||
\definition{Code Efficiency}
|
||||
The efficiency of an error-correcting code is calculated as follows:
|
||||
$$
|
||||
@ -27,32 +43,25 @@ $$
|
||||
For example, the efficiency of the three-repeat code above is $\frac{3}{9} = \frac{1}{3} \approx 0.33$
|
||||
|
||||
\problem{}
|
||||
What is the efficiency of an $k$-repeat code?
|
||||
|
||||
\vfill
|
||||
|
||||
\problem{}
|
||||
How many repeated digits do you need to...
|
||||
\begin{itemize}
|
||||
\item[-] detect a transposition error?
|
||||
\item[-] correct a transposition error?
|
||||
\end{itemize}
|
||||
What is the efficiency of a $k$-repeat code?
|
||||
|
||||
\vfill
|
||||
\pagebreak
|
||||
|
||||
\definition{Hamming's Square Code}
|
||||
We will now analyze a more efficient coding scheme: \par
|
||||
|
||||
A more effective coding scheme comes in the form of Hamming's square code.
|
||||
Take a four-bit message and arrange it in a $2 \times 2$ square. \\
|
||||
\vspace{1mm}
|
||||
|
||||
Compute the pairity of each row and write it at the right. \\
|
||||
Compute the pairity of each column and write it at the bottom. \\
|
||||
Take a four-bit message and arrange it in a $2 \times 2$ square. \par
|
||||
Compute the pairity of each row and write it at the right. \par
|
||||
Compute the pairity of each column and write it at the bottom. \par
|
||||
Finally, compute the pairity of the entire message write it in the lower right corner.
|
||||
This ensures that the total number of ones in the message is even.
|
||||
|
||||
\vspace{3mm}
|
||||
\vspace{2mm}
|
||||
|
||||
Reading the result row by row to get the encoded message. \\
|
||||
Reading the result row by row to get the encoded message. \par
|
||||
For example, the message 1011 generates the sequence 101110011:
|
||||
|
||||
$$
|
||||
@ -80,7 +89,7 @@ $$
|
||||
$$
|
||||
|
||||
\problem{}
|
||||
The following message are encoded using the method above.
|
||||
The following messages are encoded using the method above.
|
||||
Find and correct any single-digit or transposition errors.
|
||||
\begin{enumerate}
|
||||
\item \texttt{110 110 011} %101110011
|
||||
@ -104,13 +113,13 @@ What is the efficiency of this coding scheme?
|
||||
\vfill
|
||||
|
||||
\problem{}
|
||||
Can we correct a single-digit error in the encoded message? \\
|
||||
Can we correct a single-digit error in the encoded message? \par
|
||||
Can we correct a transposition error in the encoded message?
|
||||
|
||||
\vfill
|
||||
|
||||
\problem{}
|
||||
Let's generalize this coding scheme to a non-square table: \\
|
||||
Let's generalize this coding scheme to a non-square table: \par
|
||||
Given a message of length $ab$, construct a rectangle with dimensions $a \times b$ as described above.
|
||||
\begin{itemize}
|
||||
\item What is the efficiency of a $a \times b$ rectangle code?
|
||||
|
Reference in New Issue
Block a user