35 inputBits_(inputBits),
36 outputBits_(outputBits),
49 scaleFactor *=
pow(1+
pow(2.,-2*
i), -0.5);
63 assert(fabs(angleFloat)<=
M_PI);
71 static_assert( ((
int) -1)>>3 == (
int) -1 ,
"Signed ints need to use arithmetic shifts for this algorithm to work properly!");
87 printf(
"x: % 8d y: % 8d phi: % 8d outphi: % 8d float phi = % f\n",
107 if (
debug_ ) printVals();
146 if (
debug_ ) printVals();
151 int sign = (y>=0) ? -1:1;
152 int xtmp = x - sign*(y>>
i);
153 int ytmp = y + sign*(x>>
i);
157 if (
debug_ ) printVals();
std::vector< int > rotations_
Abs< T >::type abs(const T &t)
CordicXilinx(int inputBits, int outputBits, bool debug=false)
void operator()(int32_t xInput, int32_t yInput, int32_t &aPhi, uint32_t &aMagnitude) const
int encodeAngle(const double angleFloat) const
std::array< int, 3 > encodedAngles_
Power< A, B >::type pow(const A &a, const B &b)