From c0f911f1e9b9c704997e701f153f44f8cf5426a5 Mon Sep 17 00:00:00 2001 From: Ahmet Inan Date: Thu, 15 Jan 2015 16:23:03 +0100 Subject: [PATCH] fixed bug introduced with "replaced radix2 input with float" it really sucks not having a complex data type .. damn you c99 --- app/src/main/rs/radix2.rsh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/src/main/rs/radix2.rsh b/app/src/main/rs/radix2.rsh index f94176d..f926002 100644 --- a/app/src/main/rs/radix2.rsh +++ b/app/src/main/rs/radix2.rsh @@ -23,18 +23,18 @@ limitations under the License. static void radix2(complex_t *out, float *in, int N, int S, int L) { if (1 == N) { - out[0] = in[0]; + out[0] = complex(in[0], 0.0f); return; } else if (2 == N) { - out[0] = in[0] + in[S]; - out[1] = in[0] - in[S]; + out[0] = complex(in[0] + in[S], 0.0f); + out[1] = complex(in[0] - in[S], 0.0f); return; } else if (4 == N) { complex_t w = radix2_z[1 << L]; - out[0] = in[0] + in[S] + in[2 * S] + in[3 * S]; - out[1] = in[0] + w * in[S] - in[2 * S] - w * in[3 * S]; - out[2] = in[0] - in[S] + in[2 * S] - in[3 * S]; - out[3] = in[0] - w * in[S] - in[2 * S] + w * in[3 * S]; + out[0] = complex(in[0] + in[S] + in[2 * S] + in[3 * S], 0.0f); + out[1] = complex(in[0] - in[2 * S], 0.0f) + w * (in[S] - in[3 * S]); + out[2] = complex(in[0] - in[S] + in[2 * S] - in[3 * S], 0.0f); + out[3] = complex(in[0] - in[2 * S], 0.0f) + w * (in[3 * S] - in[S]); return; } radix2(out, in, N / 2, 2 * S, L + 1);