32 #define GR_M_PI 3.14159265358979323846
33 #define GR_M_SQRT2 1.41421356237309504880
47 o_r = (cc1.real() * cc2.real()) - (cc1.imag() * cc2.imag());
48 o_i = (cc1.real() * cc2.imag()) + (cc1.imag() * cc2.real());
54 static inline bool is_power_of_2(
long x) {
return x != 0 && (x & (x - 1)) == 0; }
79 return 0.5 * (std::abs(x +
clip) - std::abs(x -
clip));
103 unsigned int ret = 0;
104 if ((r >= 0) && (i >= 0))
106 else if ((r < 0) && (i >= 0))
108 else if ((r < 0) && (i < 0))
117 unsigned int ret = 0;
118 if (fabsf(r) > fabsf(i)) {
148 unsigned int ret = 0;
149 ret = (fabsf(r) > fabsf(i)) * (((r < 0) << 0x1));
150 ret |= (fabsf(i) > fabsf(r)) * (((i < 0) << 0x1) | 0x1);
163 ret |= ((i <= 0) << 1);
164 return (ret ^ ((ret & 0x2) >> 0x1));
177 static inline size_t p2_round_down(
size_t x,
size_t pow2) {
return x & -pow2; }
194 static inline size_t p2_modulo(
size_t x,
size_t pow2) {
return x & (pow2 - 1); }
#define GR_RUNTIME_API
Definition: gnuradio-runtime/include/gnuradio/api.h:18
std::complex< float > gr_complex
Definition: gr_complex.h:15
GR_RUNTIME_API float fast_atan2f(float y, float x)
Fast arc tangent using table lookup and linear interpolation.
GNU Radio logging wrapper.
Definition: basic_block.h:29
static unsigned int binary_slicer(float x)
Definition: math.h:93
static unsigned int branchless_quad_45deg_slicer(float r, float i)
Definition: math.h:160
static unsigned int quad_0deg_slicer(float r, float i)
Definition: math.h:115
static size_t p2_round_up(size_t x, size_t pow2)
Definition: math.h:184
static unsigned int quad_45deg_slicer(float r, float i)
Definition: math.h:101
static float clip(float x, float clip)
Definition: math.h:82
static size_t p2_round_down(size_t x, size_t pow2)
Definition: math.h:177
static void fast_cc_multiply(gr_complex &out, const gr_complex cc1, const gr_complex cc2)
Definition: math.h:39
static unsigned int branchless_quad_0deg_slicer(float r, float i)
Definition: math.h:146
static size_t p2_modulo_neg(size_t x, size_t pow2)
Definition: math.h:201
static float branchless_clip(float x, float clip)
Definition: math.h:77
static unsigned int branchless_binary_slicer(float x)
Definition: math.h:144
static bool is_power_of_2(long x)
Definition: math.h:54
static size_t p2_modulo(size_t x, size_t pow2)
Definition: math.h:194