// Josiah Boning // // project.c // Main techlab executable #include #include #include #include #include #define min(a,b) ((a)<(b))?(a):(b) #define max(a,b) ((a)>(b))?(a):(b) #define N 10000 #define ITEMS_PER_TRANS 1024 const double inf=1.0/0.0,ninf=-1.0/0.0; double xmin,ymin,xmax,ymax; double *datas; fftw_complex **trans; int numitems=0; int numtrans=0; int transsize=0; int win_wave, win_spec, win_allspec; double tmin, tmax; void display(void) { int k, n; /* do waveform window */ glutSetWindow(win_wave); glClear(GL_COLOR_BUFFER_BIT); glColor3f(1,1,1); glBegin(GL_LINES); glVertex3f(-1,0,0); glVertex3f(1,0,0); glVertex3f(0,-0.5,0); glVertex3f(0,0.5,0); glEnd(); glColor3f(0.0,0.0,1.0); glBegin(GL_LINE_STRIP); for (k=0;k tmax) { tmax = mag; } } } } int main(int argc,char* argv[]) { glutInit(&argc,argv); xmin=ymin=inf; xmax=ymax=ninf; if (argc < 2) { printf("You must specify a WAV file!\n"); exit(0); } readWav(argv[1]); doTransforms(); showGraph(); printf("here\n"); fftw_free(datas); fftw_free(trans); exit(0); }