Write a MATLAB function that will calculate the discrete Fourier transform (DFT) using the formulas given in Slide 86 of Signal Characteristics:
Y = discreteFT(y, N)
Input: N = number of data points, y = N values of y
Output: Y = N values of the discrete Fourier transform of y
Write a driver to call your function using the following data:
y(t) = 10 sin(2Ï€t), 0 < t < 1
Δt = 0.125 s,
N = 8
Also, calculate the FFT for y using the MATLAB function fft. Note that the fft is a modified form of the DFT, so the data from discreteFT and fft should be the same.
Also, calculate and plot the one-sided power spectrum.
Submit a copy of your driver and function, a copy of the output of your DFT and MATLAB's FFT, and the plot of the one-sided power spectrum.