You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
miller-book/node171.html

547 lines
16 KiB

<!DOCTYPE html>
<!--Converted with LaTeX2HTML 2002-2-1 (1.71)
original version by: Nikos Drakos, CBLU, University of Leeds
* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<TITLE>Fourier analysis of non-periodic signals</TITLE>
<META NAME="description" CONTENT="Fourier analysis of non-periodic signals">
<META NAME="keywords" CONTENT="book">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META NAME="Generator" CONTENT="LaTeX2HTML v2002-2-1">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<LINK REL="STYLESHEET" HREF="book.css">
<LINK REL="next" HREF="node172.html">
<LINK REL="previous" HREF="node167.html">
<LINK REL="up" HREF="node163.html">
<LINK REL="next" HREF="node172.html">
</HEAD>
<BODY >
<!--Navigation Panel-->
<A ID="tex2html3130"
HREF="node172.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
SRC="next.png"></A>
<A ID="tex2html3124"
HREF="node163.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
SRC="up.png"></A>
<A ID="tex2html3118"
HREF="node170.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
SRC="prev.png"></A>
<A ID="tex2html3126"
HREF="node4.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
SRC="contents.png"></A>
<A ID="tex2html3128"
HREF="node201.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index"
SRC="index.png"></A>
<BR>
<B> Next:</B> <A ID="tex2html3131"
HREF="node172.html">Fourier analysis and reconstruction</A>
<B> Up:</B> <A ID="tex2html3125"
HREF="node163.html">Fourier analysis and resynthesis</A>
<B> Previous:</B> <A ID="tex2html3119"
HREF="node170.html">Fourier transform of a</A>
&nbsp; <B> <A ID="tex2html3127"
HREF="node4.html">Contents</A></B>
&nbsp; <B> <A ID="tex2html3129"
HREF="node201.html">Index</A></B>
<BR>
<BR>
<!--End of Navigation Panel-->
<H1><A ID="SECTION001330000000000000000">
Fourier analysis of non-periodic signals</A>
</H1>
<P>
Most signals aren't periodic, and even a periodic one might have an unknown
period. So we should be prepared to do Fourier analysis on signals without
making the comforting assumption that the signal to analyze repeats at a fixed
period <IMG
WIDTH="18" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img3.png"
ALT="$N$">. Of course, we can simply take <IMG
WIDTH="18" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img3.png"
ALT="$N$"> samples of the signal and
<I>make</I> it periodic; this is essentially what we did in the previous
section, in which a pure sinusoid gave us the complicated Fourier transform of
Figure <A HREF="node170.html#fig09.03">9.3</A> (part b).
<P>
However, it would be better to get a result in which the response to a pure
sinusoid were better localized around the corresponding value of <IMG
WIDTH="12" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img58.png"
ALT="$k$">. We
can accomplish this using the enveloping technique first introduced in Figure
<A HREF="node29.html#fig02.07">2.7</A> (Page <A HREF="node29.html#fig02.07"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]"
SRC="crossref.png"></A>). Applying this technique to Fourier
analysis will not only improve our analyses, but will also shed new light on
the enveloping looping sampler of Chapter 2.
<P>
Given a signal <IMG
WIDTH="36" HEIGHT="32" ALIGN="MIDDLE" BORDER="0"
SRC="img669.png"
ALT="$X[n]$">, periodic or not, defined on the points from
<IMG
WIDTH="11" HEIGHT="13" ALIGN="BOTTOM" BORDER="0"
SRC="img179.png"
ALT="$0$"> to <IMG
WIDTH="45" HEIGHT="30" ALIGN="MIDDLE" BORDER="0"
SRC="img171.png"
ALT="$N-1$">,
the technique is to envelope the signal before doing the Fourier analysis.
The envelope shape is known as a
<A ID="12499"></A><I>window function</I>.
Given a window function <IMG
WIDTH="33" HEIGHT="32" ALIGN="MIDDLE" BORDER="0"
SRC="img1123.png"
ALT="$w[n]$">, the
<A ID="12501"></A><I>windowed Fourier transform</I>
is:
<BR><P></P>
<DIV ALIGN="CENTER">
<!-- MATH
\begin{displaymath}
{\cal FT} \left \{ w[n] X[n] \right \} (k)
\end{displaymath}
-->
<IMG
WIDTH="130" HEIGHT="28" BORDER="0"
SRC="img1124.png"
ALT="\begin{displaymath}
{\cal FT} \left \{ w[n] X[n] \right \} (k)
\end{displaymath}">
</DIV>
<BR CLEAR="ALL">
<P></P>
Much ink has been spilled over the design of suitable window functions for
particular situations, but here we will consider the simplest one, named the
<A ID="12504"></A><A ID="12505"></A><I>Hann</I>
window function (the name is sometimes corrupted to "Hanning" in DSP circles).
The Hann window is:
<BR><P></P>
<DIV ALIGN="CENTER">
<!-- MATH
\begin{displaymath}
w[n] = {1\over 2} - {1\over 2} \cos(2\pi n / N)
\end{displaymath}
-->
<IMG
WIDTH="178" HEIGHT="38" BORDER="0"
SRC="img1125.png"
ALT="\begin{displaymath}
w[n] = {1\over 2} - {1\over 2} \cos(2\pi n / N)
\end{displaymath}">
</DIV>
<BR CLEAR="ALL">
<P></P>
It is easy to analyze the effect of multiplying a signal by the Hann window
before taking the Fourier transform, because the Hann window can be written
as a sum of three complex exponentials:
<BR><P></P>
<DIV ALIGN="CENTER">
<!-- MATH
\begin{displaymath}
w[n] = {1\over 2} - {1\over 4} {U^n} - {1\over 4} {U^{-n}}
\end{displaymath}
-->
<IMG
WIDTH="177" HEIGHT="38" BORDER="0"
SRC="img1126.png"
ALT="\begin{displaymath}
w[n] = {1\over 2} - {1\over 4} {U^n} - {1\over 4} {U^{-n}}
\end{displaymath}">
</DIV>
<BR CLEAR="ALL">
<P></P>
where as before, <IMG
WIDTH="16" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img1048.png"
ALT="$U$"> is the unit-magnitude complex number with argument
<IMG
WIDTH="42" HEIGHT="32" ALIGN="MIDDLE" BORDER="0"
SRC="img184.png"
ALT="$2\pi/N$">.
We can now calculate the windowed Fourier transform of a
sinusoid <IMG
WIDTH="24" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img653.png"
ALT="$Z^n$"> with angular frequency <IMG
WIDTH="13" HEIGHT="13" ALIGN="BOTTOM" BORDER="0"
SRC="img7.png"
ALT="$\alpha $"> as before. The phases
come out messy and we'll replace them with simplified approximations:
<BR><P></P>
<DIV ALIGN="CENTER">
<!-- MATH
\begin{displaymath}
{\cal FT} \left \{ w[n] {Z^n} \right \} (k)
\end{displaymath}
-->
<IMG
WIDTH="118" HEIGHT="28" BORDER="0"
SRC="img1127.png"
ALT="\begin{displaymath}
{\cal FT} \left \{ w[n] {Z^n} \right \} (k)
\end{displaymath}">
</DIV>
<BR CLEAR="ALL">
<P></P>
<BR><P></P>
<DIV ALIGN="CENTER">
<!-- MATH
\begin{displaymath}
= {\cal FT} \left \{ {1\over 2} {Z^n} - {1\over 4} {(UZ)^n}
- {1\over 4} {({U^{-1}}Z)^n}\right \} (k)
\end{displaymath}
-->
<IMG
WIDTH="294" HEIGHT="45" BORDER="0"
SRC="img1128.png"
ALT="\begin{displaymath}
= {\cal FT} \left \{ {1\over 2} {Z^n} - {1\over 4} {(UZ)^n}
- {1\over 4} {({U^{-1}}Z)^n}\right \} (k)
\end{displaymath}">
</DIV>
<BR CLEAR="ALL">
<P></P>
<BR><P></P>
<DIV ALIGN="CENTER">
<!-- MATH
\begin{displaymath}
\approx \left [ \cos(\Phi(k)) + i \sin(\Phi(k))\right ]
M(k - {{\alpha } \over {\omega}})
\end{displaymath}
-->
<IMG
WIDTH="257" HEIGHT="35" BORDER="0"
SRC="img1129.png"
ALT="\begin{displaymath}
\approx \left [ \cos(\Phi(k)) + i \sin(\Phi(k))\right ]
M(k - {{\alpha } \over {\omega}})
\end{displaymath}">
</DIV>
<BR CLEAR="ALL">
<P></P>
where the (approximate) phase term is:
<BR><P></P>
<DIV ALIGN="CENTER">
<!-- MATH
\begin{displaymath}
\Phi(k) = - \pi \cdot (k - {{\alpha } \over {\omega}})
\end{displaymath}
-->
<IMG
WIDTH="140" HEIGHT="35" BORDER="0"
SRC="img1130.png"
ALT="\begin{displaymath}
\Phi(k) = - \pi \cdot (k - {{\alpha } \over {\omega}})
\end{displaymath}">
</DIV>
<BR CLEAR="ALL">
<P></P>
and the magnitude function is:
<BR><P></P>
<DIV ALIGN="CENTER">
<!-- MATH
\begin{displaymath}
M(k) =
{\left [ {
{1\over 2}{D_N}(k)
+ {1\over 4}{D_N}(k + 1)
+ {1\over 4}{D_N}(k - 1)
} \right ] }
\end{displaymath}
-->
<IMG
WIDTH="340" HEIGHT="45" BORDER="0"
SRC="img1131.png"
ALT="\begin{displaymath}
M(k) =
{\left [ {
{1\over 2}{D_N}(k)
+ {1\over 4}{D_N}(k + 1)
+ {1\over 4}{D_N}(k - 1)
} \right ] }
\end{displaymath}">
</DIV>
<BR CLEAR="ALL">
<P></P>
The magnitude function <IMG
WIDTH="41" HEIGHT="32" ALIGN="MIDDLE" BORDER="0"
SRC="img1132.png"
ALT="$M(k)$"> is graphed in Figure <A HREF="#fig09.05">9.5</A>. The three
Dirichlet kernel components are also shown separately.
<P>
<DIV ALIGN="CENTER"><A ID="fig09.05"></A><A ID="12536"></A>
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 9.5:</STRONG>
The magnitude M(k) of the Fourier transform of the Hann
window function. It is the sum of three (shifted and magnified) copies of the Dirichlet
kernel <IMG
WIDTH="28" HEIGHT="30" ALIGN="MIDDLE" BORDER="0"
SRC="img62.png"
ALT="$D_N$">, with <IMG
WIDTH="63" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img63.png"
ALT="$N=100$">. </CAPTION>
<TR><TD><IMG
WIDTH="409" HEIGHT="207" BORDER="0"
SRC="img1133.png"
ALT="\begin{figure}\psfig{file=figs/fig09.05.ps}\end{figure}"></TD></TR>
</TABLE>
</DIV>
<P>
The main lobe of <IMG
WIDTH="41" HEIGHT="32" ALIGN="MIDDLE" BORDER="0"
SRC="img1132.png"
ALT="$M(k)$"> is four harmonics wide, twice the width of the
main lobe of the Dirichlet kernel. The sidelobes, on the other hand, have
much smaller magnitude. Each sidelobe of <IMG
WIDTH="41" HEIGHT="32" ALIGN="MIDDLE" BORDER="0"
SRC="img1132.png"
ALT="$M(k)$"> is a sum of three sidelobes
of <IMG
WIDTH="46" HEIGHT="32" ALIGN="MIDDLE" BORDER="0"
SRC="img1134.png"
ALT="${D_n}(k)$">, one attenuated by <IMG
WIDTH="27" HEIGHT="32" ALIGN="MIDDLE" BORDER="0"
SRC="img98.png"
ALT="$1/2$"> and the others, opposite in sign,
attenuated by <IMG
WIDTH="27" HEIGHT="32" ALIGN="MIDDLE" BORDER="0"
SRC="img1135.png"
ALT="$1/4$">. They do not cancel out perfectly but they do cancel out
fairly well.
<P>
The sidelobes reach their maximum amplitudes near their midpoints, and we
can estimate their amplitudes there, using the approximation:
<BR><P></P>
<DIV ALIGN="CENTER">
<!-- MATH
\begin{displaymath}
{D_N}(k) \approx {
{N \sin(\pi k) } \over {\pi k}
}
\end{displaymath}
-->
<IMG
WIDTH="138" HEIGHT="40" BORDER="0"
SRC="img1136.png"
ALT="\begin{displaymath}
{D_N}(k) \approx {
{N \sin(\pi k) } \over {\pi k}
}
\end{displaymath}">
</DIV>
<BR CLEAR="ALL">
<P></P>
Setting <!-- MATH
$k = 3/2, 5/2, \ldots$
-->
<IMG
WIDTH="113" HEIGHT="32" ALIGN="MIDDLE" BORDER="0"
SRC="img1137.png"
ALT="$k = 3/2, 5/2, \ldots$"> gives sidelobe amplitudes, relative to the
peak height <IMG
WIDTH="18" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img3.png"
ALT="$N$">, of:
<BR><P></P>
<DIV ALIGN="CENTER">
<!-- MATH
\begin{displaymath}
{2 \over {3 \pi}} \approx -13 \mathrm{dB} , \;
{2 \over {5 \pi}} \approx -18 \mathrm{dB} , \;
{2 \over {7 \pi}} \approx -21 \mathrm{dB} , \;
{2 \over {9 \pi}} \approx -23 \mathrm{dB} ,
\ldots
\end{displaymath}
-->
<IMG
WIDTH="420" HEIGHT="38" BORDER="0"
SRC="img1138.png"
ALT="\begin{displaymath}
{2 \over {3 \pi}} \approx -13 \mathrm{dB} , \;
{2 \over {5...
...{dB} , \;
{2 \over {9 \pi}} \approx -23 \mathrm{dB} ,
\ldots
\end{displaymath}">
</DIV>
<BR CLEAR="ALL">
<P></P>
The sidelobes drop off progressively more slowly so that the tenth one is only
attenuated about 30 dB and the 32nd one about -40 dB. On the
other hand, the Hann window sidelobes
are attenuated by:
<BR><P></P>
<DIV ALIGN="CENTER">
<!-- MATH
\begin{displaymath}
{2 \over {5 \pi}} - {1\over 2} [ {2 \over {3 \pi}} + {2 \over {7 \pi}} ]
\approx -32.30 \mathrm{dB}
\end{displaymath}
-->
<IMG
WIDTH="210" HEIGHT="38" BORDER="0"
SRC="img1139.png"
ALT="\begin{displaymath}
{2 \over {5 \pi}} - {1\over 2} [ {2 \over {3 \pi}} + {2 \over {7 \pi}} ]
\approx -32.30 \mathrm{dB}
\end{displaymath}">
</DIV>
<BR CLEAR="ALL">
<P></P>
and <IMG
WIDTH="31" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img1140.png"
ALT="$-42$">, <IMG
WIDTH="31" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img1141.png"
ALT="$-49$">, <IMG
WIDTH="31" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img1142.png"
ALT="$-54$">, and <IMG
WIDTH="31" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img1143.png"
ALT="$-59$"> dB for the next four sidelobes.
<P>
This shows that applying a Hann window before taking the Fourier transform
will better allow us to isolate sinusoidal
components. If a signal has many sinusoidal components, the sidelobes
engendered by each one will interfere with the main lobe of all the others.
Reducing the amplitude of the sidelobes reduces this interference.
<P>
<DIV ALIGN="CENTER"><A ID="fig09.06"></A><A ID="12558"></A>
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 9.6:</STRONG>
The Hann-windowed Fourier transform of a signal with two
sinusoidal components, at frequencies 5.3 and 10.6 times the fundamental,
and with different complex amplitudes.</CAPTION>
<TR><TD><IMG
WIDTH="482" HEIGHT="245" BORDER="0"
SRC="img1144.png"
ALT="\begin{figure}\psfig{file=figs/fig09.06.ps}\end{figure}"></TD></TR>
</TABLE>
</DIV>
<P>
Figure <A HREF="#fig09.06">9.6</A> shows a Hann-windowed Fourier analysis of a signal with
two sinusoidal components. The two are separated by about 5 times the
fundamental frequency <IMG
WIDTH="14" HEIGHT="13" ALIGN="BOTTOM" BORDER="0"
SRC="img27.png"
ALT="$\omega $">, and for each we see clearly the shape of the
Hann window's Fourier transform. Four points of the Fourier analysis lie
within the main lobe of <IMG
WIDTH="41" HEIGHT="32" ALIGN="MIDDLE" BORDER="0"
SRC="img1132.png"
ALT="$M(k)$"> corresponding to each sinusoid. The amplitude
and phase of the individual sinusoids are reflected in those of the
(four-point-wide) peaks. The four points within a peak which happen to fall at
integer values <IMG
WIDTH="12" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img58.png"
ALT="$k$"> are successively about one half cycle out of phase.
<P>
To fully resolve the partials of a signal, we should choose an analysis size
<IMG
WIDTH="18" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img3.png"
ALT="$N$"> large enough so that <IMG
WIDTH="74" HEIGHT="32" ALIGN="MIDDLE" BORDER="0"
SRC="img1047.png"
ALT="$\omega=2\pi/N$"> is no more than a quarter of the
frequency separation between neighboring partials. For a periodic signal, for
example, the partials are separated by the fundamental frequency. For the
analysis to fully resolve the partials, the analysis period <IMG
WIDTH="18" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img3.png"
ALT="$N$"> must be
at least four periods of the signal.
<P>
In some applications it works to allow the peaks to overlap as long as the
center of each peak is isolated from all the other peaks; in this case the
four-period rule may be relaxed to three or even slightly less.
<P>
<HR>
<!--Navigation Panel-->
<A ID="tex2html3130"
HREF="node172.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
SRC="next.png"></A>
<A ID="tex2html3124"
HREF="node163.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
SRC="up.png"></A>
<A ID="tex2html3118"
HREF="node170.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
SRC="prev.png"></A>
<A ID="tex2html3126"
HREF="node4.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
SRC="contents.png"></A>
<A ID="tex2html3128"
HREF="node201.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index"
SRC="index.png"></A>
<BR>
<B> Next:</B> <A ID="tex2html3131"
HREF="node172.html">Fourier analysis and reconstruction</A>
<B> Up:</B> <A ID="tex2html3125"
HREF="node163.html">Fourier analysis and resynthesis</A>
<B> Previous:</B> <A ID="tex2html3119"
HREF="node170.html">Fourier transform of a</A>
&nbsp; <B> <A ID="tex2html3127"
HREF="node4.html">Contents</A></B>
&nbsp; <B> <A ID="tex2html3129"
HREF="node201.html">Index</A></B>
<!--End of Navigation Panel-->
<ADDRESS>
Miller Puckette
2006-12-30
</ADDRESS>
</BODY>
</HTML>