<?xml version="1.0" encoding="utf-8"?>
<!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:bib="http://bibtexml.sf.net/" xmlns:md="http://cnx.rice.edu/mdml/0.4" id="id2255528">
  <name>FIR Filter Design by Frequency Sampling or Interpolation</name>
  <metadata>
  <md:version>1.1</md:version>
  <md:created>2008/06/09 13:09:46.357 GMT-5</md:created>
  <md:revised>2008/06/24 00:03:22.064 GMT-5</md:revised>
  <md:authorlist>
      <md:author id="cburrus">
      <md:firstname>C.</md:firstname>
      <md:othername>Sidney</md:othername>
      <md:surname>Burrus</md:surname>
      <md:email>csb@rice.edu</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist>
    <md:maintainer id="dcwill">
      <md:firstname>Daniel</md:firstname>
      <md:othername>Collins</md:othername>
      <md:surname>Williamson</md:surname>
      <md:email>dwilliamson1285@gmail.com</md:email>
    </md:maintainer>
    <md:maintainer id="cburrus">
      <md:firstname>C.</md:firstname>
      <md:othername>Sidney</md:othername>
      <md:surname>Burrus</md:surname>
      <md:email>csb@rice.edu</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  

  <md:abstract/>
</metadata>
  <content>
    <para id="id2255546">Since samples of the frequency response of an FIR filter can be calculated
by taking the DFT of the impulse response <m:math overflow="scroll"><m:mrow><m:mi>h</m:mi><m:mo>(</m:mo><m:mi>n</m:mi><m:mo>)</m:mo></m:mrow></m:math>, one could propose a
filter design method consisting of taking the inverse DFT of samples of a
desired frequency response. This can indeed be done and is called <emphasis>frequency sampling design</emphasis>. The resulting filter has a frequency response
that exactly interpolates the given samples, but there is no explicit control
of the behavior between the samples <cnxn target="bid0"/>, <cnxn target="bid1"/>.</para>
    <para id="id2255592">Three methods for frequency sampling design are:</para>
    <list id="id2255596" type="enumerated">
      <item id="uid1">Take the inverse DFT (perhaps using the FFT) of equally spaced
samples of the
desired frequency response. Care must be taken to use the correct phase
response to obtain a real valued causal <m:math overflow="scroll"><m:mrow><m:mi>h</m:mi><m:mo>(</m:mo><m:mi>n</m:mi><m:mo>)</m:mo></m:mrow></m:math> with reasonable behavior
between sample response. This method works for general nonlinear phase
design as well as for linear phase.
</item>
      <item id="uid2">Derive formulas for the inverse DFT which take the symmetries, phase, and
causality into account. It is interesting to notice these analysis and design
formulas turn
out to be the discrete cosine and sine transforms and their inverses.
</item>
      <item id="uid3">Solve the set of simultaneous linear equations that result from
calculating the sampled
frequency response from the impulse response. This method allows unevenly
spaced samples of the desired frequency response but the resulting equations
may be ill conditioned.
</item>
    </list>
    <section id="uid4">
      <name>Frequency Sampling Filter Design by Inverse DFT</name>
      <para id="id2255667">The most direct frequency sampling design method is to simply take the
inverse DFT of equally spaced samples of the desired complex frequency
response <m:math overflow="scroll"><m:mrow><m:msub><m:mi>H</m:mi><m:mi>d</m:mi></m:msub><m:mrow><m:mo>(</m:mo><m:msub><m:mi>ω</m:mi><m:mi>k</m:mi></m:msub><m:mo>)</m:mo></m:mrow></m:mrow></m:math>. This is done by</para>
      <equation id="uid5">
        <m:math mode="display" overflow="scroll">
          <m:mrow>
            <m:mi>h</m:mi>
            <m:mrow>
              <m:mo>(</m:mo>
              <m:mi>n</m:mi>
              <m:mo>)</m:mo>
            </m:mrow>
            <m:mspace width="0.166667em"/>
            <m:mspace width="0.166667em"/>
            <m:mo>=</m:mo>
            <m:mspace width="0.166667em"/>
            <m:mspace width="0.166667em"/>
            <m:mfrac>
              <m:mn>1</m:mn>
              <m:mi>N</m:mi>
            </m:mfrac>
            <m:munderover>
              <m:mo>∑</m:mo>
              <m:mrow>
                <m:mi>k</m:mi>
                <m:mo>=</m:mo>
                <m:mn>0</m:mn>
              </m:mrow>
              <m:mrow>
                <m:mi>N</m:mi>
                <m:mo>-</m:mo>
                <m:mn>1</m:mn>
              </m:mrow>
            </m:munderover>
            <m:msub>
              <m:mi>H</m:mi>
              <m:mi>d</m:mi>
            </m:msub>
            <m:mrow>
              <m:mo>(</m:mo>
              <m:mfrac>
                <m:mrow>
                  <m:mn>2</m:mn>
                  <m:mi>π</m:mi>
                </m:mrow>
                <m:mi>N</m:mi>
              </m:mfrac>
              <m:mi>k</m:mi>
              <m:mo>)</m:mo>
            </m:mrow>
            <m:mspace width="0.166667em"/>
            <m:msup>
              <m:mi>e</m:mi>
              <m:mrow>
                <m:mi>j</m:mi>
                <m:mn>2</m:mn>
                <m:mi>π</m:mi>
                <m:mi>n</m:mi>
                <m:mi>k</m:mi>
                <m:mo>/</m:mo>
                <m:mi>N</m:mi>
              </m:mrow>
            </m:msup>
          </m:mrow>
        </m:math>
      </equation>
      <para id="id2256054">where care must be taken to insure that the real and imaginary parts
(or magnitude and phase) of
<m:math overflow="scroll"><m:mrow><m:msub><m:mi>H</m:mi><m:mi>d</m:mi></m:msub><m:mrow><m:mo>(</m:mo><m:msub><m:mi>ω</m:mi><m:mi>k</m:mi></m:msub><m:mo>)</m:mo></m:mrow></m:mrow></m:math> satisfy the symmetry conditions that give a real, causal <m:math overflow="scroll"><m:mrow><m:mi>h</m:mi><m:mo>(</m:mo><m:mi>n</m:mi><m:mo>)</m:mo></m:mrow></m:math>.
This method will allow a general complex <m:math overflow="scroll"><m:mrow><m:mi>H</m:mi><m:mo>(</m:mo><m:mi>ω</m:mi><m:mo>)</m:mo></m:mrow></m:math> as well as a linear
phase. In most cases, it is easier to specify proper and consistent
samples if it is the magnitude and phase that are set rather than the
real and imaginary parts. For example, it is important that the desired
phase be consistent with the specified length being even or odd as is given
in (<cnxn target=""/>) and (<cnxn target=""/>).</para>
      <para id="id2256132">Since the frequency sampling design method will always produce a filter
with a frequency response that interpolates the specified samples, the
results of inappropriate phase specifications will show up as undesired
behavior between the samples.</para>
    </section>
    <section id="uid6">
      <name>Frequency Sampling Filter Design by Formulas</name>
      <para id="id2256147">When equally spaced samples of the desired frequency response are used,
it is possible to derive formulas for the inverse DFT and, therefore,
for the filter coefficients. This is because of the orthogonal basis
function of the DFT. These formulas can incorporate the various
constraints of a real <m:math overflow="scroll"><m:mrow><m:mi>h</m:mi><m:mo>(</m:mo><m:mi>n</m:mi><m:mo>)</m:mo></m:mrow></m:math> and/or linear phase and eliminate the
problems of inconsistency in specifying <m:math overflow="scroll"><m:mrow><m:mi>H</m:mi><m:mo>(</m:mo><m:msub><m:mi>ω</m:mi><m:mi>k</m:mi></m:msub><m:mo>)</m:mo></m:mrow></m:math>.</para>
      <para id="id2256194">To develop explicit formulas for frequency-sampling design of linear-phase
FIR filters, a direct use of the inverse DFT is most straightforward. When
<m:math overflow="scroll"><m:mrow><m:mi>H</m:mi><m:mo>(</m:mo><m:mi>ω</m:mi><m:mo>)</m:mo></m:mrow></m:math> has linear phase, (<cnxn target="uid5"/>) may be simplified using the
formulas for the four types of linear-phase FIR filters.</para>
      <section id="uid7">
        <name>Type 1. Odd Sampling</name>
        <para id="id2256229">Samples of the frequency response (<cnxn target=""/>)for the
filter where <m:math overflow="scroll"><m:mi>N</m:mi></m:math> is odd, <m:math overflow="scroll"><m:mrow><m:mi>L</m:mi><m:mo>=</m:mo><m:mi>N</m:mi></m:mrow></m:math>, and <m:math overflow="scroll"><m:mrow><m:mi>M</m:mi><m:mo>=</m:mo><m:mo>(</m:mo><m:mi>N</m:mi><m:mo>-</m:mo><m:mn>1</m:mn><m:mo>)</m:mo><m:mo>/</m:mo><m:mn>2</m:mn></m:mrow></m:math>, and where
there is a frequency sample at <m:math overflow="scroll"><m:mrow><m:mi>ω</m:mi><m:mo>=</m:mo><m:mn>0</m:mn></m:mrow></m:math> is given as</para>
        <equation id="uid8">
          <m:math mode="display" overflow="scroll">
            <m:mrow>
              <m:msub>
                <m:mi>A</m:mi>
                <m:mi>k</m:mi>
              </m:msub>
              <m:mspace width="0.166667em"/>
              <m:mo>=</m:mo>
              <m:mspace width="0.166667em"/>
              <m:munderover>
                <m:mo>∑</m:mo>
                <m:mrow>
                  <m:mi>n</m:mi>
                  <m:mo>=</m:mo>
                  <m:mn>0</m:mn>
                </m:mrow>
                <m:mrow>
                  <m:mi>M</m:mi>
                  <m:mo>-</m:mo>
                  <m:mn>1</m:mn>
                </m:mrow>
              </m:munderover>
              <m:mn>2</m:mn>
              <m:mi>h</m:mi>
              <m:mrow>
                <m:mo>(</m:mo>
                <m:mi>n</m:mi>
                <m:mo>)</m:mo>
              </m:mrow>
              <m:mo form="prefix">cos</m:mo>
              <m:mrow>
                <m:mo>(</m:mo>
                <m:mn>2</m:mn>
                <m:mi>π</m:mi>
                <m:mrow>
                  <m:mo>(</m:mo>
                  <m:mi>M</m:mi>
                  <m:mo>-</m:mo>
                  <m:mi>n</m:mi>
                  <m:mo>)</m:mo>
                </m:mrow>
                <m:mi>k</m:mi>
                <m:mo>/</m:mo>
                <m:mi>N</m:mi>
                <m:mo>)</m:mo>
              </m:mrow>
              <m:mo>+</m:mo>
              <m:mi>h</m:mi>
              <m:mrow>
                <m:mo>(</m:mo>
                <m:mi>M</m:mi>
                <m:mo>)</m:mo>
              </m:mrow>
              <m:mo>.</m:mo>
            </m:mrow>
          </m:math>
        </equation>
        <para id="id2256406">Using the amplitude function <m:math overflow="scroll"><m:mrow><m:mi>A</m:mi><m:mo>(</m:mo><m:mi>ω</m:mi><m:mo>)</m:mo></m:mrow></m:math>, defined in (<cnxn target=""/>), of the
form (<cnxn target="uid8"/>) and the IDFT (<cnxn target="uid5"/>) gives for the impulse response</para>
        <equation id="uid9">
          <m:math mode="display" overflow="scroll">
            <m:mrow>
              <m:mi>h</m:mi>
              <m:mrow>
                <m:mo>(</m:mo>
                <m:mi>n</m:mi>
                <m:mo>)</m:mo>
              </m:mrow>
              <m:mspace width="0.166667em"/>
              <m:mo>=</m:mo>
              <m:mspace width="0.166667em"/>
              <m:mfrac>
                <m:mn>1</m:mn>
                <m:mi>N</m:mi>
              </m:mfrac>
              <m:munderover>
                <m:mo>∑</m:mo>
                <m:mrow>
                  <m:mi>k</m:mi>
                  <m:mo>=</m:mo>
                  <m:mn>0</m:mn>
                </m:mrow>
                <m:mrow>
                  <m:mi>N</m:mi>
                  <m:mo>-</m:mo>
                  <m:mn>1</m:mn>
                </m:mrow>
              </m:munderover>
              <m:msup>
                <m:mi>e</m:mi>
                <m:mrow>
                  <m:mo>-</m:mo>
                  <m:mi>j</m:mi>
                  <m:mn>2</m:mn>
                  <m:mi>π</m:mi>
                  <m:mi>M</m:mi>
                  <m:mi>k</m:mi>
                  <m:mo>/</m:mo>
                  <m:mi>N</m:mi>
                </m:mrow>
              </m:msup>
              <m:msub>
                <m:mi>A</m:mi>
                <m:mi>k</m:mi>
              </m:msub>
              <m:msup>
                <m:mi>e</m:mi>
                <m:mrow>
                  <m:mi>j</m:mi>
                  <m:mn>2</m:mn>
                  <m:mi>π</m:mi>
                  <m:mi>n</m:mi>
                  <m:mi>k</m:mi>
                  <m:mo>/</m:mo>
                  <m:mi>N</m:mi>
                </m:mrow>
              </m:msup>
            </m:mrow>
          </m:math>
        </equation>
        <para id="id2256548">or</para>
        <equation id="uid10">
          <m:math mode="display" overflow="scroll">
            <m:mrow>
              <m:mi>h</m:mi>
              <m:mrow>
                <m:mo>(</m:mo>
                <m:mi>n</m:mi>
                <m:mo>)</m:mo>
              </m:mrow>
              <m:mspace width="0.166667em"/>
              <m:mo>=</m:mo>
              <m:mspace width="0.166667em"/>
              <m:mfrac>
                <m:mn>1</m:mn>
                <m:mi>N</m:mi>
              </m:mfrac>
              <m:munderover>
                <m:mo>∑</m:mo>
                <m:mrow>
                  <m:mi>k</m:mi>
                  <m:mo>=</m:mo>
                  <m:mn>0</m:mn>
                </m:mrow>
                <m:mrow>
                  <m:mi>N</m:mi>
                  <m:mo>-</m:mo>
                  <m:mn>1</m:mn>
                </m:mrow>
              </m:munderover>
              <m:msub>
                <m:mi>A</m:mi>
                <m:mi>k</m:mi>
              </m:msub>
              <m:msup>
                <m:mi>e</m:mi>
                <m:mrow>
                  <m:mi>j</m:mi>
                  <m:mn>2</m:mn>
                  <m:mi>π</m:mi>
                  <m:mo>(</m:mo>
                  <m:mi>n</m:mi>
                  <m:mo>-</m:mo>
                  <m:mi>M</m:mi>
                  <m:mo>)</m:mo>
                  <m:mi>k</m:mi>
                  <m:mo>/</m:mo>
                  <m:mi>N</m:mi>
                </m:mrow>
              </m:msup>
              <m:mo>.</m:mo>
            </m:mrow>
          </m:math>
        </equation>
        <para id="id2256650">Because <m:math overflow="scroll"><m:mrow><m:mi>h</m:mi><m:mo>(</m:mo><m:mi>n</m:mi><m:mo>)</m:mo></m:mrow></m:math> is real, <m:math overflow="scroll"><m:mrow><m:msub><m:mi>A</m:mi><m:mi>k</m:mi></m:msub><m:mo>=</m:mo><m:msub><m:mi>A</m:mi><m:mrow><m:mi>N</m:mi><m:mo>-</m:mo><m:mi>k</m:mi></m:mrow></m:msub></m:mrow></m:math> and (<cnxn target="uid10"/>) becomes</para>
        <equation id="uid11">
          <m:math mode="display" overflow="scroll">
            <m:mrow>
              <m:mi>h</m:mi>
              <m:mrow>
                <m:mo>(</m:mo>
                <m:mi>n</m:mi>
                <m:mo>)</m:mo>
              </m:mrow>
              <m:mspace width="0.166667em"/>
              <m:mo>=</m:mo>
              <m:mspace width="0.166667em"/>
              <m:mfrac>
                <m:mn>1</m:mn>
                <m:mi>N</m:mi>
              </m:mfrac>
              <m:mrow>
                <m:mo>[</m:mo>
                <m:msub>
                  <m:mi>A</m:mi>
                  <m:mn>0</m:mn>
                </m:msub>
                <m:mo>+</m:mo>
                <m:munderover>
                  <m:mo>∑</m:mo>
                  <m:mrow>
                    <m:mi>k</m:mi>
                    <m:mo>=</m:mo>
                    <m:mn>1</m:mn>
                  </m:mrow>
                  <m:mrow>
                    <m:mi>M</m:mi>
                    <m:mo>-</m:mo>
                    <m:mn>1</m:mn>
                  </m:mrow>
                </m:munderover>
                <m:mn>2</m:mn>
                <m:msub>
                  <m:mi>A</m:mi>
                  <m:mi>k</m:mi>
                </m:msub>
                <m:mo form="prefix">cos</m:mo>
                <m:mrow>
                  <m:mo>(</m:mo>
                  <m:mn>2</m:mn>
                  <m:mi>π</m:mi>
                  <m:mrow>
                    <m:mo>(</m:mo>
                    <m:mi>n</m:mi>
                    <m:mo>-</m:mo>
                    <m:mi>M</m:mi>
                    <m:mo>)</m:mo>
                  </m:mrow>
                  <m:mi>k</m:mi>
                  <m:mo>/</m:mo>
                  <m:mi>N</m:mi>
                  <m:mo>)</m:mo>
                </m:mrow>
                <m:mo>]</m:mo>
              </m:mrow>
              <m:mo>.</m:mo>
            </m:mrow>
          </m:math>
        </equation>
        <para id="id2256822">Only <m:math overflow="scroll"><m:mrow><m:mi>M</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:math> of the <m:math overflow="scroll"><m:mrow><m:mi>h</m:mi><m:mo>(</m:mo><m:mi>n</m:mi><m:mo>)</m:mo></m:mrow></m:math> need be calculated because of the symmetries
in (<cnxn target=""/>).</para>
        <para id="id2256861">This formula calculates the impulse response values <m:math overflow="scroll"><m:mrow><m:mi>h</m:mi><m:mo>(</m:mo><m:mi>n</m:mi><m:mo>)</m:mo></m:mrow></m:math>
from the desired frequency samples <m:math overflow="scroll"><m:msub><m:mi>A</m:mi><m:mi>k</m:mi></m:msub></m:math> and requires <m:math overflow="scroll"><m:msup><m:mi>M</m:mi><m:mn>2</m:mn></m:msup></m:math>
operations rather than <m:math overflow="scroll"><m:msup><m:mi>N</m:mi><m:mn>2</m:mn></m:msup></m:math>. An interesting observation is that
not only are (<cnxn target="uid8"/>) and (<cnxn target="uid11"/>) a pair of analysis and design
formulas, they are also a transform pair. Indeed, they are of the
same form as a discrete cosine transform (DCT).</para>
      </section>
      <section id="uid12">
        <name>Type 2. Odd Sampling</name>
        <para id="id2256943">A similar development applied to the cases for even <m:math overflow="scroll"><m:mi>N</m:mi></m:math> from
(<cnxn target=""/>) gives the amplitude frequency response samples as</para>
        <equation id="uid13">
          <m:math mode="display" overflow="scroll">
            <m:mrow>
              <m:msub>
                <m:mi>A</m:mi>
                <m:mi>k</m:mi>
              </m:msub>
              <m:mspace width="0.166667em"/>
              <m:mo>=</m:mo>
              <m:mspace width="0.166667em"/>
              <m:munderover>
                <m:mo>∑</m:mo>
                <m:mrow>
                  <m:mi>n</m:mi>
                  <m:mo>=</m:mo>
                  <m:mn>0</m:mn>
                </m:mrow>
                <m:mrow>
                  <m:mi>N</m:mi>
                  <m:mo>/</m:mo>
                  <m:mn>2</m:mn>
                  <m:mo>-</m:mo>
                  <m:mn>1</m:mn>
                </m:mrow>
              </m:munderover>
              <m:mn>2</m:mn>
              <m:mi>h</m:mi>
              <m:mrow>
                <m:mo>(</m:mo>
                <m:mi>n</m:mi>
                <m:mo>)</m:mo>
              </m:mrow>
              <m:mo form="prefix">cos</m:mo>
              <m:mrow>
                <m:mo>(</m:mo>
                <m:mn>2</m:mn>
                <m:mi>π</m:mi>
                <m:mrow>
                  <m:mo>(</m:mo>
                  <m:mi>M</m:mi>
                  <m:mo>-</m:mo>
                  <m:mi>n</m:mi>
                  <m:mo>)</m:mo>
                </m:mrow>
                <m:mi>k</m:mi>
                <m:mo>/</m:mo>
                <m:mi>N</m:mi>
                <m:mo>)</m:mo>
              </m:mrow>
            </m:mrow>
          </m:math>
        </equation>
        <para id="id2257056">with the design formula of</para>
        <equation id="uid14">
          <m:math mode="display" overflow="scroll">
            <m:mrow>
              <m:mi>h</m:mi>
              <m:mrow>
                <m:mo>(</m:mo>
                <m:mi>n</m:mi>
                <m:mo>)</m:mo>
              </m:mrow>
              <m:mspace width="0.166667em"/>
              <m:mo>=</m:mo>
              <m:mspace width="0.166667em"/>
              <m:mfrac>
                <m:mn>1</m:mn>
                <m:mi>N</m:mi>
              </m:mfrac>
              <m:mrow>
                <m:mo>[</m:mo>
                <m:msub>
                  <m:mi>A</m:mi>
                  <m:mn>0</m:mn>
                </m:msub>
                <m:mo>+</m:mo>
                <m:munderover>
                  <m:mo>∑</m:mo>
                  <m:mrow>
                    <m:mi>k</m:mi>
                    <m:mo>=</m:mo>
                    <m:mn>1</m:mn>
                  </m:mrow>
                  <m:mrow>
                    <m:mi>N</m:mi>
                    <m:mo>/</m:mo>
                    <m:mn>2</m:mn>
                    <m:mo>-</m:mo>
                    <m:mn>1</m:mn>
                  </m:mrow>
                </m:munderover>
                <m:mn>2</m:mn>
                <m:msub>
                  <m:mi>A</m:mi>
                  <m:mi>k</m:mi>
                </m:msub>
                <m:mo form="prefix">cos</m:mo>
                <m:mrow>
                  <m:mo>(</m:mo>
                  <m:mn>2</m:mn>
                  <m:mi>π</m:mi>
                  <m:mrow>
                    <m:mo>(</m:mo>
                    <m:mi>n</m:mi>
                    <m:mo>-</m:mo>
                    <m:mi>M</m:mi>
                    <m:mo>)</m:mo>
                  </m:mrow>
                  <m:mi>k</m:mi>
                  <m:mo>/</m:mo>
                  <m:mi>N</m:mi>
                  <m:mo>)</m:mo>
                </m:mrow>
                <m:mo>]</m:mo>
              </m:mrow>
            </m:mrow>
          </m:math>
        </equation>
        <para id="id2257179">which is of the same form as (<cnxn target="uid11"/>), except that the upper limit
on the summation recognizes <m:math overflow="scroll"><m:mi>N</m:mi></m:math> as even and
<m:math overflow="scroll"><m:msub><m:mi>A</m:mi><m:mrow><m:mi>N</m:mi><m:mo>/</m:mo><m:mn>2</m:mn></m:mrow></m:msub></m:math> equals zero.</para>
      </section>
      <section id="uid15">
        <name>Even Sampling</name>
        <para id="id2257226">The schemes just described use frequency samples at</para>
        <equation id="uid16">
          <m:math mode="display" overflow="scroll">
            <m:mrow>
              <m:mi>ω</m:mi>
              <m:mspace width="0.166667em"/>
              <m:mo>=</m:mo>
              <m:mspace width="0.166667em"/>
              <m:mn>2</m:mn>
              <m:mi>π</m:mi>
              <m:mi>k</m:mi>
              <m:mo>/</m:mo>
              <m:mi>N</m:mi>
              <m:mo>,</m:mo>
              <m:mspace width="4pt"/>
              <m:mspace width="4pt"/>
              <m:mspace width="4pt"/>
              <m:mspace width="4pt"/>
              <m:mspace width="4pt"/>
              <m:mspace width="4.pt"/>
              <m:mrow>
                <m:mi>k</m:mi>
                <m:mo>=</m:mo>
                <m:mn>0</m:mn>
                <m:mo>,</m:mo>
                <m:mn>1</m:mn>
                <m:mo>,</m:mo>
                <m:mn>2</m:mn>
                <m:mo>,</m:mo>
                <m:mo>.</m:mo>
                <m:mo>.</m:mo>
                <m:mo>.</m:mo>
                <m:mo>,</m:mo>
                <m:mi>N</m:mi>
                <m:mo>-</m:mo>
                <m:mn>1</m:mn>
              </m:mrow>
            </m:mrow>
          </m:math>
        </equation>
        <para id="id2257317">which are <m:math overflow="scroll"><m:mi>N</m:mi></m:math> equally-spaced samples starting at <m:math overflow="scroll"><m:mrow><m:mi>ω</m:mi><m:mo>=</m:mo><m:mn>0</m:mn></m:mrow></m:math>. Another
possible pattern for frequency sampling that allows design
formulas has no sample at <m:math overflow="scroll"><m:mrow><m:mi>ω</m:mi><m:mo>=</m:mo><m:mn>0</m:mn></m:mrow></m:math>, but uses <m:math overflow="scroll"><m:mi>N</m:mi></m:math> equally-spaced
samples located at</para>
        <equation id="uid17">
          <m:math mode="display" overflow="scroll">
            <m:mrow>
              <m:mi>ω</m:mi>
              <m:mspace width="0.166667em"/>
              <m:mo>=</m:mo>
              <m:mspace width="0.166667em"/>
              <m:mo>(</m:mo>
              <m:mn>2</m:mn>
              <m:mi>k</m:mi>
              <m:mo>+</m:mo>
              <m:mn>1</m:mn>
              <m:mo>)</m:mo>
              <m:mi>π</m:mi>
              <m:mo>/</m:mo>
              <m:mi>N</m:mi>
              <m:mo>,</m:mo>
              <m:mspace width="4pt"/>
              <m:mspace width="4pt"/>
              <m:mspace width="4pt"/>
              <m:mspace width="4pt"/>
              <m:mspace width="4pt"/>
              <m:mspace width="4.pt"/>
              <m:mrow>
                <m:mi>k</m:mi>
                <m:mo>=</m:mo>
                <m:mn>0</m:mn>
                <m:mo>,</m:mo>
                <m:mn>1</m:mn>
                <m:mo>,</m:mo>
                <m:mn>2</m:mn>
                <m:mo>,</m:mo>
                <m:mo>.</m:mo>
                <m:mo>.</m:mo>
                <m:mo>.</m:mo>
                <m:mo>,</m:mo>
                <m:mi>N</m:mi>
                <m:mo>-</m:mo>
                <m:mn>1</m:mn>
              </m:mrow>
            </m:mrow>
          </m:math>
        </equation>
        <para id="id2257465">This form of frequency sampling is more difficult to relate to
the DFT than the sampling of (<cnxn target="uid16"/>), but it can be done by
stretching <m:math overflow="scroll"><m:msub><m:mi>A</m:mi><m:mi>k</m:mi></m:msub></m:math> and taking a 2N-length DFT <cnxn target="bid0"/>.</para>
      </section>
      <section id="uid18">
        <name>Type 1. Even Sampling</name>
        <para id="id2257504">The two cases for odd and even lengths and the two for
samples at zero and not at zero frequency give a total of four
cases for the frequency-sampling design method applied to linear-
phase FIR filters of Types 1 and 2, as defined in <cnxn target=""/>.
For the case of an odd length and no zero sample, the analysis
and design formulas are derived in a way analogous to (<cnxn target="uid8"/>) and
(<cnxn target="uid14"/>) to give</para>
        <equation id="uid19">
          <m:math mode="display" overflow="scroll">
            <m:mrow>
              <m:msub>
                <m:mi>A</m:mi>
                <m:mi>k</m:mi>
              </m:msub>
              <m:mspace width="0.166667em"/>
              <m:mo>=</m:mo>
              <m:mspace width="0.166667em"/>
              <m:munderover>
                <m:mo>∑</m:mo>
                <m:mrow>
                  <m:mi>n</m:mi>
                  <m:mo>=</m:mo>
                  <m:mn>0</m:mn>
                </m:mrow>
                <m:mrow>
                  <m:mi>M</m:mi>
                  <m:mo>-</m:mo>
                  <m:mn>1</m:mn>
                </m:mrow>
              </m:munderover>
              <m:mn>2</m:mn>
              <m:mi>h</m:mi>
              <m:mrow>
                <m:mo>(</m:mo>
                <m:mi>n</m:mi>
                <m:mo>)</m:mo>
              </m:mrow>
              <m:mo form="prefix">cos</m:mo>
              <m:mrow>
                <m:mo>(</m:mo>
                <m:mn>2</m:mn>
                <m:mi>π</m:mi>
                <m:mrow>
                  <m:mo>(</m:mo>
                  <m:mi>M</m:mi>
                  <m:mo>-</m:mo>
                  <m:mi>n</m:mi>
                  <m:mo>)</m:mo>
                </m:mrow>
                <m:mrow>
                  <m:mo>(</m:mo>
                  <m:mi>k</m:mi>
                  <m:mo>+</m:mo>
                  <m:mn>1</m:mn>
                  <m:mo>/</m:mo>
                  <m:mn>2</m:mn>
                  <m:mo>)</m:mo>
                </m:mrow>
                <m:mo>/</m:mo>
                <m:mi>N</m:mi>
                <m:mo>)</m:mo>
              </m:mrow>
              <m:mo>+</m:mo>
              <m:mi>h</m:mi>
              <m:mrow>
                <m:mo>(</m:mo>
                <m:mi>M</m:mi>
                <m:mo>)</m:mo>
              </m:mrow>
            </m:mrow>
          </m:math>
        </equation>
        <para id="id2257646">The design formula becomes</para>
        <equation id="uid20">
          <m:math mode="display" overflow="scroll">
            <m:mrow>
              <m:mi>h</m:mi>
              <m:mrow>
                <m:mo>(</m:mo>
                <m:mi>n</m:mi>
                <m:mo>)</m:mo>
              </m:mrow>
              <m:mspace width="0.166667em"/>
              <m:mo>=</m:mo>
              <m:mspace width="0.166667em"/>
              <m:mfrac>
                <m:mn>1</m:mn>
                <m:mi>N</m:mi>
              </m:mfrac>
              <m:mrow>
                <m:mo>[</m:mo>
                <m:munderover>
                  <m:mo>∑</m:mo>
                  <m:mrow>
                    <m:mi>k</m:mi>
                    <m:mo>=</m:mo>
                    <m:mn>0</m:mn>
                  </m:mrow>
                  <m:mrow>
                    <m:mi>M</m:mi>
                    <m:mo>-</m:mo>
                    <m:mn>1</m:mn>
                  </m:mrow>
                </m:munderover>
                <m:mn>2</m:mn>
                <m:msub>
                  <m:mi>A</m:mi>
                  <m:mi>k</m:mi>
                </m:msub>
                <m:mo form="prefix">cos</m:mo>
                <m:mrow>
                  <m:mo>(</m:mo>
                  <m:mn>2</m:mn>
                  <m:mi>π</m:mi>
                  <m:mrow>
                    <m:mo>(</m:mo>
                    <m:mi>n</m:mi>
                    <m:mo>-</m:mo>
                    <m:mi>M</m:mi>
                    <m:mo>)</m:mo>
                  </m:mrow>
                  <m:mrow>
                    <m:mo>(</m:mo>
                    <m:mi>k</m:mi>
                    <m:mo>+</m:mo>
                    <m:mn>1</m:mn>
                    <m:mo>/</m:mo>
                    <m:mn>2</m:mn>
                    <m:mo>)</m:mo>
                  </m:mrow>
                  <m:mo>/</m:mo>
                  <m:mi>N</m:mi>
                  <m:mo>)</m:mo>
                </m:mrow>
                <m:mo>+</m:mo>
                <m:msub>
                  <m:mi>A</m:mi>
                  <m:mi>M</m:mi>
                </m:msub>
                <m:mo form="prefix">cos</m:mo>
                <m:mi>π</m:mi>
                <m:mrow>
                  <m:mo>(</m:mo>
                  <m:mi>n</m:mi>
                  <m:mo>-</m:mo>
                  <m:mi>M</m:mi>
                  <m:mo>)</m:mo>
                </m:mrow>
                <m:mo>]</m:mo>
              </m:mrow>
            </m:mrow>
          </m:math>
        </equation>
      </section>
      <section id="uid21">
        <name>Type 2. Even Sampling</name>
        <para id="id2257807">The fourth case, for an even length and no zero frequency
sample, gives the analysis formula</para>
        <equation id="uid22">
          <m:math mode="display" overflow="scroll">
            <m:mrow>
              <m:msub>
                <m:mi>A</m:mi>
                <m:mi>k</m:mi>
              </m:msub>
              <m:mspace width="0.166667em"/>
              <m:mo>=</m:mo>
              <m:mspace width="0.166667em"/>
              <m:munderover>
                <m:mo>∑</m:mo>
                <m:mrow>
                  <m:mi>n</m:mi>
                  <m:mo>=</m:mo>
                  <m:mn>0</m:mn>
                </m:mrow>
                <m:mrow>
                  <m:mi>N</m:mi>
                  <m:mo>/</m:mo>
                  <m:mn>2</m:mn>
                  <m:mo>-</m:mo>
                  <m:mn>1</m:mn>
                </m:mrow>
              </m:munderover>
              <m:mn>2</m:mn>
              <m:mi>h</m:mi>
              <m:mrow>
                <m:mo>(</m:mo>
                <m:mi>n</m:mi>
                <m:mo>)</m:mo>
              </m:mrow>
              <m:mo form="prefix">cos</m:mo>
              <m:mrow>
                <m:mo>(</m:mo>
                <m:mn>2</m:mn>
                <m:mi>π</m:mi>
                <m:mrow>
                  <m:mo>(</m:mo>
                  <m:mi>M</m:mi>
                  <m:mo>-</m:mo>
                  <m:mi>n</m:mi>
                  <m:mo>)</m:mo>
                </m:mrow>
                <m:mrow>
                  <m:mo>(</m:mo>
                  <m:mi>k</m:mi>
                  <m:mo>+</m:mo>
                  <m:mn>1</m:mn>
                  <m:mo>/</m:mo>
                  <m:mn>2</m:mn>
                  <m:mo>)</m:mo>
                </m:mrow>
                <m:mo>/</m:mo>
                <m:mi>N</m:mi>
                <m:mo>)</m:mo>
              </m:mrow>
            </m:mrow>
          </m:math>
        </equation>
        <para id="id2257925">and the design formula</para>
        <equation id="uid23">
          <m:math mode="display" overflow="scroll">
            <m:mrow>
              <m:mi>h</m:mi>
              <m:mrow>
                <m:mo>(</m:mo>
                <m:mi>n</m:mi>
                <m:mo>)</m:mo>
              </m:mrow>
              <m:mspace width="0.166667em"/>
              <m:mo>=</m:mo>
              <m:mspace width="0.166667em"/>
              <m:mfrac>
                <m:mn>1</m:mn>
                <m:mi>N</m:mi>
              </m:mfrac>
              <m:mrow>
                <m:mo>[</m:mo>
                <m:munderover>
                  <m:mo>∑</m:mo>
                  <m:mrow>
                    <m:mi>k</m:mi>
                    <m:mo>=</m:mo>
                    <m:mn>0</m:mn>
                  </m:mrow>
                  <m:mrow>
                    <m:mi>N</m:mi>
                    <m:mo>/</m:mo>
                    <m:mn>2</m:mn>
                    <m:mo>-</m:mo>
                    <m:mn>1</m:mn>
                  </m:mrow>
                </m:munderover>
                <m:mn>2</m:mn>
                <m:msub>
                  <m:mi>A</m:mi>
                  <m:mi>k</m:mi>
                </m:msub>
                <m:mo form="prefix">cos</m:mo>
                <m:mrow>
                  <m:mo>(</m:mo>
                  <m:mn>2</m:mn>
                  <m:mi>π</m:mi>
                  <m:mrow>
                    <m:mo>(</m:mo>
                    <m:mi>n</m:mi>
                    <m:mo>-</m:mo>
                    <m:mi>M</m:mi>
                    <m:mo>)</m:mo>
                  </m:mrow>
                  <m:mrow>
                    <m:mo>(</m:mo>
                    <m:mi>k</m:mi>
                    <m:mo>+</m:mo>
                    <m:mn>1</m:mn>
                    <m:mo>/</m:mo>
                    <m:mn>2</m:mn>
                    <m:mo>)</m:mo>
                  </m:mrow>
                  <m:mo>/</m:mo>
                  <m:mi>N</m:mi>
                  <m:mo>)</m:mo>
                </m:mrow>
                <m:mo>]</m:mo>
              </m:mrow>
            </m:mrow>
          </m:math>
        </equation>
        <para id="id2258056">These formulas in (<cnxn target="uid11"/>), (<cnxn target="uid14"/>), (<cnxn target="uid20"/>), and
(<cnxn target="uid23"/>) allow a very
straightforward design of the four frequency-sampling cases. They
and their analysis companions in (<cnxn target="uid8"/>), (<cnxn target="uid13"/>),
(<cnxn target="uid19"/>), and (<cnxn target="uid22"/>)
also are the four forms of discrete cosine and inverse-cosine
transforms. Matlab
 programs which implement these four designs
are given in the appendix.</para>
      </section>
      <section id="uid24">
        <name>Type 3. Odd Sampling</name>
        <para id="id2258114">The design of even-symmetric linear-phase FIR filters of Types 1 and 2 in
<cnxn target=""/> have been developed here. A similar development for the
odd-symmetric filters, Types 3 and 4, can easily be performed with the
results closely related to the discrete sine transform. The Type 3
analysis and design results using the frequency sampling scheme of
(<cnxn target="uid16"/>) are</para>
        <equation id="uid25">
          <m:math mode="display" overflow="scroll">
            <m:mrow>
              <m:msub>
                <m:mi>A</m:mi>
                <m:mi>k</m:mi>
              </m:msub>
              <m:mspace width="0.166667em"/>
              <m:mo>=</m:mo>
              <m:mspace width="0.166667em"/>
              <m:munderover>
                <m:mo>∑</m:mo>
                <m:mrow>
                  <m:mi>b</m:mi>
                  <m:mo>=</m:mo>
                  <m:mn>0</m:mn>
                </m:mrow>
                <m:mrow>
                  <m:mi>M</m:mi>
                  <m:mo>-</m:mo>
                  <m:mn>1</m:mn>
                </m:mrow>
              </m:munderover>
              <m:mn>2</m:mn>
              <m:mi>h</m:mi>
              <m:mrow>
                <m:mo>(</m:mo>
                <m:mi>n</m:mi>
                <m:mo>)</m:mo>
              </m:mrow>
              <m:mo form="prefix">sin</m:mo>
              <m:mrow>
                <m:mo>(</m:mo>
                <m:mn>2</m:mn>
                <m:mi>π</m:mi>
                <m:mrow>
                  <m:mo>(</m:mo>
                  <m:mi>M</m:mi>
                  <m:mo>-</m:mo>
                  <m:mi>n</m:mi>
                  <m:mo>)</m:mo>
                </m:mrow>
                <m:mi>k</m:mi>
                <m:mo>/</m:mo>
                <m:mi>N</m:mi>
                <m:mo>)</m:mo>
              </m:mrow>
            </m:mrow>
          </m:math>
        </equation>
        <para id="id2258231">and</para>
        <equation id="uid26">
          <m:math mode="display" overflow="scroll">
            <m:mrow>
              <m:mi>h</m:mi>
              <m:mrow>
                <m:mo>(</m:mo>
                <m:mi>n</m:mi>
                <m:mo>)</m:mo>
              </m:mrow>
              <m:mspace width="0.166667em"/>
              <m:mo>=</m:mo>
              <m:mspace width="0.166667em"/>
              <m:mfrac>
                <m:mn>1</m:mn>
                <m:mi>N</m:mi>
              </m:mfrac>
              <m:mrow>
                <m:mo>[</m:mo>
                <m:munderover>
                  <m:mo>∑</m:mo>
                  <m:mrow>
                    <m:mi>k</m:mi>
                    <m:mo>=</m:mo>
                    <m:mn>1</m:mn>
                  </m:mrow>
                  <m:mi>M</m:mi>
                </m:munderover>
                <m:mn>2</m:mn>
                <m:msub>
                  <m:mi>A</m:mi>
                  <m:mi>k</m:mi>
                </m:msub>
                <m:mo form="prefix">sin</m:mo>
                <m:mrow>
                  <m:mo>(</m:mo>
                  <m:mn>2</m:mn>
                  <m:mi>π</m:mi>
                  <m:mrow>
                    <m:mo>(</m:mo>
                    <m:mi>M</m:mi>
                    <m:mo>-</m:mo>
                    <m:mi>n</m:mi>
                    <m:mo>)</m:mo>
                  </m:mrow>
                  <m:mi>k</m:mi>
                  <m:mo>/</m:mo>
                  <m:mi>N</m:mi>
                  <m:mo>)</m:mo>
                </m:mrow>
                <m:mo>]</m:mo>
              </m:mrow>
            </m:mrow>
          </m:math>
        </equation>
      </section>
      <section id="uid27">
        <name>Type 4. Odd Sampling</name>
        <para id="id2258345">For Type 4 they are</para>
        <equation id="uid28">
          <m:math mode="display" overflow="scroll">
            <m:mrow>
              <m:msub>
                <m:mi>A</m:mi>
                <m:mi>k</m:mi>
              </m:msub>
              <m:mspace width="0.166667em"/>
              <m:mo>=</m:mo>
              <m:mspace width="0.166667em"/>
              <m:munderover>
                <m:mo>∑</m:mo>
                <m:mrow>
                  <m:mi>n</m:mi>
                  <m:mo>=</m:mo>
                  <m:mn>0</m:mn>
                </m:mrow>
                <m:mrow>
                  <m:mi>N</m:mi>
                  <m:mo>/</m:mo>
                  <m:mn>2</m:mn>
                  <m:mo>-</m:mo>
                  <m:mn>1</m:mn>
                </m:mrow>
              </m:munderover>
              <m:mn>2</m:mn>
              <m:mi>h</m:mi>
              <m:mrow>
                <m:mo>(</m:mo>
                <m:mi>n</m:mi>
                <m:mo>)</m:mo>
              </m:mrow>
              <m:mo form="prefix">sin</m:mo>
              <m:mrow>
                <m:mo>(</m:mo>
                <m:mn>2</m:mn>
                <m:mi>π</m:mi>
                <m:mrow>
                  <m:mo>(</m:mo>
                  <m:mi>M</m:mi>
                  <m:mo>-</m:mo>
                  <m:mi>n</m:mi>
                  <m:mo>)</m:mo>
                </m:mrow>
                <m:mi>k</m:mi>
                <m:mo>/</m:mo>
                <m:mi>N</m:mi>
                <m:mo>)</m:mo>
              </m:mrow>
            </m:mrow>
          </m:math>
        </equation>
        <para id="id2258447">and</para>
        <equation id="uid29">
          <m:math mode="display" overflow="scroll">
            <m:mrow>
              <m:mi>h</m:mi>
              <m:mrow>
                <m:mo>(</m:mo>
                <m:mi>n</m:mi>
                <m:mo>)</m:mo>
              </m:mrow>
              <m:mspace width="0.166667em"/>
              <m:mo>=</m:mo>
              <m:mspace width="0.166667em"/>
              <m:mfrac>
                <m:mn>1</m:mn>
                <m:mi>N</m:mi>
              </m:mfrac>
              <m:mrow>
                <m:mo>[</m:mo>
                <m:munderover>
                  <m:mo>∑</m:mo>
                  <m:mrow>
                    <m:mi>k</m:mi>
                    <m:mo>=</m:mo>
                    <m:mn>1</m:mn>
                  </m:mrow>
                  <m:mrow>
                    <m:mi>N</m:mi>
                    <m:mo>/</m:mo>
                    <m:mn>2</m:mn>
                    <m:mo>-</m:mo>
                    <m:mn>1</m:mn>
                  </m:mrow>
                </m:munderover>
                <m:mn>2</m:mn>
                <m:msub>
                  <m:mi>A</m:mi>
                  <m:mi>k</m:mi>
                </m:msub>
                <m:mo form="prefix">sin</m:mo>
                <m:mrow>
                  <m:mo>(</m:mo>
                  <m:mn>2</m:mn>
                  <m:mi>π</m:mi>
                  <m:mrow>
                    <m:mo>(</m:mo>
                    <m:mi>M</m:mi>
                    <m:mo>-</m:mo>
                    <m:mi>n</m:mi>
                    <m:mo>)</m:mo>
                  </m:mrow>
                  <m:mi>k</m:mi>
                  <m:mo>/</m:mo>
                  <m:mi>N</m:mi>
                  <m:mo>)</m:mo>
                </m:mrow>
                <m:mo>+</m:mo>
                <m:msub>
                  <m:mi>A</m:mi>
                  <m:mrow>
                    <m:mi>N</m:mi>
                    <m:mo>/</m:mo>
                    <m:mn>2</m:mn>
                  </m:mrow>
                </m:msub>
                <m:mo form="prefix">sin</m:mo>
                <m:mrow>
                  <m:mo>(</m:mo>
                  <m:mi>π</m:mi>
                  <m:mrow>
                    <m:mo>(</m:mo>
                    <m:mi>M</m:mi>
                    <m:mo>-</m:mo>
                    <m:mi>n</m:mi>
                    <m:mo>)</m:mo>
                  </m:mrow>
                  <m:mo>)</m:mo>
                </m:mrow>
                <m:mo>]</m:mo>
              </m:mrow>
              <m:mo>.</m:mo>
            </m:mrow>
          </m:math>
        </equation>
      </section>
      <section id="uid30">
        <name>Type 3. Even Sampling</name>
        <para id="id2258612">Using the frequency sampling scheme of (<cnxn target="uid17"/>), the Type 3 equations become</para>
        <equation id="uid31">
          <m:math mode="display" overflow="scroll">
            <m:mrow>
              <m:msub>
                <m:mi>A</m:mi>
                <m:mi>k</m:mi>
              </m:msub>
              <m:mspace width="0.166667em"/>
              <m:mo>=</m:mo>
              <m:mspace width="0.166667em"/>
              <m:munderover>
                <m:mo>∑</m:mo>
                <m:mrow>
                  <m:mi>n</m:mi>
                  <m:mo>=</m:mo>
                  <m:mn>0</m:mn>
                </m:mrow>
                <m:mrow>
                  <m:mi>M</m:mi>
                  <m:mo>-</m:mo>
                  <m:mn>1</m:mn>
                </m:mrow>
              </m:munderover>
              <m:mn>2</m:mn>
              <m:mi>h</m:mi>
              <m:mrow>
                <m:mo>(</m:mo>
                <m:mi>n</m:mi>
                <m:mo>)</m:mo>
              </m:mrow>
              <m:mo form="prefix">sin</m:mo>
              <m:mrow>
                <m:mo>(</m:mo>
                <m:mn>2</m:mn>
                <m:mi>π</m:mi>
                <m:mrow>
                  <m:mo>(</m:mo>
                  <m:mi>M</m:mi>
                  <m:mo>-</m:mo>
                  <m:mi>n</m:mi>
                  <m:mo>)</m:mo>
                </m:mrow>
                <m:mrow>
                  <m:mo>(</m:mo>
                  <m:mi>k</m:mi>
                  <m:mo>+</m:mo>
                  <m:mn>1</m:mn>
                  <m:mo>/</m:mo>
                  <m:mn>2</m:mn>
                  <m:mo>)</m:mo>
                </m:mrow>
                <m:mo>/</m:mo>
                <m:mi>N</m:mi>
                <m:mo>)</m:mo>
              </m:mrow>
            </m:mrow>
          </m:math>
        </equation>
        <para id="id2258730">and</para>
        <equation id="uid32">
          <m:math mode="display" overflow="scroll">
            <m:mrow>
              <m:mi>h</m:mi>
              <m:mrow>
                <m:mo>(</m:mo>
                <m:mi>n</m:mi>
                <m:mo>)</m:mo>
              </m:mrow>
              <m:mspace width="0.166667em"/>
              <m:mo>=</m:mo>
              <m:mspace width="0.166667em"/>
              <m:mfrac>
                <m:mn>1</m:mn>
                <m:mi>N</m:mi>
              </m:mfrac>
              <m:mrow>
                <m:mo>[</m:mo>
                <m:munderover>
                  <m:mo>∑</m:mo>
                  <m:mrow>
                    <m:mi>k</m:mi>
                    <m:mo>=</m:mo>
                    <m:mn>0</m:mn>
                  </m:mrow>
                  <m:mrow>
                    <m:mi>M</m:mi>
                    <m:mo>-</m:mo>
                    <m:mn>1</m:mn>
                  </m:mrow>
                </m:munderover>
                <m:mn>2</m:mn>
                <m:msub>
                  <m:mi>A</m:mi>
                  <m:mi>k</m:mi>
                </m:msub>
                <m:mo form="prefix">sin</m:mo>
                <m:mrow>
                  <m:mo>(</m:mo>
                  <m:mn>2</m:mn>
                  <m:mi>π</m:mi>
                  <m:mrow>
                    <m:mo>(</m:mo>
                    <m:mi>M</m:mi>
                    <m:mo>-</m:mo>
                    <m:mi>n</m:mi>
                    <m:mo>)</m:mo>
                  </m:mrow>
                  <m:mrow>
                    <m:mo>(</m:mo>
                    <m:mi>k</m:mi>
                    <m:mo>+</m:mo>
                    <m:mn>1</m:mn>
                    <m:mo>/</m:mo>
                    <m:mn>2</m:mn>
                    <m:mo>)</m:mo>
                  </m:mrow>
                  <m:mo>/</m:mo>
                  <m:mi>N</m:mi>
                  <m:mo>)</m:mo>
                </m:mrow>
                <m:mo>]</m:mo>
              </m:mrow>
            </m:mrow>
          </m:math>
        </equation>
      </section>
      <section id="uid33">
        <name>Type 4. Even Sampling</name>
        <para id="id2258863">For Type 4 they are</para>
        <equation id="uid34">
          <m:math mode="display" overflow="scroll">
            <m:mrow>
              <m:msub>
                <m:mi>A</m:mi>
                <m:mi>k</m:mi>
              </m:msub>
              <m:mspace width="0.166667em"/>
              <m:mo>=</m:mo>
              <m:mspace width="0.166667em"/>
              <m:munderover>
                <m:mo>∑</m:mo>
                <m:mrow>
                  <m:mi>n</m:mi>
                  <m:mo>=</m:mo>
                  <m:mn>0</m:mn>
                </m:mrow>
                <m:mrow>
                  <m:mi>N</m:mi>
                  <m:mo>/</m:mo>
                  <m:mn>2</m:mn>
                  <m:mo>-</m:mo>
                  <m:mn>1</m:mn>
                </m:mrow>
              </m:munderover>
              <m:mn>2</m:mn>
              <m:mi>h</m:mi>
              <m:mrow>
                <m:mo>(</m:mo>
                <m:mi>n</m:mi>
                <m:mo>)</m:mo>
              </m:mrow>
              <m:mo form="prefix">sin</m:mo>
              <m:mrow>
                <m:mo>(</m:mo>
                <m:mn>2</m:mn>
                <m:mi>π</m:mi>
                <m:mrow>
                  <m:mo>(</m:mo>
                  <m:mi>M</m:mi>
                  <m:mo>-</m:mo>
                  <m:mi>n</m:mi>
                  <m:mo>)</m:mo>
                </m:mrow>
                <m:mrow>
                  <m:mo>(</m:mo>
                  <m:mi>k</m:mi>
                  <m:mo>+</m:mo>
                  <m:mn>1</m:mn>
                  <m:mo>/</m:mo>
                  <m:mn>2</m:mn>
                  <m:mo>)</m:mo>
                </m:mrow>
                <m:mo>/</m:mo>
                <m:mi>N</m:mi>
                <m:mo>)</m:mo>
              </m:mrow>
            </m:mrow>
          </m:math>
        </equation>
        <para id="id2258979">and</para>
        <equation id="uid35">
          <m:math mode="display" overflow="scroll">
            <m:mrow>
              <m:mi>h</m:mi>
              <m:mrow>
                <m:mo>(</m:mo>
                <m:mi>n</m:mi>
                <m:mo>)</m:mo>
              </m:mrow>
              <m:mspace width="0.166667em"/>
              <m:mo>=</m:mo>
              <m:mspace width="0.166667em"/>
              <m:mfrac>
                <m:mn>1</m:mn>
                <m:mi>N</m:mi>
              </m:mfrac>
              <m:mrow>
                <m:mo>[</m:mo>
                <m:munderover>
                  <m:mo>∑</m:mo>
                  <m:mrow>
                    <m:mi>k</m:mi>
                    <m:mo>=</m:mo>
                    <m:mn>0</m:mn>
                  </m:mrow>
                  <m:mrow>
                    <m:mi>N</m:mi>
                    <m:mo>/</m:mo>
                    <m:mn>2</m:mn>
                    <m:mo>-</m:mo>
                    <m:mn>1</m:mn>
                  </m:mrow>
                </m:munderover>
                <m:mn>2</m:mn>
                <m:msub>
                  <m:mi>A</m:mi>
                  <m:mi>k</m:mi>
                </m:msub>
                <m:mo form="prefix">sin</m:mo>
                <m:mrow>
                  <m:mo>(</m:mo>
                  <m:mn>2</m:mn>
                  <m:mi>π</m:mi>
                  <m:mrow>
                    <m:mo>(</m:mo>
                    <m:mi>M</m:mi>
                    <m:mo>-</m:mo>
                    <m:mi>n</m:mi>
                    <m:mo>)</m:mo>
                  </m:mrow>
                  <m:mrow>
                    <m:mo>(</m:mo>
                    <m:mi>k</m:mi>
                    <m:mo>+</m:mo>
                    <m:mn>1</m:mn>
                    <m:mo>/</m:mo>
                    <m:mn>2</m:mn>
                    <m:mo>)</m:mo>
                  </m:mrow>
                  <m:mo>/</m:mo>
                  <m:mi>N</m:mi>
                  <m:mo>)</m:mo>
                </m:mrow>
                <m:mo>]</m:mo>
              </m:mrow>
              <m:mo>.</m:mo>
            </m:mrow>
          </m:math>
        </equation>
        <para id="id2259111">These Type 3 and 4 formulas are useful in the design of
differentiators and Hilbert transformers [1,2,9,31] directly and
as the base of the discrete least-squared-error methods in
<cnxn target=""/>.</para>
      </section>
    </section>
    <section id="uid36">
      <name>Frequency Sampling Design of FIR Filters by Solution of
Simultaneous Equations</name>
      <para id="id2259132">A direct way of designing FIR filters from samples of a desired amplitude
simply takes the sampled definition of the frequency response
(<cnxn target=""/>) as</para>
      <equation id="uid37">
        <m:math mode="display" overflow="scroll">
          <m:mrow>
            <m:mi>A</m:mi>
            <m:mrow>
              <m:mo>(</m:mo>
              <m:msub>
                <m:mi>ω</m:mi>
                <m:mi>k</m:mi>
              </m:msub>
              <m:mo>)</m:mo>
            </m:mrow>
            <m:mspace width="0.166667em"/>
            <m:mo>=</m:mo>
            <m:mspace width="0.166667em"/>
            <m:munderover>
              <m:mo>∑</m:mo>
              <m:mrow>
                <m:mi>n</m:mi>
                <m:mo>=</m:mo>
                <m:mn>0</m:mn>
              </m:mrow>
              <m:mrow>
                <m:mi>M</m:mi>
                <m:mo>-</m:mo>
                <m:mn>1</m:mn>
              </m:mrow>
            </m:munderover>
            <m:mn>2</m:mn>
            <m:mi>h</m:mi>
            <m:mrow>
              <m:mo>(</m:mo>
              <m:mi>n</m:mi>
              <m:mo>)</m:mo>
            </m:mrow>
            <m:mo form="prefix">cos</m:mo>
            <m:msub>
              <m:mi>ω</m:mi>
              <m:mi>k</m:mi>
            </m:msub>
            <m:mrow>
              <m:mo>(</m:mo>
              <m:mi>M</m:mi>
              <m:mo>-</m:mo>
              <m:mi>n</m:mi>
              <m:mo>)</m:mo>
            </m:mrow>
            <m:mo>+</m:mo>
            <m:mi>h</m:mi>
            <m:mrow>
              <m:mo>(</m:mo>
              <m:mi>M</m:mi>
              <m:mo>)</m:mo>
            </m:mrow>
          </m:mrow>
        </m:math>
      </equation>
      <para id="id2259245">or the reduced form from (<cnxn target=""/>) as</para>
      <equation id="uid38">
        <m:math mode="display" overflow="scroll">
          <m:mrow>
            <m:mi>A</m:mi>
            <m:mrow>
              <m:mo>(</m:mo>
              <m:msub>
                <m:mi>ω</m:mi>
                <m:mi>k</m:mi>
              </m:msub>
              <m:mo>)</m:mo>
            </m:mrow>
            <m:mspace width="0.166667em"/>
            <m:mo>=</m:mo>
            <m:mspace width="0.166667em"/>
            <m:munderover>
              <m:mo>∑</m:mo>
              <m:mrow>
                <m:mi>n</m:mi>
                <m:mo>=</m:mo>
                <m:mn>0</m:mn>
              </m:mrow>
              <m:mi>M</m:mi>
            </m:munderover>
            <m:mi>a</m:mi>
            <m:mrow>
              <m:mo>(</m:mo>
              <m:mi>n</m:mi>
              <m:mo>)</m:mo>
            </m:mrow>
            <m:mspace width="0.166667em"/>
            <m:mo form="prefix">cos</m:mo>
            <m:mrow>
              <m:mo>(</m:mo>
              <m:msub>
                <m:mi>ω</m:mi>
                <m:mi>k</m:mi>
              </m:msub>
              <m:mrow>
                <m:mo>(</m:mo>
                <m:mi>M</m:mi>
                <m:mo>-</m:mo>
                <m:mi>n</m:mi>
                <m:mo>)</m:mo>
              </m:mrow>
              <m:mo>)</m:mo>
            </m:mrow>
          </m:mrow>
        </m:math>
      </equation>
      <para id="id2259348">where
</para>
      <equation id="uid39"><m:math>
<m:mi>a</m:mi>
<m:mo>(</m:mo>
<m:mi>n</m:mi>
<m:mo>)</m:mo>
<m:mo>=</m:mo>
<m:mo>{</m:mo>
<m:munderover>
<m:mtext>h(M)</m:mtext>
<m:mrow>
<m:mn>0</m:mn>
</m:mrow>
<m:mrow>
<m:mi>2h(n)</m:mi>
</m:mrow>
</m:munderover>
<m:mspace width="5pt"/>
<m:munderover>
<m:mtext>for n = M</m:mtext>
<m:mrow>
<m:mtext>otherwise</m:mtext>
</m:mrow>
<m:mrow>
<m:mtext>for</m:mtext>
<m:reln><m:leq/>
<m:reln><m:leq/>
<m:mrow>
<m:mn>0</m:mn>
</m:mrow>

<m:mrow>
<m:mi>n</m:mi>
</m:mrow>

</m:reln>

<m:mrow>
<m:mi>M</m:mi>
<m:mo>-</m:mo>
<m:mn>1</m:mn>
</m:mrow>
</m:reln>
</m:mrow>
</m:munderover>
</m:math></equation>
      <para id="element-343">for <m:math><m:mi>k=0,1,2,...,M</m:mi></m:math> and solves the  <m:math><m:mi>M+1</m:mi></m:math> simultaneous equations for <m:math><m:mi>a(n)</m:mi></m:math> or equivalently, <m:math><m:mi>h(n)</m:mi></m:math>. Indeed, this approach can be taken with general non-linear phase design from</para><para id="id2259658">Indeed, this approach can be taken with general non-linear phase design from</para>
      <equation id="uid40">
        <m:math mode="display" overflow="scroll">
          <m:mrow>
            <m:mi>H</m:mi>
            <m:mrow>
              <m:mo>(</m:mo>
              <m:msub>
                <m:mi>ω</m:mi>
                <m:mi>k</m:mi>
              </m:msub>
              <m:mo>)</m:mo>
            </m:mrow>
            <m:mspace width="0.166667em"/>
            <m:mo>=</m:mo>
            <m:mspace width="0.166667em"/>
            <m:munderover>
              <m:mo>∑</m:mo>
              <m:mrow>
                <m:mi>n</m:mi>
                <m:mo>=</m:mo>
                <m:mn>0</m:mn>
              </m:mrow>
              <m:mrow>
                <m:mi>N</m:mi>
                <m:mo>-</m:mo>
                <m:mn>1</m:mn>
              </m:mrow>
            </m:munderover>
            <m:mi>h</m:mi>
            <m:mrow>
              <m:mo>(</m:mo>
              <m:mi>n</m:mi>
              <m:mo>)</m:mo>
            </m:mrow>
            <m:mspace width="0.166667em"/>
            <m:msup>
              <m:mi>e</m:mi>
              <m:mrow>
                <m:mi>j</m:mi>
                <m:msub>
                  <m:mi>ω</m:mi>
                  <m:mi>k</m:mi>
                </m:msub>
                <m:mi>n</m:mi>
              </m:mrow>
            </m:msup>
          </m:mrow>
        </m:math>
      </equation>
      <para id="id2259754">for <m:math overflow="scroll"><m:mrow><m:mi>k</m:mi><m:mo>=</m:mo><m:mn>0</m:mn><m:mo>,</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>⋯</m:mo><m:mo>,</m:mo><m:mi>N</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:math> which gives <m:math overflow="scroll"><m:mi>N</m:mi></m:math> equations with <m:math overflow="scroll"><m:mi>N</m:mi></m:math> unknowns.</para>
      <para id="id2259815">This design by solving simultaneous equations allows non-equally spaced
samples of the desired response. The disadvantage comes from the numerical
calculations taking considerable time and being subject to inaccuracies if
the equations are ill-conditioned.</para>
      <para id="id2259822">The frequency sampling design method is interesting but is seldom used
for direct design of filters. It is sometimes used as an interpolating
method in other design procedures to find <m:math overflow="scroll"><m:mrow><m:mi>h</m:mi><m:mo>(</m:mo><m:mi>n</m:mi><m:mo>)</m:mo></m:mrow></m:math> from calculated <m:math overflow="scroll"><m:mrow><m:mi>A</m:mi><m:mo>(</m:mo><m:msub><m:mi>ω</m:mi><m:mi>k</m:mi></m:msub><m:mo>)</m:mo></m:mrow></m:math>.
It is also used as a basis for a least squares design method discussed in
the next section.</para>
    </section>
    <section id="uid41">
      <name>Examples of Frequency Sampling FIR Filter Design</name>
      <para id="id2259877">To show some of the characteristics of FIR filters designed by frequency sampling,
we will design a Type 1., length-15 FIR low pass filter. Desired amplitude response
was one in the pass band and zero in the stop band. The cutoff frequency was set
at approximately <m:math overflow="scroll"><m:mrow><m:mi>f</m:mi><m:mo>=</m:mo><m:mn>0</m:mn><m:mo>.</m:mo><m:mn>35</m:mn></m:mrow></m:math> normalized. Using the formulas (<cnxn target="uid11"/>), (<cnxn target="uid14"/>), (<cnxn target="uid20"/>),
and (<cnxn target="uid23"/>), we got impulse responses <m:math overflow="scroll"><m:mrow><m:mi>h</m:mi><m:mo>(</m:mo><m:mi>n</m:mi><m:mo>)</m:mo></m:mrow></m:math>, which are use to generate the results
shown in Figures <cnxn target="uid42"/> and <cnxn target="uid43"/>.</para>
      <para id="id2259951">The Type 1, length-15 filter impulse response is:</para>
      <equation id="id2259955">
        <m:math mode="display" overflow="scroll">
          <m:mrow>
            <m:mi>h</m:mi>
            <m:mn>1</m:mn>
            <m:mo>=</m:mo>
            <m:mo>-</m:mo>
            <m:mn>0</m:mn>
            <m:mo>.</m:mo>
            <m:mn>5</m:mn>
            <m:mspace width="4pt"/>
            <m:mspace width="4pt"/>
            <m:mn>0</m:mn>
            <m:mspace width="4pt"/>
            <m:mspace width="4pt"/>
            <m:mn>1</m:mn>
            <m:mo>.</m:mo>
            <m:mn>1099</m:mn>
            <m:mspace width="4pt"/>
            <m:mspace width="4pt"/>
            <m:mn>0</m:mn>
            <m:mspace width="4pt"/>
            <m:mo>-</m:mo>
            <m:mn>1</m:mn>
            <m:mo>.</m:mo>
            <m:mn>6039</m:mn>
            <m:mspace width="4pt"/>
            <m:mspace width="4pt"/>
            <m:mn>0</m:mn>
            <m:mspace width="4pt"/>
            <m:mspace width="4pt"/>
            <m:mn>4</m:mn>
            <m:mo>.</m:mo>
            <m:mn>494</m:mn>
            <m:mspace width="4pt"/>
            <m:mspace width="4pt"/>
            <m:mn>7</m:mn>
            <m:mspace width="4pt"/>
            <m:mspace width="4pt"/>
            <m:mn>4</m:mn>
            <m:mo>.</m:mo>
            <m:mn>494</m:mn>
            <m:mspace width="4pt"/>
            <m:mspace width="4pt"/>
            <m:mn>0</m:mn>
            <m:mspace width="4pt"/>
            <m:mo>-</m:mo>
            <m:mn>1</m:mn>
            <m:mo>.</m:mo>
            <m:mn>6039</m:mn>
            <m:mspace width="4pt"/>
            <m:mspace width="4pt"/>
            <m:mn>0</m:mn>
            <m:mspace width="4pt"/>
            <m:mspace width="4pt"/>
            <m:mn>1</m:mn>
            <m:mo>.</m:mo>
            <m:mn>1099</m:mn>
            <m:mspace width="4pt"/>
            <m:mspace width="4pt"/>
            <m:mn>0</m:mn>
            <m:mspace width="4pt"/>
            <m:mo>-</m:mo>
            <m:mn>0</m:mn>
            <m:mo>.</m:mo>
            <m:mn>5</m:mn>
          </m:mrow>
        </m:math>
      </equation>
      <para id="id2260122"> The amplitude frequency response and zero locations
are shown in Fig <cnxn target="uid42"/>a</para>
      <figure id="uid42" orient="horizontal">
        <media type="application/postscript" src="fsFig1.eps">
          <media type="image/png" src="fsFig1.png"><!-- NOTE: width parameter changes size of image online (pixels). original width is 651. --><param name="width" value="651"/></media>
        </media>
        <caption>Frequency Responses and Zero Locations of Length-15 and 16
FIR Filters Designed by Frequency Sampling</caption>
      </figure>
      <para id="id2260150">We see a good lowpass filter frequency response with the actual amplitude
interpolating the desired values at 8 equally spaced points. Notice there
is considerable overshoot near the cutoff frequency. This is
characteristic of frequency sampling designs and is a sort of “Gibbs
phenomenon" but is even worse than that in a Fourier series expansion of a
discontinuity. This Gibbs phenomenon could be reduced by using unequally
spaced samples and designing by solving simultaneous equations. Imagine
sampling in the pass and stop bands of <cnxn target=""/>c but not in
the transitionband. The other responses and zero locations show the
results of different interpolation locations and lengths. Note the zero
at -1 for the even filters.</para>
      <para id="id2260177">Examples of longer filters and of highpass and bandpass frequency sampling
designs are shown in <cnxn target="uid43"/>. Note the difference of even and
odd distributions of samples with with or without an interpolation point
at zero frequency. Note the results of different ideal filters and Type 1
or 2. Also note the relationship of the amplitude response and zero
locations.</para>
      <figure id="uid43" orient="horizontal">
        <media type="application/postscript" src="fsFig2.eps">
          <media type="image/png" src="fsFig2.png"><!-- NOTE: width parameter changes size of image online (pixels). original width is 494. --><param name="width" value="494"/></media>
        </media>
        <caption>Frequency Response and Zero Locations of FIR Filters
Designed by Frequency Sampling</caption>
      </figure>
      
    </section>
  </content>
  <bib:file>
    <bib:entry id="bid0">
      <bib:book>
<!--required fields-->
        <bib:author>Parks, T. W. and Burrus, C. S.</bib:author>
        <bib:title>Digital Filter Design</bib:title>
        <bib:publisher>John Wiley &amp; Sons</bib:publisher>
        <bib:year>1987</bib:year>
<!--optional fields-->
        <bib:volume/>
        <bib:series/>
        <bib:address>New York</bib:address>
        <bib:edition/>
        <bib:month/>
        <bib:note/>
      </bib:book>
    </bib:entry>
    <bib:entry id="bid1">
      <bib:incollection>
<!--required fields-->
        <bib:author>Smith, L. M. and Bomar, B. W.</bib:author>
        <bib:title>Least Squares and Related Techniques</bib:title>
        <bib:booktitle>The Circuits and Filters Handbook</bib:booktitle>
        <bib:publisher>CRC Press and IEEE Press</bib:publisher>
        <bib:year>1995</bib:year>
<!--optional fields-->
        <bib:editor>Chen, Wai-Kai</bib:editor>
        <bib:number/>
        <bib:series/>
        <bib:type/>
        <bib:chapter>82.2</bib:chapter>
        <bib:pages>2562–2572</bib:pages>
        <bib:address>Boca Raton</bib:address>
        <bib:edition/>
        <bib:month/>
        <bib:note/>
      </bib:incollection>
    </bib:entry>
  </bib:file>
</document>
