主要内容

cordicasin

基于 CORDIC 的反正弦逼近

说明

theta = cordicasin(x) 基于 CORDIC 逼近返回 x 的反正弦。

示例

theta = cordicasin(x, niters) 返回执行 niters 次 CORDIC 算法迭代的 x 的反正弦。

示例

示例

全部折叠

使用 CORDIC 实现计算定点 fi 对象的反正弦。

a = fi(-1:.1:1,1,16);
b = cordicasin(a);
plot(a, b);
title('Inverse CORDIC Sine');

Figure contains an axes object. The axes object with title Inverse CORDIC Sine contains an object of type line.

使用 CORDIC 实现查找 fi 对象的反正弦,并指定 CORDIC 核应执行的迭代次数。绘制具有不同迭代次数的反正弦的 CORDIC 逼近。

a = fi(-1:.1:1,1,16);
for i = 5:5:20
    b = cordicasin(a,i);
    plot(a,b);
    hold on;
end
legend('5 iterations','10 iterations',...
    '15 iterations','20 iterations')

Figure contains an axes object. The axes object contains 4 objects of type line. These objects represent 5 iterations, 10 iterations, 15 iterations, 20 iterations.

输入参数

全部折叠

数值输入,指定为标量、向量、矩阵或多维数组。

数据类型: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | fi
复数支持:

CORDIC 算法执行的迭代次数,指定为正整数值标量。如果您不指定 niters,算法将使用默认值:

  • 对于定点输入,niters 的默认值为输入数组 theta 的字长减一。

  • 对于双精度输入,niters 的默认值为 52。对于单精度输入,默认值为 23。

数据类型: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | fi

输出参量

全部折叠

以弧度为单位返回的反正弦角度值。

算法

全部折叠

参考

[1] Volder, Jack E. “The CORDIC Trigonometric Computing Technique.” IRE Transactions on Electronic Computers EC-8, no. 3 (Sept. 1959): 330–334.

[2] Andraka, Ray. “A Survey of CORDIC Algorithm for FPGA Based Computers.” In Proceedings of the 1998 ACM/SIGDA Sixth International Symposium on Field Programmable Gate Arrays, 191–200. https://dl.acm.org/doi/10.1145/275107.275139.

[3] Walther, J.S. “A Unified Algorithm for Elementary Functions.” In Proceedings of the May 18-20, 1971 Spring Joint Computer Conference, 379–386. https://dl.acm.org/doi/10.1145/1478786.1478840.

[4] Schelin, Charles W. “Calculator Function Approximation.” The American Mathematical Monthly, no. 5 (May 1983): 317–325. https://doi.org/10.2307/2975781.

扩展功能

全部展开

版本历史记录

在 R2018b 中推出