<?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:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="m10659">
  <name>Digital Transmitter: Introduction to Frequency Shift Keying </name>
  <metadata>
  <md:version>2.4</md:version>
  <md:created>2004/02/24 13:59:55.291 US/Central</md:created>
  <md:revised>2003/07/30 15:02:19.433 GMT-5</md:revised>
  <md:authorlist>
    <md:author id="rlmorris">
      <md:firstname>Robert</md:firstname>
      <md:othername>L.</md:othername>
      <md:surname>Morrison</md:surname>
      <md:email>rlmorris@uiuc.edu</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist>
    <md:maintainer id="rlmorris">
      <md:firstname>Robert</md:firstname>
      <md:othername>L.</md:othername>
      <md:surname>Morrison</md:surname>
      <md:email>rlmorris@uiuc.edu</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  <md:keywordlist>
    <md:keyword>communications</md:keyword>
    <md:keyword>transmitter</md:keyword>
    <md:keyword>frequency shift keying</md:keyword>
    <md:keyword>pseudo-random noise</md:keyword>
    <md:keyword>digital signal processing</md:keyword>
  </md:keywordlist>

  <md:abstract>This module introduces frequency shift keying (FSK) and describes components of an FSK transmitter block-diagram.  </md:abstract>
</metadata>


  <content>

    <section id="fsk">
      <name>Frequency Shift Keying</name>
      <para id="para1">
        <term>Frequency Shift Keying</term> (<term>FSK</term>) is a
        scheme to transmit digital information across an analog
        channel.  Binary data bits are grouped into blocks of a fixed
        size, and each block is represented by a unique carrier
        frequency, called a <term>symbol</term>, to be sent across the
        channel.  <note type="footnote">The receiver then looks at the
        recovered symbol frequency to determine which block of bits
        was sent and converts it back to the appropriate binary
        data.</note> This requires having a unique symbol for each
        possible combination of data bits in a block.  In this
        laboratory exercise each symbol represents a two-bit block;
        therefore, there will be four different symbols.
      </para>

      <para id="para2">
        The carrier frequency is kept constant over some number of
        samples known as the symbol period 
        (<m:math>
          <m:ci>
            <m:msub>
              <m:mi>T</m:mi>
              <m:mi>symb</m:mi>
            </m:msub>
          </m:ci>
        </m:math>).  The symbol rate, defined as 
        <m:math>
          <m:ci>
            <m:msub>
              <m:mi>F</m:mi>
              <m:mi>symb</m:mi>
            </m:msub>
          </m:ci>
        </m:math>, is a fraction of the board's sampling rate, 
        <m:math>
          <m:ci>
            <m:msub>
              <m:mi>F</m:mi>
              <m:mi>s</m:mi>
            </m:msub>
          </m:ci>
        </m:math>.  For our sampling rate of 44.1 kHz and a symbol
        period of 32, the symbol rate is 44.1k/32 symbols per second.
      </para>
      
      <figure id="fig1">
        <media type="image/png" src="trans.png"/>
        <caption>Pseudo-noise sequence generator and FSK
        transmitter.</caption>
      </figure>
    </section>

    <section id="pn-gen">
      <name>Pseudo-Noise Sequence Generator</name>
      <para id="para3">
        The input bits to the transmitter are provided by the special
        shift-register, called a <term>pseudo-noise sequence
        generator</term> (<term>PN generator</term>), on the left side
        of <cnxn target="fig1"/>.  A PN generator produces a sequence
        of bits that appears random.  The PN sequence will repeat with
        period
        <m:math>
          <m:apply>
            <m:minus/>
            <m:apply>
              <m:power/>
              <m:cn>2</m:cn>
              <m:ci>B</m:ci>
            </m:apply>
            <m:cn>1</m:cn>
          </m:apply>
        </m:math>, where 
	<m:math>
	  <m:ci>B</m:ci>
	</m:math> is the width in bits of the shift register.  A more
        detailed diagram of the PN generator alone appears in <cnxn target="fig2"/>.
      </para>
      
      <figure id="fig2">
        <media type="image/png" src="pn-gen.png"/>
        <caption>PN generator.</caption>
      </figure>
      
      <para id="para4">
        As shown in <cnxn target="fig2"/>, the PN generator is simply
        a shift-register and XOR gate.  Bits 1, 5, 6, and 7 of the
        shift-register are XORed together and the result is shifted
        into the highest bit of the register.  The lowest bit, which
        is shifted out, is the output of the PN generator.
      </para>
      
      <para id="para5">
        The PN generator is a useful source of random data bits for
        system testing.  We can simulate the bit sequence that would
        be transmitted by a user as the random bits generated by the
        PN generator.  Since communication systems tend to randomize
        the bits seen by the transmission scheme so that bandwidth can
        be efficiently utilized, the PN generator is a good data
        model.<note type="footnote">PN generators have other
        applications in communications, notably in the Code Division
        Multiple Access schemes used by cellular telephones.</note>
      </para>
    </section>

    <section id="s-to-p">
      <name>Series-to-Parallel Conversion</name>

      <para id="para6">
        The shift-register produces one output bit at a time.  Because
        each symbol the system transmits will encode two bits, we
        require the series-to-parallel conversion to group the output
        bits from the shift-register into blocks of two bits so that
        they can be mapped to a symbol.
      </para>
    </section>

    <section id="freq_lookup">
      <name>Frequency Look-up Table</name>
      
      <para id="para7">
        This is responsible for mapping blocks of bits to one of four
        frequencies as shown in <cnxn target="fig1"/>. Each possible
        two-bit block of data from the series-to-parallel conversion
        is mapped to a different carrier frequency
        <m:math>
          <m:ci>
            <m:msub>
              <m:mi>ω</m:mi>
              <m:mi>i</m:mi>
            </m:msub>
          </m:ci>
        </m:math>
        <note type="note">Note that the subscript 
	  <m:math>
	    <m:ci>i</m:ci> 
	  </m:math> denotes a symbol's index in the transmitted
	  signal; <foreign>i.e.</foreign>, the first symbol sent has
	  index
	  <m:math>
	    <m:apply>
	      <m:eq/>
	      <m:ci>i</m:ci>
	      <m:cn>1</m:cn>
	    </m:apply>
	  </m:math>, the second symbol sent has index 
	  <m:math>
	    <m:apply>
	      <m:eq/>
	      <m:ci>i</m:ci>
	      <m:cn>2</m:cn>
	    </m:apply>
	  </m:math>, and so on.  Therefore,
          <m:math>
            <m:ci>
              <m:msub>
                <m:mi>ω</m:mi>
                <m:mi>i</m:mi>
              </m:msub>
            </m:ci>
          </m:math> denotes the frequency and 
          <m:math>
            <m:ci>
              <m:msub>
                <m:mi>φ</m:mi>
                <m:mi>i</m:mi>
              </m:msub>
            </m:ci>
          </m:math> denotes the phase offset of the 
	  <m:math>
	    <m:ci><m:msup> 
		<m:mi>i</m:mi> 
		<m:mi>th</m:mi>
	      </m:msup></m:ci> 
	  </m:math> transmitted symbol.</note> These frequencies are
	then used to generate the waveforms.  The mappings for this
	assignment are given in <cnxn target="table1"/>.
      </para>
      
      <table frame="all" id="table1">
        <tgroup cols="2" align="right" colsep="1" rowsep="1">
          <thead valign="top">
            <row>
              <entry align="center">Data Chunk</entry>
              <entry align="center">Carrier Frequency 
                <m:math>
                  <m:ci><m:msub>
                      <m:mi>ω</m:mi>
		      <m:mi>i</m:mi>
                    </m:msub></m:ci>
                </m:math></entry>
            </row>
          </thead>
          <tbody valign="top">
            <row>
              <entry align="center">00</entry>
              <entry align="center">
                <m:math>
                  <m:apply>
                    <m:divide/>
                    <m:apply>
                      <m:times/>
                      <m:cn>9</m:cn>
                      <m:pi/>
                    </m:apply>
                    <m:cn>32</m:cn>
                  </m:apply>
                </m:math>
              </entry>
            </row>
            <row>
              <entry align="center">01</entry>
              <entry align="center">
                <m:math>
                  <m:apply>
                    <m:divide/>
                    <m:apply>
                      <m:times/>
                      <m:cn>13</m:cn>
                      <m:pi/>
                    </m:apply>
                    <m:cn>32</m:cn>
                  </m:apply>
                </m:math>
              </entry>
            </row>
            <row>
              <entry align="center">11</entry>
              <entry align="center">
                <m:math>
                  <m:apply>
                    <m:divide/>
                    <m:apply>
                      <m:times/>
                      <m:cn>17</m:cn>
                      <m:pi/>
                    </m:apply>
                    <m:cn>32</m:cn>
                  </m:apply>
                </m:math>
              </entry>
            </row>
            <row>
              <entry align="center">10</entry>
              <entry align="center">
                <m:math>
                  <m:apply>
                    <m:divide/>
                    <m:apply>
                      <m:times/>
                      <m:cn>21</m:cn>
                      <m:pi/>
                    </m:apply>
                    <m:cn>32</m:cn>
                  </m:apply>
                </m:math>
              </entry>
            </row>
          </tbody>
        </tgroup>
      </table>
      
      <para id="para8">
        One way to implement this mapping is by using a look-up
        table. The two-bit data block can be interpreted as an offset
        into a frequency table where we have stored the possible
        transmission frequencies.  Note that since each frequency
        mapping defines a symbol, this mapping is done at the symbol
        rate
        <m:math>
          <m:ci>
            <m:msub>
              <m:mi>F</m:mi>
              <m:mi>symb</m:mi>
            </m:msub>
          </m:ci>
        </m:math>, or once for every
        <m:math>
          <m:ci>
            <m:msub>
              <m:mi>T</m:mi>
              <m:mi>symb</m:mi>
            </m:msub>
          </m:ci>
        </m:math> DSP samples.
      </para>
      
      <para id="para9">
        The symbol bit assignments are such that any two adjacent
        frequencies map to data blocks that differ by only one bit.
        This assignment is called <term>Gray coding</term> and helps
        reduce the number of bit errors made in the event of a
        received symbol error.
      </para>
    </section>

    <section id="phase_cont">
      <name>Phase Continuity</name>
      
      <para id="para10">
        In order to minimize the bandwidth used by the transmitted
        signal, you should ensure that the phase of your transmitted
        waveform is continuous between symbols; i.e., the beginning
        phase of any symbol must be equal to the ending phase of the
        previous symbol. For instance, if a symbol of frequency
        <m:math>
          <m:apply>
            <m:divide/>
            <m:apply>
              <m:times/>
              <m:cn>9</m:cn>
              <m:pi/>
            </m:apply>
            <m:cn>32</m:cn>
          </m:apply>
        </m:math> begins at phase 0, the symbol will end 31 output
        samples later at phase
        <m:math>
          <m:apply>
            <m:times/>
            <m:cn>31</m:cn>
            <m:apply>
              <m:divide/>
              <m:apply>
                <m:times/>
                <m:cn>9</m:cn>
                <m:pi/>
              </m:apply>
              <m:cn>32</m:cn>
            </m:apply>
          </m:apply>
        </m:math>.  To preserve phase continuity, the next output sample must
        be at phase
        <m:math>
          <m:apply>
            <m:times/>
            <m:cn>32</m:cn>
            <m:apply>
              <m:divide/>
              <m:apply>
                <m:times/>
                <m:cn>9</m:cn>
                <m:pi/>
              </m:apply>
              <m:cn>32</m:cn>
            </m:apply>
          </m:apply>
        </m:math>, which is equivalent to phase 
	<m:math>
	  <m:pi/>
	</m:math>.  Therefore, the next symbol, whatever its
        frequency, must begin at phase  
	<m:math>
	  <m:pi/>
	</m:math>.  For each symbol, you must choose
        <m:math>
          <m:ci>
            <m:msub>
              <m:mi>φ</m:mi>
              <m:mi>i</m:mi>
            </m:msub>
          </m:ci>
        </m:math> in the expression 
        <m:math>
          <m:apply>
            <m:sin/>
            <m:apply>
              <m:plus/>
              <m:apply>
                <m:times/>
                <m:ci>
                  <m:msub>
                    <m:mi>ω</m:mi>
                    <m:mi>i</m:mi>
                  </m:msub>
                </m:ci>
                <m:ci>n</m:ci>
              </m:apply>
              <m:ci>
                <m:msub>
                  <m:mi>φ</m:mi>
                  <m:mi>i</m:mi>
                </m:msub>
              </m:ci>
            </m:apply>
          </m:apply>
        </m:math> to create this continuity.
      </para>
    </section>
  </content>
</document>
