From 7bf1bcb9ee61963b827bd60185a48fdc867bc213 Mon Sep 17 00:00:00 2001 From: pbarfuss Date: Mon, 4 Jan 2016 19:16:15 -0500 Subject: [PATCH] Mostly fix this so it works on ARM --- dsd_4fsk.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dsd_4fsk.c b/dsd_4fsk.c index 07d88c5..d4e0436 100644 --- a/dsd_4fsk.c +++ b/dsd_4fsk.c @@ -275,7 +275,10 @@ static inline float fast_cosf(float x) { float ngain = 0.101333437f; float nxgain = 0.062659371644565f; -float dsd_gen_root_raised_cosine(float sampling_freq, float symbol_rate) +/* + * TODO: make it so we use alpha instead of ignoring it and always using alpha=0.2 + */ +float dsd_gen_root_raised_cosine(float sampling_freq, float symbol_rate, float alpha) { float bps = symbol_rate/sampling_freq; // symbols/samples per bit float scale = 0.0f; @@ -354,10 +357,13 @@ static inline float fast_atanf(float z) unsigned int index; if (z > 1.0f) { +#if defined(__amd64__) || defined(__x86_64__) || defined(__i386__) && defined(__SSE__) __asm__ volatile("rcpss %1, %0 \t\n" :"=x"(z) :"x"(z_in)); z *= (2.0f-z*z_in); - //z = 1.0f/z; +#else + z = 1.0f/z; +#endif } /* when ratio approaches the table resolution, the angle is */