10 short FFT(
short int dir,
long m,
float *
x,
float *y) {
11 long n, i, i1, j,
k, i2, l, l1, l2;
12 float c1,
c2, tx, ty, t1, t2, u1, u2, z;
16 for (i = 0; i < m; i++) n *= 2;
21 for (i = 0; i < n - 1; i++) {
42 for (l = 0; l < m; l++) {
47 for (j = 0; j < l1; j++) {
48 for (i = j; i < n; i += l2) {
50 t1 = u1 * x[i1] - u2 * y[i1];
51 t2 = u1 * y[i1] + u2 * x[i1];
57 z = u1 * c1 - u2 *
c2;
58 u2 = u1 * c2 + u2 *
c1;
61 c2 = sqrtf((1.0 - c1) / 2.0);
62 if (dir == 1) c2 = -
c2;
63 c1 = sqrtf((1.0 + c1) / 2.0);
68 for (i = 0; i < n; i++) {
95 for (i = 0; i < 128; i++)
103 for (i = 1; i <= 10; i++)
105 x[i] = x[128-i] = 1.0;
108 for (i = 0; i < 128; i++)
110 printf (
"%d %e %e\n", i,
116 for (i = 0; i < 128; i++)
118 printf (
"%d %e %e\n", i,
static const uint32_t k[]
x
Return the smallest n such that 2^n >= _x.
short FFT(short int dir, long m, float *x, float *y)