43 #define GR_M_LOG2E 1.4426950408889634074 44 #define GR_M_PI 3.14159265358979323846 45 #define GR_M_PI_4 0.78539816339744830961566084582 46 #define GR_M_TWOPI (2 * GR_M_PI) 47 #define GR_M_SQRT2 1.41421356237309504880 52 static inline bool is_power_of_2(
long x) {
return x != 0 && (x & (x - 1)) == 0; }
77 float x1 = fabsf(x + clip);
78 float x2 = fabsf(x - clip);
104 unsigned int ret = 0;
105 if ((r >= 0) && (i >= 0))
107 else if ((r < 0) && (i >= 0))
109 else if ((r < 0) && (i < 0))
118 unsigned int ret = 0;
119 if (fabsf(r) > fabsf(i)) {
149 unsigned int ret = 0;
150 ret = (fabsf(r) > fabsf(i)) * (((r < 0) << 0x1));
151 ret |= (fabsf(i) > fabsf(r)) * (((i < 0) << 0x1) | 0x1);
164 ret |= ((i <= 0) << 1);
165 return (ret ^ ((ret & 0x2) >> 0x1));
178 static inline size_t p2_round_down(
size_t x,
size_t pow2) {
return x & -pow2; }
195 static inline size_t p2_modulo(
size_t x,
size_t pow2) {
return x & (pow2 - 1); }
static unsigned int branchless_quad_45deg_slicer(float r, float i)
Definition: math.h:161
static unsigned int quad_45deg_slicer(float r, float i)
Definition: math.h:102
static size_t p2_modulo_neg(size_t x, size_t pow2)
Definition: math.h:202
static size_t p2_round_down(size_t x, size_t pow2)
Definition: math.h:178
static unsigned int binary_slicer(float x)
Definition: math.h:94
static size_t p2_round_up(size_t x, size_t pow2)
Definition: math.h:185
#define GR_RUNTIME_API
Definition: gnuradio-runtime/include/gnuradio/api.h:30
static bool is_power_of_2(long x)
Definition: math.h:52
GR_RUNTIME_API float fast_atan2f(float y, float x)
Fast arc tangent using table lookup and linear interpolation.
std::complex< float > gr_complex
Definition: gr_complex.h:27
static size_t p2_modulo(size_t x, size_t pow2)
Definition: math.h:195
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition: basic_block.h:43
static float branchless_clip(float x, float clip)
Definition: math.h:75
static unsigned int branchless_quad_0deg_slicer(float r, float i)
Definition: math.h:147
static unsigned int quad_0deg_slicer(float r, float i)
Definition: math.h:116
static unsigned int branchless_binary_slicer(float x)
Definition: math.h:145
static float clip(float x, float clip)
Definition: math.h:83