| Contents | Index |
v = cordicrotate(theta,u)
v = cordicrotate(theta,u,niters)
v = cordicrotate(theta,u,Name,Value)
v = cordicrotate(theta,u,niters,Name,Value)
v = cordicrotate(theta,u) rotates the input u by theta using a CORDIC algorithm approximation. The function returns the result of u .* e^(j*theta).
v = cordicrotate(theta,u,niters) performs niters iterations of the algorithm.
v = cordicrotate(theta,u,Name,Value) scales the output depending on the Boolean value, b.
v = cordicrotate(theta,u,niters,Name,Value) specifies both the number of iterations and the Name,Value pair for whether to scale the output.
Optional comma-separated pairs of Name,Value arguments, where Name is the argument name and Value is the corresponding value. Name must appear inside single quotes ('').
CORDIC is an acronym for COordinate Rotation DIgital Computer. The Givens rotation-based CORDIC algorithm is among one of the most hardware-efficient algorithms available because it requires only iterative shift-add operations (see [1], [2]) 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, and hyperbolic, and logarithmic functions.
Increasing the number of CORDIC iterations can produce more accurate results, but doing so also increases the expense of the computation and adds latency.
Run the following code, and evaluate the accuracy of the CORDIC-based complex rotation.
wrdLn = 16;
theta = fi(-pi/3, 1, wrdLn);
u = fi(0.25 - 7.1i, 1, wrdLn);
uTeTh = double(u) .* exp(1i * double(theta));
fprintf('\n\nNITERS\tReal\t ERROR\t LSBs\t\tImag\t ERROR\t LSBs\n');
fprintf('------\t-------\t ------\t ----\t\t-------\t ------\t ----\n');
for niters = 1:(wrdLn - 1)
v_fi = cordicrotate(theta, u, niters);
v_dbl = double(v_fi);
x_err = abs(real(v_dbl) - real(uTeTh));
y_err = abs(imag(v_dbl) - imag(uTeTh));
fprintf(' %d\t%1.4f\t %1.4f\t %1.1f\t\t%1.4f\t %1.4f\t %1.1f\n', niters, real(v_dbl),x_err,(x_err * pow2(v_fi.FractionLength)), imag(v_dbl),y_err, (y_err * pow2(v_fi.FractionLength)));
end
fprintf('\n');
The output table appears as follows:
NITERS Real ERROR LSBs Imag ERROR LSBs ------ ------- ------ ---- ------- ------ ------ 1 -4.8438 1.1800 4833.5 -5.1973 1.4306 5859.8 2 -6.6567 0.6329 2592.5 -2.4824 1.2842 5260.2 3 -5.8560 0.1678 687.5 -4.0227 0.2560 1048.8 4 -6.3098 0.2860 1171.5 -3.2649 0.5018 2055.2 5 -6.0935 0.0697 285.5 -3.6528 0.1138 466.2 6 -5.9766 0.0472 193.5 -3.8413 0.0746 305.8 7 -6.0359 0.0121 49.5 -3.7476 0.0191 78.2 8 -6.0061 0.0177 72.5 -3.7947 0.0280 114.8 9 -6.0210 0.0028 11.5 -3.7710 0.0043 17.8 10 -6.0286 0.0048 19.5 -3.7590 0.0076 31.2 11 -6.0247 0.0009 3.5 -3.7651 0.0015 6.2 12 -6.0227 0.0011 4.5 -3.7683 0.0017 6.8 13 -6.0237 0.0001 0.5 -3.7666 0.0001 0.2 14 -6.0242 0.0004 1.5 -3.7656 0.0010 4.2 15 -6.0239 0.0001 0.5 -3.7661 0.0005 2.2
[1] Volder, J.E. "The CORDIC Trigonometric Computing Technique," IRE Transactions on Electronic Computers. Vol. EC-8, September 1959, pp. 330–334.
[2] Andraka, R. "A survey of CORDIC algorithm for FPGA based computers." Proceedings of the 1998 ACM/SIGDA sixth international symposium on Field programmable gate arrays. Feb. 22–24, 1998, pp. 191–200.

Learn how to apply early verification to your development process through these technical resources.
How much time do you spend on testing to ensure implementation meets system-level requirements?
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |