\documentstyle[12pt]{article}
\setlength{\textwidth}{6.5in}
\setlength{\oddsidemargin}{-.1in}
\include{widpre}
\begin{document}
\begin{center}
{\LARGE\bf EE 341: Discrete Time Linear Systems}
\vspace {0.05in}
{\large{\bf Assignment 5: Using the FFT}}\\
\noindent Due Date: Friday, March 12, 1999
\end{center}
In this lab you will learn some of the more important
relationships between a sequence and its DFT. We will
concentrate on a few of the
relationships between operations in the time-domain and
corresponding frequency-domain operations.
\begin{enumerate}
\item{\bf DTFT vs. DFT}
In this problem you will observe the errors that are produced when
applying the DFT to infinite duration sequences. Let $h[n] = a^n u[n]$
with $a=0.75$. Its DTFT is:
$H(\Omega) = \frac{1}{1 - ae^{-j\Omega}}.$
Generate the 16-point DFT sequence H[k] by evaluating $H(\Omega)$
at the 16 appropriate frequency points. Form $h_{I16}
[n]$, the 16-point IDFT of
$H[k]$ and the error sequence, $e_{I16}[n] = h[n] - h_{I16}[n]$.
Repeat for $N=32$.
\underline{Turn in a plot of $h_{I16}[n]$ and $e_{I16}[n]$}
\underline{ on one page using subplot.
Repeat for $N=32$.
Describe the differences between}
\underline{ the inverse DFTs of the
16-point and 32-point cases.}
\item{\bf Performing Convolution with the DFT}
In many situations we want to perform the time domain operation
of convolution in the frequency domain.
If we multiply two DFTs,
this corresponds to {\it circular}
convolution in the time domain. We can still multiply two DFTs to do a linear
convolution in time if we choose the length of the DFT to be long enough.
We'll investigate this here.
Say we want to compute the linear convolution
$y[n] = h[n] * x[n]$
where $x[n] = h[n] = u[n] - u[n-7]$.
Let $N = 16$ where $N$ is the number of DFT points.
We are picking $N = 16$ since it is a power of two (so that Matlab uses
an FFT) and to avoid wrapping around in the circular
convolution of $x[n]$ and $h[n]$. Therefore $x[n]$ and $h[n]$ should each
have length 16.
\underline{Hand in plots of the following sequences for the case of 16
DFT points.}
Plot the results on the same page whenever possible, (i.e. use SUBPLOT).
\begin{enumerate}
\item The original time sequence x[n].
\item The magnitude spectrum of $X[k]$, the DFT of $x[n]$.
\item The magnitude spectrum of the product of the two DFT sequences $X[k]$
and $H[k]$.
\item The Inverse DFT sequence.
\item The actual $y[n]$ you would get if you did the direct
convolution $y[n] = x[n] \ast h[n]$.
\end{enumerate}
\underline{Lastly, explain what happens when you choose
the number of DFT points to be too}
\underline{small (Let $N = 8$ and repeat
steps (a) - (e) BUT DON'T HAND IN ANY PLOTS). }
\item{\bf Interpolation in the Frequency Domain}
If we have $N$ samples in time, we can only get $N$ DFT points.
It is possible to compute the DFT at a denser set of points in
frequency by
padding the time domain sequence with zeros.
Let
\[
x[n] = r^{n}cos(\Omega_{0}n) \ \ \mbox{for} \ 0 \leq n \leq 63
\]
with $r = 0.7$ and $\Omega_0 = 9\pi/64$. Compute the 64-point
DFT $X[k]$ and plot the 33-points of the magnitude spectrum corresponding to
the range $0 \leq \Omega \leq \pi$.
Generate the 128-point sequence $y[n]$ by padding $x[n]$ with zeros:
\[
y[n] = \left\{
\begin{array}{ll}
x[n] & \mbox{for} \ \ 0 \leq n \leq 63 \\
0 & \mbox{for} \ 64 \leq n \leq 127.
\end{array} \right.
\]
Compute the 128-point DFT $Y[k]$ and plot the 65 points of the magnitude
spectrum corresponding to $0 \leq \Omega \leq \pi$.
\underline{Compare the plots.
Print and hand in plots of the two} \underline{ magnitude spectra.}
\item{\bf Interpolation in the Time Domain}
If you want more samples in time,
time-domain interpolation can be achieved by zero-padding the frequency
domain function. Let $x[n] = cos(\pi n/16)$, for $0 \leq n \leq 31$.
\begin{enumerate}
\item Plot the sequence $x[n]$.
\item Compute the 32-point DFT of $x[n]$ and using the matlab
functions {\it real} and {\it imag}, plot the real and imaginary
sequences $X_{R}[k]$ and $X_{I}[k]$ for $0 \leq k \leq 31$.
\item Remembering that matlab indexes its vectors from
1 (not 0), pad the sequence $X[k]$
with 32 zeros to produce $Y[k]$.
The zero-padding is performed in the high frequencies as follows:
\[
Y[k] = \left\{
\begin{array}{ll}
X[k] & for \ \ 0 \leq k \leq 15 \\
0 & for \ 16 \leq k \leq 47 \\
X[k - 32] & for \ 48 \leq k \leq 63.
\end{array} \right.
\]
Plot $Y_{R}[k]$ and $Y_{I}[k]$, the real and imaginary
parts of $Y[k]$, respectively.
\item Compute $y[n]$, the 64-point IDFT of $Y[k]$.
Plot the real and imaginary
components of $y[n]$ \underline{Compare $y[n]$ with with $x[n]$.}
\underline{Print and hand in plots of
$x[n]$ and}
\underline{the real and imaginary parts of $y[n]$).}
\end{enumerate}
\end{enumerate}
\end{document}