CORDIC-based polar-to-Cartesian近似转换
(x, y) = cordicpol2cart(θ,r)
(x, y) = cordicpol2cart(θ,r,硝石)
(x, y) = cordicpol2cart(θ,r,名称,值)
(x, y) = cordicpol2cart(θ,r,硝石、名称、值)
返回的笛卡尔xy坐标(x, y)
= cordicpol2cart (θ
,r
)r
* e ^ (j *θ
)使用CORDIC算法近似。
执行(x, y)
= cordicpol2cart (θ
,r
,硝酸钠
)硝酸钠
迭代算法的。
|
|
|
|
|
|
可选的逗号分隔条名称,值
参数,的名字
参数名称和吗价值
相应的价值。的名字
必须出现在单引号(”
)。
|
默认值:真正的 |
|
当输入 当输入 |
运行下面的代码,并评估的准确性CORDIC-based Polar-to-Cartesian转换。
wrdLn = 16;θ= fi(π/ 3,1 wrdLn);u = fi (2.0、1、wrdLn);流(' \ n \ nNITERS \ tX \ t \ t错误\ t lsb \ t \ tY \ \ t错误\ t lsb \ n”);流(' - - - - - - \ t t - - - - - - - - - - - - - \ \ t - - - - - \ \ t t - - - - - - - - - - - - - \ \ t - - - - - \ n”);硝石= 1:(wrdLn - 1) [x_ref y_ref] = pol2cart(双(θ),双(u));[x_fi, y_fi] = cordicpol2cart(θ,u,硝石);x_dbl =双(x_fi);y_dbl =双(y_fi);x_err = abs (x_dbl - x_ref); y_err = abs(y_dbl - y_ref); fprintf('%d\t%1.4f\t %1.4f\t %1.1f\t\t%1.4f\t %1.4f\t %1.1f\n',... niters,x_dbl,x_err,(x_err * pow2(x_fi.FractionLength)),... y_dbl,y_err,(y_err * pow2(y_fi.FractionLength))); end fprintf('\n'); NITERS X ERROR LSBs Y ERROR LSBs ------ ------- ------ ---- ------- ------ ---- 1 1.4142 0.4142 3392.8 1.4142 0.3178 2603.8 2 0.6324 0.3676 3011.2 1.8973 0.1653 1354.2 3 1.0737 0.0737 603.8 1.6873 0.0448 366.8 4 0.8561 0.1440 1179.2 1.8074 0.0753 617.2 5 0.9672 0.0329 269.2 1.7505 0.0185 151.2 6 1.0214 0.0213 174.8 1.7195 0.0126 102.8 7 0.9944 0.0056 46.2 1.7351 0.0031 25.2 8 1.0079 0.0079 64.8 1.7274 0.0046 37.8 9 1.0011 0.0011 8.8 1.7313 0.0007 5.8 10 0.9978 0.0022 18.2 1.7333 0.0012 10.2 11 0.9994 0.0006 5.2 1.7323 0.0003 2.2 12 1.0002 0.0002 1.8 1.7318 0.0002 1.8 13 0.9999 0.0002 1.2 1.7321 0.0000 0.2 14 0.9996 0.0004 3.2 1.7321 0.0000 0.2 15 0.9998 0.0003 2.2 1.7321 0.0000 0.2 |
[1]Volder,我。“CORDIC三角计算技术。“愤怒交易在电子计算机上。EC-8卷,1959年9月,第330 - 334页。
[2]Andraka, r“的调查CORDIC算法基于FPGA的电脑。“学报1998 ACM / SIGDA第六国际研讨会现场可编程门阵列。2月22 - 24日,1998年,页191 - 200。
[3]沃尔特,j.s“初等函数的统一算法。“惠普公司,帕洛阿尔托。春天联合计算机会议上,1971年,页379 - 386。(从计算机历史博物馆的收藏)。www.computer.org/csdl/proceedings/afips/1971/5077/00/50770379.pdf
[4]Schelin Charles w .“计算器功能近似。“美国数学月刊。5号卷。90年,1983年5月,页317 - 325。