34 inputBits_(inputBits),
35 outputBits_(outputBits),
43 double scaleFactor = 1.;
48 scaleFactor *=
pow(1+
pow(2.,-2*
i), -0.5);
70 static_assert( ((
int) -1)>>3 == (
int) -1 ,
"Signed ints need to use arithmetic shifts for this algorithm to work properly!");
86 printf(
"x: % 8d y: % 8d phi: % 8d outphi: % 8d float phi = % f\n",
106 if (
debug_ ) printVals();
145 if (
debug_ ) printVals();
150 int sign = (y>=0) ? -1:1;
151 int xtmp = x - sign*(y>>
i);
152 int ytmp = y + sign*(x>>
i);
156 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)