Question: please use Keil software to program and compile the following as instructed: /** * dft.c * N-point DFT of sequence read from lookup table *
please use Keil software to program and compile the following as instructed:

/** * dft.c * N-point DFT of sequence read from lookup table * Copyright 2016 ARM Ltd. */
#include #include "audio.h"
#define PI 3.14159265358979 #define N 100 #define TESTFREQ 800.0 #define SAMPLING_FREQ 8000.0
typedef struct { float real; float imag; } COMPLEX;
COMPLEX samples[N];
void dft(COMPLEX *x) { /* TODO: write the dft() function here. */ }
int main() { int n;
TestPinInit(TEST_PIN);
for(n = 0; n
TestPinOut(TEST_PIN, HIGH); dft(samples); //call DFT function TestPinOut(TEST_PIN, LOW);
while(1); }
Program dft.c illustrates the DFT of an N-point, real-valued sequence. Program dft.c will be used to calculate the complex DFT -r. (1) As supplied, the program does not implement DFT. You must program the function dft (). Program dft.c is written so that an N-point complex sequence is stored in array samples and a pointer to this array is passed to the function dft (). That function is required to replace the complex, time-domain sequence passed to it with its complex, frequency domain representation, i.e. its DFT. A structure, COMPLEX, intended for the representation of complex numbers in rectangular form is defined in the program. Hint:It is important that you test your function using complex as well as real-valued input data. Connect your FM4 Starter Kit to the host PC using a USB cable. Build the project by selecting Build target from the Project menu or by clicking on the Build toolbar button. Program dft.c illustrates the DFT of an N-point, real-valued sequence. Program dft.c will be used to calculate the complex DFT -r. (1) As supplied, the program does not implement DFT. You must program the function dft (). Program dft.c is written so that an N-point complex sequence is stored in array samples and a pointer to this array is passed to the function dft (). That function is required to replace the complex, time-domain sequence passed to it with its complex, frequency domain representation, i.e. its DFT. A structure, COMPLEX, intended for the representation of complex numbers in rectangular form is defined in the program. Hint:It is important that you test your function using complex as well as real-valued input data. Connect your FM4 Starter Kit to the host PC using a USB cable. Build the project by selecting Build target from the Project menu or by clicking on the Build toolbar button
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
