// // main.c // NaiveFFT // // Created by Jacky Jack on 10/08/2021. // #include #include #include #include #include #include //data array #define DATA_SIZE (8) double data_i[DATA_SIZE] = {1.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f}; double data_q[DATA_SIZE] = {0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f}; //calc the fft void fft_if(double *x_i, double *x_q, int n, int inv) { int i=0,j=0,k=0,m=0, irem=0, sign; double tq,ti; printf("FFT\n"); k=n/2; for (j=1,i=1;i1) { irem = irem/2; m = m+1; } //FFT or IFFT if (inv==1) { sign = 1; } else { sign = -1; } // transform for (i=0; i