How does the Cordic algorithm work to calculate Sine and Cosine?

287 views

How does the Cordic algorithm work to calculate Sine and Cosine?

In: 18

6 Answers

Anonymous 0 Comments

It essentially uses “sum/difference of angles” formula, with precomputed values for some angles:

* sin(a±b) = sin(a)*cos(b) ± cos(a)*sin(b)
* cos(a±b) = cos(a)*cos(b) ∓ sin(a)*sin(b)

The algorithm uses a table of “b” angles, and then adds or subtracts them, until they hit the target angle X.

CORDIC uses several tricks to simplify a computation of the formula:

1. Sine and cosine of “b” are redefined in terms of Tan: sin(b) = tan(b)/√(1+tan^(2)(b)), cos(b) = 1/√(1+tan^(2)(b)). So there is only one table of tans, instead of two for sines and cosines.
2. The common factor 1/√(1+tan^(2)(b)) is pulled out.
3. The precomputed angles are picked in such a way, that tan(b) is a power of 2. That means, that multiplying by tan(b) is reduced to binary shift.
4. The algorithm always either adds angle “b”, or subtracts it. That means that factors 1/√(1+tan^(2)(b)) are multiplied on every step – so you can just precompute a resulting product, instead of multiplying them at runtime.

You are viewing 1 out of 6 answers, click here to view all answers.