Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- coef* t_Fourier(int *amostras, int N)
- {
- coef *saida = (coef *)calloc(N, sizeof(coef));
- int n, k;
- for (n = 0;n < N; n++)
- {
- for (k = 0;k < N; k++)
- {
- saida[n].coef += amostras[k] * cexp( ( -2.0 * M_PI * (((n+1) * k * 1.0) / ( N * 1.0 ) ) ) * _Complex_I );
- }
- if ( n < 5 ) printf ("%lf %lf\n", __real__ saida[n].coef, __imag__ saida[n].coef );
- }
- return saida;
- }
- int *amostras;
- amostras = (int *)calloc(count, sizeof(int));
- rewind(input);
- while(fread(&amostras[i], sizeof(unsigned char), 1, input) > 0)
- {
- i++;
- }
- fclose(input);
Add Comment
Please, Sign In to add comment