CORDIC

from Wikipedia, the free encyclopedia

The CORDIC algorithm ( English co ordinate R otation Di gital C omputer ) is an efficient iterative algorithm , many with the aid of functions can be implemented such. B. trigonometric functions , exponential functions and logarithms as well as simple multiplication or division .

motivation

In computer technology, especially in digital signal processing , fast methods are required for the calculation of, for example, trigonometric functions . Conventional series developments such as B. the Taylor series often show only mediocre (i.e. slow, or even argument-dependent) convergence and poor numerical stability . A series expansion also consists mainly of a sum of products that are difficult to calculate.

historical development

The CORDIC algorithm was presented in 1959 by Jack E. Volder. So that in the original version it was possible trigonometric functions such as sine, cosine and tangent and the multiplication and division of numbers (Engl. Only by the easy to implement in digital circuits additions and shift operations shift-and-add operations ) to form. Shift operations to number base 2 can be implemented very easily in digital circuits through appropriate interconnection.

Volder's motivation was to replace the usual and error-prone analog navigation computers in Convair B-58 bombers with digital computers for precise position determination. The requirement was to calculate the position of the bombers flying at supersonic speed in real time over a surface of the earth assumed to be spherical.

In the mid-1960s, the CORDIC algorithm was also used in civil applications. Forerunner of today's calculators like the desktop computer 9100 by Hewlett-Packard from 1968 it put an to calculate the trigonometric functions.

It was not until 1971, however, that J. S. Walther's CORDIC algorithm was expanded to the form that is common today, making it possible to efficiently calculate logarithms , the exponential function and the square root in digital circuits.

Application examples

CORDIC digital circuit

CORDIC algorithms are used to calculate the most important elementary functions in microcontroller arithmetic units such as pocket calculators. The CORDIC algorithm for calculating mathematical operations can also be found in Intel x87 arithmetic coprocessors . Further application examples are in message transmission. This can be used to efficiently determine the amount and phase of a complex signal, for example.

Since multipliers are extensive and therefore expensive to implement, especially in digital circuits, CORDIC is often used precisely where multipliers are not efficiently available. This mainly includes the area of ​​digital circuit technologies such as FPGAs or ASICs .

While CORDIC is not the fastest algorithm, it is widely used because of its simplicity and versatility.

functionality

Illustration by CORDIC

CORDIC can be viewed in , but also only in the two-dimensional plane. In the following, the description covers the simpler, two-dimensional case.

If you rotate a coordinate system by the angle , the vector appears rotated by the angle ; its end point in the new system is at and .

The rotation around the angle corresponds to the matrix-vector product :

In other words, in order to get to the actual function value, the unit vector must be reversed. This can be done more easily if, within the transformation matrix, there is only a dependency on an angle function, e.g. B. consists of:

The rotation by is implemented in a tricky way as a linear combination of partial rotations by cleverly selected partial angles .

Too much rotation in the step is compensated for by changing the sign . The method shown converges and is numerically stable for all that can result from the above sum. An auxiliary variable is now introduced that is responsible for the sense of rotation:

If only the simplest components are to be used and therefore no multipliers are available, everything has to be done with shift and add operations. This is achieved through the approach

.

This gives the following algorithm:

with the scaling factor 0.60725 ... for which is calculated implicitly during the initialization phase .

initialization

A table of fixed length is created beforehand with , where is. The following values ​​are: with . (The values ​​of the arctangent can be determined with the power series expansion, which converges well here.)

The length of the table determines the accuracy that can be achieved. If you execute all rotations of a unit vector with the values ​​calculated in this way one after the other in the same direction of rotation, you achieve a total rotation of slightly more than . The scale factor is calculated with a call in vector mode (see below) by calculating the extension of the unit vector without scaling.

Rotation mode

The output vector is rotated in each of the steps so that the angle approaches zero. All partial rotations are always carried out, with a possibly changing sign . Since the cosine is an even function, the sign does not matter when scaling. After rescaling, the components of the final vector obtained are and . The convergence area results in , i.e. if it is large enough, approximately to , i.e. that is, it spans more than the fourth and first quadrants.

Vector mode

The specified vector, whose polar coordinates are searched for, is always rotated in such a way that the amount of its component is reduced. The angles of rotation are added with the correct sign. The component of the final vector is the output vector after rescaling of the amount. This mode is also used to calculate the arctangent from two arguments, start with . The convergence area is the same as above. The functions can be easily derived from and with the aid of .

Range outside of ± π / 2

The start vector or corresponds to a forward rotation of or (for the rotation mode ). In the case of a start vector with a negative component in vector mode, corresponding rotations are effected by exchanging the components and changing the signs.

generalization

The iteration formulas used above

are a special case of the more general rule

with and as well .

Linear modes

For , and you get

,

with which multiplication and division can be carried out. A table is not necessary here.

multiplication

, results in rotation mode ( towards 0) for all .

division

, results in vector mode ( towards 0) for all .

Hyperbolic modes

With the hyperbolic functions, their inversions (area functions ), exponential function and logarithm as well as the square root can be calculated. The unit circle or hyperbola are described by with or . The angle or area argument belonging to a vector is given by, that is

, Trigonometric functions (see above): and

, hyperbolic fct .:

, here ; ; and because of too .

The method is analogous to that shown at the beginning for the angle functions. All that is required is another table with , and the one-time calculation of the scale factor .

The iterations must always be repeated, since the hyperbolic areatangens does not meet the condition that would not converge for the series .

Rotation with returns: _ ,

derived from:

and

Vector mode with calculated:

and the hyperbolic amount

derived from:

such as

from the amount of the start vector

The convergence range is limited in both modes by the maximum possible change of . However, all mathematically permitted arguments can be mapped to it by simple adjustments and shift operations.

Alternatives

The main alternatives are fast table look-up methods, such as B. in DSPs , and bit algorithms that use a similar approach to CORDIC to perform the calculation.

literature

Web links