資源簡介
用Matlab的.m文件實現CORDIC算法用于產生正弦波,代碼淺顯易懂,該代碼對于指導CORDIC算法在FPGA等可編程器件下的實現具有參考意義。

代碼片段和文件信息
clearclc;
x0=1000;
y0=0;
z0=0;
j=1;
L=256;
sinx=zeros(1L);
for?i=1:L
????if(z0>0?&?bitand(z02^31)~=0)
????????z0=z0-2^32;
????end
????[x1y1z1]=cordic_unit(x0y0z00);
????[x2y2z2]=cordic_unit(x1y1z10);
????[x3y3z3]=cordic_unit(x2y2z20);
????[x4y4z4]=cordic_unit(x3y3z31);
????[x5y5z5]=cordic_unit(x4y4z42);
????[x6y6z6]=cordic_unit(x5y5z53);
????[x7y7z7]=cordic_unit(x6y6z64);
????[x8y8z8]=cordic_unit(x7y7z75);
????[x9y9z9]=cordic_unit(x8y8z86);
????[x10y10z10]=cordic_unit(x9y9z97);
????[x11y11z11]=cordic_unit(x10y10z108);
????[x12y12z12]=cordic_unit(x11y11z119);
????[x13y13z13]=cordic_unit(x12y12z1210);
????[x14y14z14]=cordic_unit(x13y13z1311);
????[x15y15z15]=cordic_unit(x14y14z1412);
????[x16y16z16]=cordic_unit(x15y15z1513);
????[x17y17z17]=cordic_unit(x16y16z1614);
????[x18y18z18]=cordic_unit(x17y17z1715);
????[x19y19z19]=cordic_unit(x18y18z1816);
????[x20y20z20]=cordic_unit(x19y19z1917);
????[x21y21z21]=cordic_unit(x20y20z2018);
????[x22y22z22]=cordic_unit(x21y21z2119);
????[x23y23z23]=cordic_unit(x22y22z2220);
????[x24y24z24]=cordic_unit(x23y23z2321);
????[x25y25z25]=cordic_unit(x24y24z2422);
????[x26y26z26]=cordic_unit(x25y25z2523);
????[x27y27z27]=cordic_unit(x26y26z2624);
????[x28y28z28]=cordic_unit(x27y27z2725);
????[x29y29z29]=cordic_unit(x28y28z2826);
????[x30y30z30]=cordic_unit(x29y29z2927);
????[x31y31z31]=cordic_unit(x30y30z3028);
????[x32y32z32]=cordic_unit(x31y31z3129);
????[x33y33z33]=cordic_unit(x32y32z3230);
????[x34y34z34]=cordic_unit(x33y33z3331);
????sinx(j)=x34;
????j=j+1;
????z0=z0+16777216;
end
plot(sinx);
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????1774??2010-01-12?13:49??cordic.m
?????文件????????294??2010-01-12?13:51??cordic_unit.m
-----------?---------??----------?-----??----
?????????????????2068????????????????????2
- 上一篇:坐標變換仿真模型
- 下一篇:matlab2017 調用vs2017編譯器補丁文件
評論
共有 條評論