Using CORDIC to Compute Transcendental Functions

Trigonometric and other transcendental functions are the mainstay of embedded DSP programs. Often times the required functionality is provided by a table of appropriate values. These tables can be computed via some utility code that the programmer creates for that purpose and included in the application code that he is developing, or they may be created during the application initiation at the application runtime.  Other times the various functions such as the arctangent and magnitude of a complex number must be computed in real time. The CORDIC approach is the ideal solution to that requirement.

J. E. Volder published a paper in 1959 that described the CORDIC approach to a special-purpose digital computer for real-time airborne navigation.

The CORDIC (COordinate, Rotation DIgital Computer) family of algorithms can be used compute sine, cosine, exponentials, logarithms, and associated transcendental functions as well as linear functions using one core routine. The CORDIC algorithms are easily implemented in fixed-point arithmetic using only shifts added and compare logic.  Any number base can be used, but very efficient algorithms can be developed using base two. These functions compute n bits of accuracy in n iterations. While it is possible to integrate these into a single integrated function, this approach separates the functions into different routines so that only the required code and tables occupy your code space.  The CORDIC functions are the forward and inverse of the trigonometric (circular), hyperbolic, and linear functions.

The internet provides substantial documentation and examples of various CORDIC implementations. Jarvis published a very good article in Dr. Dobbs' Journal. If you are interested in tutorial information, you should refer to http://www.ddj.com/184408428.

The Circular Functions (meant to imply that hyper etc are to come)

The forward and inverse circular function examples shown here are for 16-bit data and are targeted to the Texas Instruments C64x family of processors.  A Matlab script version is shown on the examples page.
A highly optimized interruptable  version is available that conforms to the CCS C-calling sequence.