typedef float fftsample_t;
-#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
-
struct fft_complex {
fftsample_t re, im;
};
return split_radix_permutation(i, m, inverse) * 4 - 1;
}
-#define sqrthalf (float)M_SQRT1_2
+#define SQRTHALF (float)0.70710678118654752440 /* 1/sqrt(2) */
#define BF(x,y,a,b) {\
x = a - b;\
BF(z[6].re, z[2].re, z[2].re, t7);
BF(z[6].im, z[2].im, z[2].im, t8);
- TRANSFORM(z[1], z[3], z[5], z[7], sqrthalf, sqrthalf);
+ TRANSFORM(z[1], z[3], z[5], z[7], SQRTHALF, SQRTHALF);
}
static void fft16(struct fft_complex *z)
fft4(z + 12);
TRANSFORM_ZERO(z[0], z[4], z[8], z[12]);
- TRANSFORM(z[2], z[6], z[10], z[14], sqrthalf, sqrthalf);
+ TRANSFORM(z[2], z[6], z[10], z[14], SQRTHALF, SQRTHALF);
TRANSFORM(z[1], z[5], z[9], z[13], ff_cos_16[1], ff_cos_16[3]);
TRANSFORM(z[3], z[7], z[11], z[15], ff_cos_16[3], ff_cos_16[1]);
}
s->exptab = para_malloc((n / 2) * sizeof(struct fft_complex));
s->revtab = para_malloc(n * sizeof(uint16_t));
s->inverse = inverse;
-
for (j = 4; j <= nbits; j++) {
int k = 1 << j;
double freq = 2 * M_PI / k;