#include #include #include FILE *fopen(), *fdata; void main() { #define pi 3.14159265358979323846 #define dB(x) ( ( (fabs(x)) > (0.0) ) ? (20.*log10(fabs(x))) : (-1000.) ) #define Q 8 float ar[Q], ai[Q]; /* array of points */ float freq_test, mag; int i; fdata = fopen("data", "w"); /* generate original signal */ freq_test = (float)Q/(float)4; for (i=0; i1){ if(TEMP%2 != 0){ printf("Error: N not a power of 2, stopping\n"); exit(0); } TEMP /=2; M ++; } printf("FFT with N = %d, M = log N = %d\n", N, M); if(verbose >= 2) { printf("input:\n"); printf("real: "); for (i=0; i= 2) { printf("shuffled input:\n"); printf("real: "); for (i=0; i=2) { printf("output:\n"); printf("real: "); for(i=0; i