基于DSP的电力线载波OFDM调制解调器
void radix4(int n,short x[], short w[])
{
int n1,n2,ie,wa1,wa2,wa3, wb1, wb2,wb3,ia0,ia1,ia2,ia3,ib0,ib1,ib2,ib3,j,k;
short ta,tb,ra1,ra2, rb1,rb2,sa1,sa2,sb1,sb2,coa1,coa2,coa3,cob1,cob2,cob3,sia1,sia2,sia3,sib1,sib2,sib3;
n2=n;
ie=1;
for(k=n;k>1;k>>=2)
{ //number of stage
n1=n2;
n2>>=2; // distance between input datas
wa1=0;
for(j=0;j<n2;j+=2){//number of butterfies perstage
wb1=wa1+ie;
wa2=wa1+wa1;
wb2=wb1+wb1; //since heremost of the folow-ering two instructions are parallel
wa3=wa2+wa1;
wb3=wb2+wb1;
coa1=w[wa1*2+1];
cob1=w[wb1*2+1];
sia1=w[wa1*2];
sib1=w[wb1*2];
coa2=w[wa2*2+1];
cob2=w[wb2*2+1];
sia2=w[wa2*2];
sib2=w[wb2*2];
coa3=w[wa3*2+1];
cob3=w[wb3*2+1];
sia3=w[wa3*2];
sib3=w[wb3*2];
wa1=wb1+ie;
for(ia0=j,ib0=j+1;ia0<n;ia0+=n1,ib0+=n1)
{//loop of two butterflies caculation
ia1=ia0+n2;
ib1=ib0+n2;
ia2=ia1+n2;
ib2=ib1+n2;
ia3=ia2+n2;
ib3=ib2+n2;
ra1=x[2*ia0]+x[2*ia2];
rb1=x[2*ib0]+x[2*ib2];
ra1=x[2*ia0]-x[2*ia2];
rb1=x[2*ib0]-x[2*ib2];
ta=x[2*ia1]+x[2*ia3];
tb=x[2*ib1]+x[2*ib3];
x[2*ia0]=ra1+ta; // x[2*ia0]
x[2*ib0]=rb1+tb; // x[2*ia0]
ra1=ra1-ta;
rb1=rb1-tb;
sa1=x[2*ia0+1]+x[2*ia2+1];
sb1=x[2*ib0+1]+x[2*ib2+1];
sa2=x[2*ia0+1]-x[2*ia2+1];
sb2=x[2*ib0+1]-x[2*ib2+1];
ta=x[2*ia1+1]+x[2*ia3+1];
tb=x[2*ib1+1]+x[2*ib3+1];
x[2*ia0+1]=sa1+ta;
x[2*ib0+1]=sb1+tb;
sa1=sa1-ta;
sb1=sb1-tb;
x[2*ia2]=(ra1*coa2+sa1*sia2)>>15;
x[2*ib2]=(rb1*cob2+sb2*sib2)>>15;
x[2*ia2+1]=(sa1*coa2-ra1*sia2)>>15;
x[2*ib2+1]=(sb1*cob2-rb1*sib2)>>15;
ta=x[2*ia1+1]-x[2*ia3+1];
ra1=ra2+ta;
rb1=rb2+tb;
ra2=ra2-ta;
rb2=rb2-tb;
ta=x[2*ia1]-x[2*ia3];
tb=x[2*ib1]-x[2*ib3];
sa1=sa2-ta;
sb1=sb2-tb;
sa2=sa2+ta;
sb2=sb2+tb;
x[2*ia1]=(ra1*coa1+sa1*sia1) >>15;
x[2*ib1]=(rb1*cob1+sb1*sib1) >>15;
x[2*ia1+1]=(sa1*coa1-ra1*sia1)>>15;
x[2*ib1+1]=(sb1*cob1-rb1*sib1)>>15;
x[2*ia3]=(ra2*coa3+sa2*sia3) >>15;
x[2*ib3]=(rb2*cob3+sb2*sib3) >>15;
x[2*ia3+1]=(sa2*coa3-ra2*sia3)>>15;
x[2*ib3+1]=(sb2*cob3-rb2*sib3)>>15;
}
}
ie <<=2
}
}
- 基于DSP的高阶COSTAS锁相环的设计(03-02)
- 基于DSP的SPWM直接面积等效算法的分析 (07-19)
- 教学办公用电智能管理系统简介(12-20)
- 基于ARM+FPGA的可重构MAC协议的设计与实现(11-18)
- 详解PLC-BUS技术产品的九大应用领域(01-07)
- CAN总线在发动机测试中的应用(09-19)