#define _GNU_SOURCE #include #include #include #include #include #include #include #include #define TAILLE 512 double data[TAILLE]; int k=0; int cpt; gsl_fft_real_wavetable * real; gsl_fft_real_workspace * work; unsigned int freq = 0; /*Fonction effectuant la fft à partir du tableau de données data*/ void *fft(void *arg){ double copy[TAILLE], max; int i,j; while(1){ if(k==TAILLE){ for(i=0;imax){ max=copy[i]; j=i; } } freq =j*250/(2*TAILLE); printf("\nFréquence %d \n",freq); gsl_fft_real_wavetable_free (real); gsl_fft_real_workspace_free (work); } } (void) arg; } /*Lancement du thread gérant la fft int main (int argc, char *argv []){ pthread_t thread2; if (pthread_create(&thread2, NULL, fft, NULL)) { perror("pthread_create"); return EXIT_FAILURE; } if (pthread_join(thread2, NULL)) { perror("pthread_join"); return EXIT_FAILURE; } */