CORDIC-based four quadrant inverse tangent
theta = cordicatan2(y,x)
theta = cordicatan2(y,x,niters)
theta = cordicatan2(y,x) computes the four
quadrant arctangent of
a CORDIC algorithm approximation.
theta = cordicatan2(y,x,niters) performs
of the algorithm.
Floating-point CORDIC arctangent calculation.
theta_cdat2_float = cordicatan2(0.5,-0.5) theta_cdat2_float = 2.3562
Fixed- point CORDIC arctangent calculation.
theta_cdat2_fixpt = cordicatan2(fi(0.5,1,16,15),fi(-0.5,1,16,15)); theta_cdat2_fixpt = 2.3562 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 16 FractionLength: 13
CORDIC is an acronym for COordinate Rotation DIgital Computer. The Givens rotation-based CORDIC algorithm is one of the most hardware-efficient algorithms available because it requires only iterative shift-add operations (see References). The CORDIC algorithm eliminates the need for explicit multipliers. Using CORDIC, you can calculate various functions such as sine, cosine, arc sine, arc cosine, arc tangent, and vector magnitude. You can also use this algorithm for divide, square root, hyperbolic, and logarithmic functions.
Increasing the number of CORDIC iterations can produce more accurate results, but doing so increases the expense of the computation and adds latency.
Signal Flow Diagrams
The accuracy of the CORDIC kernel depends on the choice of initial values for X, Y, and Z. This algorithm uses the following initial values:
fimath Propagation Rules
CORDIC functions discard any local
to the input.
The CORDIC functions use their own internal
The output has no attached
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Usage notes and limitations:
Variable-size signals are not supported.
The number of iterations the CORDIC algorithm performs,
niters, must be a constant.