<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE document PUBLIC "-//CNX//DTD CNXML 0.5 plus MathML//EN" "http://cnx.rice.edu/cnxml/0.5/DTD/cnxml_mathml.dtd">
<document xmlns="http://cnx.rice.edu/cnxml" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="m10174">

  <name>Channel Coding</name>
  <metadata>
  <md:version>2.11</md:version>
  <md:created>2001/07/09</md:created>
  <md:revised>2005/10/27 20:28:54.736 GMT-5</md:revised>
  <md:authorlist>
      <md:author id="aaz">
      <md:firstname>Behnaam</md:firstname>
      
      <md:surname>Aazhang</md:surname>
      <md:email>aaz@ece.rice.edu</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist>
    <md:maintainer id="dinesh">
      <md:firstname>Dinesh</md:firstname>
      
      <md:surname>Rajan</md:surname>
      <md:email>dinesh@ece.rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="mohammad">
      <md:firstname>Mohammad</md:firstname>
      <md:othername>Jaber</md:othername>
      <md:surname>Borran</md:surname>
      <md:email>mohammad@ece.rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="rha">
      <md:firstname>Roy</md:firstname>
      
      <md:surname>Ha</md:surname>
      <md:email>rha@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="mrshawn">
      <md:firstname>Shawn</md:firstname>
      
      <md:surname>Stewart</md:surname>
      <md:email>mrshawn@alumni.rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="aaz">
      <md:firstname>Behnaam</md:firstname>
      
      <md:surname>Aazhang</md:surname>
      <md:email>aaz@ece.rice.edu</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  <md:keywordlist>
    <md:keyword>block code</md:keyword>
    <md:keyword>channel coding</md:keyword>
    <md:keyword>Hamming distance</md:keyword>
    <md:keyword>information theory</md:keyword>
  </md:keywordlist>

  <md:abstract>A description of channel coding, in particular linear block codes.</md:abstract>
</metadata>

  <content>

    <para id="para1">
    Channel coding is a viable method to reduce information rate
    through the channel and increase reliability.  This goal is
    achieved by adding redundancy to the information symbol vector
    resulting in a longer coded vector of symbols that are
    distinguishable at the output of the channel.  Another brief
    explanation of channel coding is offered in <cnxn document="m0071">Channel Coding and the Repetition Code</cnxn>.
    We consider only two classes of codes, <cnxn target="s1">block
    codes</cnxn> and <cnxn document="m10181">convolutional
    codes</cnxn>.
  </para>

  <section id="s1">
    <name>Block codes</name>

    <para id="para2">
      The information sequence is divided into blocks of length
	<m:math><m:ci>k</m:ci> </m:math>.  Each block is mapped into
	channel inputs of length <m:math><m:ci>n</m:ci> </m:math>.
	The mapping is independent from previous blocks, that is,
	there is no memory from one block to another.
    </para>

    <example id="example1">
      <para id="para3">
        <m:math display="inline">
          <m:apply>
            <m:eq/>
              <m:ci>k</m:ci>
              <m:cn>2</m:cn>
          </m:apply>
        </m:math>
        and
        <m:math display="inline">
          <m:apply>
            <m:eq/>
              <m:ci>n</m:ci>
              <m:cn>5</m:cn>
          </m:apply>
        </m:math>

        <equation id="eq04">
          <m:math display="block">
            <m:apply>
              <m:tendsto/>
                <m:ci>00</m:ci>
                <m:ci>00000</m:ci>
            </m:apply>
          </m:math>
        </equation>
 
       <equation id="eq05">
          <m:math display="block">
            <m:apply>
              <m:tendsto/>
                <m:ci>01</m:ci>
                <m:ci>10100</m:ci>
            </m:apply>
          </m:math>
        </equation>

        <equation id="eq06">
          <m:math display="block">
            <m:apply>
              <m:tendsto/>
                <m:ci>10</m:ci>
                <m:ci>01111</m:ci>
            </m:apply>
          </m:math>
        </equation>

        <equation id="eq07">
          <m:math display="block">
            <m:apply>
              <m:tendsto/>
                <m:ci>11</m:ci>
                <m:ci>11011</m:ci>
            </m:apply>
          </m:math>
        </equation>
        information sequence ⇒ codeword (channel input)
      </para>

    </example>

    <para id="para4">
      A binary block code is completely defined by
      <m:math display="inline">
        <m:apply>
          <m:power/>
            <m:cn>2</m:cn>
            <m:ci>k</m:ci>
        </m:apply>
      </m:math>
      binary sequences of length <m:math><m:ci>n</m:ci>
	</m:math> called codewords.
      <equation id="eq01">
        <m:math display="block">
          <m:apply>
            <m:eq/>
              <m:ci type="vector">C</m:ci>
              <m:set>
		<m:ci type="vector"><m:msub>
		    <m:mi>c</m:mi>
                    <m:mn>1</m:mn>
		  </m:msub></m:ci>
		<m:ci type="vector"><m:msub>
		    <m:mi>c</m:mi>
                    <m:mn>2</m:mn>
		  </m:msub></m:ci>
                <m:ci>…</m:ci>
                <m:ci type="vector"><m:msub>
		    <m:mi>c</m:mi>
		    <m:msup>
		      <m:mn>2</m:mn>
		      <m:mi>k</m:mi>
		    </m:msup>
		  </m:msub></m:ci>
              </m:set>
          </m:apply>
        </m:math>
      </equation>
      <equation id="eq02">
        <m:math display="block">
          <m:apply>
            <m:in/>
	      <m:ci type="vector"><m:msub>
		    <m:mi>c</m:mi>
                    <m:mi>i</m:mi>
		  </m:msub></m:ci>
              <m:apply>
                <m:power/>
                  <m:set>
                    <m:cn>0</m:cn>
                    <m:cn>1</m:cn>
                  </m:set>
                  <m:ci>n</m:ci>
              </m:apply>
          </m:apply>
        </m:math>
      </equation>
      There are three key questions,
	<list id="list1" type="enumerated">
	  <item>How can one find "good" codewords?</item> 
	  <item>How can one systematically map information sequences
	    into codewords?</item>
	  <item>How can one systematically find the corresponding
	    information sequences from a codeword,
	    <foreign>i.e.</foreign>, how can we decode?
        </item>
      </list>

      These can be done if we concentrate on linear codes and utilize finite 
      field algebra.
    </para>

    <para id="para5">
      A block code is linear if
      <m:math display="inline">
        <m:apply>
          <m:in/>
            <m:apply>
              <m:selector/>
                <m:ci type="vector">c</m:ci>
                <m:ci>i</m:ci>
            </m:apply>
            <m:ci type="vector">C</m:ci>
        </m:apply>
      </m:math>
      and
      <m:math display="inline">
        <m:apply>
          <m:in/>
            <m:apply>
              <m:selector/>
                <m:ci type="vector">c</m:ci>
                <m:ci>j</m:ci>
            </m:apply>
            <m:ci type="vector">C</m:ci>
        </m:apply>
      </m:math>
      implies
      <m:math display="inline">
        <m:apply>
          <m:in/>
            <m:apply>
             <m:xor/>
                <m:apply>
                  <m:selector/>
                    <m:ci type="vector">c</m:ci>
                    <m:ci>i</m:ci>
                </m:apply>
                <m:apply>
                  <m:selector/>
                    <m:ci type="vector">c</m:ci>
                    <m:ci>j</m:ci>
                </m:apply>
            </m:apply>
            <m:ci type="vector">C</m:ci>
        </m:apply>
      </m:math>
      where <m:math><m:mo>⊕</m:mo>
	</m:math> is an elementwise modulo 2 addition.
    </para>

    <para id="para6">
      Hamming distance is a useful measure of codeword properties
      <equation id="eq03">
        <m:math display="block">
          <m:apply>
            <m:eq/>
              <m:apply>
                <m:ci type="function">
                <m:msub>
                  <m:mi>d</m:mi>
                  <m:mi>H</m:mi>
                </m:msub>
              </m:ci>
              <m:apply>
                <m:selector/>
                  <m:ci type="vector">c</m:ci>
                  <m:ci>i</m:ci>
              </m:apply>
              <m:apply>
                <m:selector/>
                  <m:ci type="vector">c</m:ci>
                  <m:ci>j</m:ci>
              </m:apply>
            </m:apply>
              <m:ci>
                <m:mtext># of places that they are different</m:mtext>
              </m:ci>
          </m:apply>
        </m:math>
      </equation>
      Denote the codeword for information sequence
      <m:math>
        <m:apply>
          <m:eq/>
	    <m:ci type="vector"><m:msub>
		<m:mi>e</m:mi>
		<m:mn>1</m:mn>
	      </m:msub></m:ci>
            <m:vector>
              <m:cn>1</m:cn>
              <m:cn>0</m:cn>
              <m:cn>0</m:cn>
              <m:cn>0</m:cn>
              <m:ci>⋮</m:ci>
              <m:cn>0</m:cn>
              <m:cn>0</m:cn>
            </m:vector>
        </m:apply>
      </m:math>
      by
      <m:math display="inline">
        <m:ci>
          <m:msub>
            <m:mi>g</m:mi>
            <m:mn>1</m:mn>
          </m:msub>
        </m:ci>
      </m:math>
      and
      <m:math>
        <m:apply>
          <m:eq/>
	    <m:ci type="vector"><m:msub>
		<m:mi>e</m:mi>
		<m:mn>2</m:mn>
	      </m:msub></m:ci>
            <m:vector>
              <m:cn>0</m:cn>
              <m:cn>1</m:cn>
              <m:cn>0</m:cn>
              <m:cn>0</m:cn>
              <m:ci>⋮</m:ci>
              <m:cn>0</m:cn>
              <m:cn>0</m:cn>
            </m:vector>
        </m:apply>
      </m:math>
      by
      <m:math>
        <m:ci>
          <m:msub>
            <m:mi>g</m:mi>
            <m:mn>2</m:mn>
          </m:msub>
        </m:ci>
      </m:math>,…,
      and
      <m:math>
        <m:apply>
          <m:eq/>
	    <m:ci type="vector"><m:msub>
		<m:mi>e</m:mi>
		<m:mi>k</m:mi>
	      </m:msub></m:ci>
            <m:vector>
              <m:cn>0</m:cn>
              <m:cn>0</m:cn>
              <m:cn>0</m:cn>
              <m:cn>0</m:cn>
              <m:ci>⋮</m:ci>
              <m:cn>0</m:cn>
              <m:cn>1</m:cn>
            </m:vector>
        </m:apply>
      </m:math>
      by
      <m:math>
        <m:ci>
          <m:msub>
            <m:mi>g</m:mi>
            <m:mi>k</m:mi>
          </m:msub>
        </m:ci>
      </m:math>.  
      Then any information sequence can be expressed as 
      <equation id="eq08">
        <m:math>
          <m:apply>
            <m:eq/>
              <m:ci type="vector">u</m:ci>
              <m:vector>
                <m:ci>
                  <m:msub>
                    <m:mi>u</m:mi>
                    <m:mn>1</m:mn>
                  </m:msub>
                </m:ci>
                <m:ci>⋮</m:ci>
                <m:ci>
                  <m:msub>
                    <m:mi>u</m:mi>
                    <m:mi>k</m:mi>
                  </m:msub>
                </m:ci>
              </m:vector>
              <m:apply>
                <m:sum/>
		<m:bvar>
		  <m:ci>i</m:ci>
		</m:bvar>
		<m:lowlimit>
		  <m:cn>1</m:cn>
		</m:lowlimit>
		<m:uplimit>
		  <m:ci>k</m:ci>
		</m:uplimit>
		<m:apply>
		  <m:times/>
		  <m:ci>
		    <m:msub>
		      <m:mi>u</m:mi>
		      <m:mi>i</m:mi>
		    </m:msub>
		  </m:ci>
		  <m:ci type="vector">
		    <m:msub>
		      <m:mi>e</m:mi>
		      <m:mi>i</m:mi>
		    </m:msub>
		  </m:ci>
		</m:apply>
              </m:apply>
	    </m:apply>
	  </m:math>
	</equation>
      and the corresponding codeword could be
      <equation id="eq09">
        <m:math>
          <m:apply> 
           <m:eq/>
              <m:ci type="vector">c</m:ci>
              <m:apply>
                <m:sum/>
                  <m:bvar>
                    <m:ci>i</m:ci>
                  </m:bvar>
                  <m:lowlimit>
                    <m:cn>1</m:cn>
                  </m:lowlimit>
                  <m:uplimit>
                    <m:ci>k</m:ci>
                  </m:uplimit>
		<m:apply>
		  <m:times/>
		  <m:ci>
		    <m:msub>
		      <m:mi>u</m:mi>
		      <m:mi>i</m:mi>
		    </m:msub>
		  </m:ci>
		  <m:ci type="vector">
		    <m:msub>
		      <m:mi>g</m:mi>
		      <m:mi>i</m:mi>
		    </m:msub>
		  </m:ci>
                  </m:apply>
              </m:apply>
          </m:apply>
        </m:math>
      </equation>
      Therefore
      <equation id="eq10">
        <m:math>
          <m:apply>
            <m:eq/>
              <m:ci type="vector">c</m:ci>
              <m:apply>
                <m:times/>
                  <m:ci type="vector">u</m:ci>
                  <m:ci type="matrix">G</m:ci>
              </m:apply>
          </m:apply>
        </m:math>
      </equation>
      with
      <m:math>
        <m:apply>
          <m:eq/>
            <m:ci type="vector">c</m:ci>
            <m:apply>
              <m:power/>
                <m:set>
                  <m:cn>0</m:cn>
                  <m:cn>1</m:cn>
                </m:set>
                <m:ci>n</m:ci>
            </m:apply>
        </m:apply>
      </m:math>
      and
      <m:math>
        <m:apply>
          <m:in/>
            <m:ci type="vector">u</m:ci>
            <m:apply>
              <m:power/>
                <m:set>
                  <m:cn>0</m:cn>
                  <m:cn>1</m:cn>
                </m:set>
                <m:ci>k</m:ci>
            </m:apply>
        </m:apply>
      </m:math>
      where
      <m:math>
        <m:apply>
          <m:eq/>
            <m:ci type="matrix">G</m:ci>
            <m:vector>
	      <m:ci type="vector"><m:msub>
		  <m:mi>g</m:mi>
		  <m:mn>1</m:mn>
		</m:msub></m:ci>
	      <m:ci type="vector"><m:msub>
		  <m:mi>g</m:mi>
		  <m:mn>2</m:mn>
		</m:msub></m:ci>
              <m:ci>⋮</m:ci>
	      <m:ci type="vector"><m:msub>
		  <m:mi>g</m:mi>
		  <m:mi>k</m:mi>
		</m:msub></m:ci>
            </m:vector>
        </m:apply>
      </m:math>,
      a <m:math><m:ci>k</m:ci>
	</m:math>x<m:math><m:ci>n</m:ci>
	</m:math> matrix and all operations are modulo 2.

    </para>

    <example id="example2">
      <para id="para7">
        In <cnxn target="example1"/> with

        <equation id="eq11">
          <m:math display="block">
            <m:apply>
              <m:tendsto/>
                <m:ci>00</m:ci>
                <m:ci>00000</m:ci>
            </m:apply>
          </m:math>
        </equation>
 
       <equation id="eq12">
          <m:math display="block">
            <m:apply>
              <m:tendsto/>
                <m:ci>01</m:ci>
                <m:ci>10100</m:ci>
            </m:apply>
          </m:math>
        </equation>

        <equation id="eq13">
          <m:math display="block">
            <m:apply>
              <m:tendsto/>
                <m:ci>10</m:ci>
                <m:ci>01111</m:ci>
            </m:apply>
          </m:math>
        </equation>

        <equation id="eq14">
          <m:math display="block">
            <m:apply>
              <m:tendsto/>
                <m:ci>11</m:ci>
                <m:ci>11011</m:ci>
            </m:apply>
          </m:math>
        </equation>

        <m:math display="inline">
          <m:apply>
            <m:eq/>
	      <m:ci type="vector"><m:msub>
		  <m:mi>g</m:mi>
		  <m:mn>1</m:mn>
		</m:msub></m:ci>
              <m:vector>
                <m:cn>0</m:cn>
                <m:cn>1</m:cn>
                <m:cn>1</m:cn>
                <m:cn>1</m:cn>
                <m:cn>1</m:cn>
              </m:vector>
          </m:apply>
        </m:math>
        and
        <m:math display="inline">
          <m:apply>
            <m:eq/>
	      <m:ci type="vector"><m:msub>
		  <m:mi>g</m:mi>
		  <m:mn>2</m:mn>
		</m:msub></m:ci>
              <m:vector>
                <m:cn>1</m:cn>
                <m:cn>0</m:cn>
                <m:cn>1</m:cn>
                <m:cn>0</m:cn>
                <m:cn>0</m:cn>
              </m:vector>
          </m:apply>
        </m:math>
        and
        <m:math>
          <m:apply>
            <m:eq/>
              <m:ci type="matrix">G</m:ci>
              <m:matrix>
                <m:matrixrow>
                  <m:cn>0</m:cn>
                  <m:cn>1</m:cn>
                  <m:cn>1</m:cn>
                  <m:cn>1</m:cn>
                  <m:cn>1</m:cn>
                </m:matrixrow>
                <m:matrixrow>
                  <m:cn>1</m:cn>
                  <m:cn>0</m:cn>
                  <m:cn>1</m:cn>
                  <m:cn>0</m:cn>
                  <m:cn>0</m:cn>
                </m:matrixrow>
              </m:matrix>
          </m:apply>
        </m:math>
      </para>
    </example>

    <para id="para8">
      Additional information about coding efficiency and error are provided
      in <cnxn document="m0094">Block Channel Coding</cnxn>.
    </para>

    <para id="para9">
      Examples of good linear codes include Hamming codes, BCH codes, 
      Reed-Solomon codes, and many more. The rate of these codes is defined as
      <m:math>
        <m:apply>
          <m:divide/>
            <m:ci>k</m:ci>
            <m:ci>n</m:ci>
        </m:apply>
      </m:math>
      and these codes have different error correction and error detection
      properties.
    </para>

  </section>

</content>

</document>
