#include "dft.h" #include #include #include /* X = real input, Y = imag. input A = real output, B = imag. output */ static double **GlobalA, **GlobalB, *X, *Y; static double Q; static int Size = 512; /* default */ /* performance counters */ unsigned int stat_add, stat_mult, stat_trig; int main(int argc, char **argv) { int c, i; extern char *optarg; extern int optind; int seed; char *names[] = {"DFTSimple", "DFTFaster", "DFTTable", "DFTTukey2", "DFTTukey2MultTable", "DFTTukey4", "DFTTukey4Mult"}; int sizes[] = {256, 1024, 4096, 16384}; int num_sizes = 4; while ((c = getopt(argc, argv, "r:s:")) != EOF) { switch (c) { case 's': sscanf(optarg, "%d", &Size); printf("Using size %d\n", Size); Q = M_PI * 2.0 /(double)Size; break; case 'r': sscanf(optarg, "%d", &seed); printf("Using seed %d\n", seed); srandom(seed); default: fprintf(stderr, "Invalid arguments.\n"); exit(1); } } for (i=0; i= Size) { k -= Size; stat_add++; } } A[i] = AT; B[i] = BT; } PrintCounters("DFTTable"); free(C); free(S); } void DFTTukey2(double *A, double *B) { int N2, k, j, i, N1, L, M; double C, S, Z, XT, YT, E; ClearCounters(); M = (int)log2(Size); N2 = Size; for (k=0; k