ENGR4620/6620: HOMEWORK 2 
The learning goal of this homework is to understand the representation of some selected signals in frequency space and to learn the significance of the Fourier coefficients. Also, the spreadsheet realization is a good visual way to appreciate how the discrete Fourier transform is computed.
Please use a spreadsheet program (e.g. LibreOffice/OpenOffice Spread or MS Excel) to compute a onedimensional discrete Fourier transform (DFT) with N=20 sample points (numbered k=0...19). One possible way to set up a DFT is to have k and f(k) in two leftmost columns. To the right, each summation for components r=0...19 is performed in a separate column. As a consequence, the DFT components reside in a row below the summation elements. This summation needs to be performed twice, once for the real component and once for the imaginary component. We are interested in the magnitude of the complex number. Here is the equation for the DFT:
$$ \begin{split} F_r &= \frac{1}{N} \sum_{k=0}^{N1} f_k \cdot e^{2 \pi j r k / N} \\ & = \frac{1}{N} \sum_{k=0}^{N1} f_k \cdot \cos \left(2 \pi \frac{r k}{N} \right) \\ & \quad + \frac{j}{N} \sum_{k=0}^{N1} f_k \cdot \sin \left( 2 \pi \frac{r k}{N} \right) \end{split} $$
(note: you need to have Javascript enabled for the equation to display correctly)
Create independent "computation engines" for the real and imaginary components, respectively. Note that both parts look very similar, except that the real part uses the cosine where the imaginary part uses the sine. Finally, combine both to obtain $F_r = \sqrt{\Re (F_r)^2+ \Im (F_r)^2}$. Plot both $f_k$ over $k$ and $F_r$ over $r$. You may alternatively plot $\Re(F_r)$ and $\Im(F_r)$ over $r$ if you wish to examine the odd and even parts separately.
Calibrate and possibly correct the computations using test signals: a constant signal of intensity one ($f_k = 1 \forall k$) should yield $F[r=0]=1$ and $F[r>0]=0$. A sine wave that extends over all 20 points should result in a peak at $F[r=1]$, but there should also be a peak at $F[r=19]$.
Hints:
This homework will give you a maximum of 20 points towards your total score, 8 points from item 1 and 4 points each from items 2  4.
Homework is due on 09212017 on eLC. Please note that eLC accepts only one comprehensive file (data and summary of observations).
Late turnin penalty: For each late day, you lose 1 point from your total score.
Early turnin bonus: If your homework is done before the due date, you may present your work for a brief evaluation. If I find significant errors, I will point those out and return the homework to you for revision. You may turn in a revised version by the due date.
