4.1 Computing the DFT
1. We will now develop our own DFT functions to help our understanding of how the DFT comes from the DTFT. Write your own Matlab function X = DFTeqn(x) to implement the DFT of equation where x is an N point vector containing the values x [0], """, x [N - 1] and X is the corresponding DFT. Your routine should implement the DFT exactly as specified by the DFT equation X(k) = Σ_{n=0}^{N-1} x[n]e^{frac{-j2πkn}{N}}, using for-loops for n and k.
2. Test your routine DFTeqn by computing X(k) for each of the following cases:
a. x[n] = δ[n] for N = 10.
b. x[n] = 1 for N = 10.
c. x[n] = e^{frac{j2πn}{N}} for N = 10.
d. x[n] = cos(frac{2πn}{10}) for N = 10
Then, plot the magnitude of each of the DFT's.
3. Write a second Matlab function x = IDFTeqn(X) for computing the inverse DFT where X is the N point vector containing the DFT and x is the corresponding time-domain signal. Use the function IDFTeqn to invert each of the DFT's computed in the previous problem. Plot the magnitudes of the inverted DFT's, and verify that those time-domain signals match the