MIF初始化РEmif_Config(); Р// Open McBSP port 1 and get a McBSP type handleР?hMcbsp = MCBSP_open(MCBSP_PORT1,MCBSP_OPEN_RESET);Р// ConfigMcBSP?port 1 by use previously defined structureР?Mcbsp_Config(hMcbsp);Р?Р//I2C初始化Р?I2C_cofig(); Р//CODEC寄存器初始化Р?inti_AIC(); Рstart:Р//---------------------------------------------------正弦波程序-----------------------------------------------Рif(choose==1){PPP:for(i=0;i<=Nx-1;i++) Р{Рfloat angle,xx;Рfloat input0=0,x1;Р float a,b,c,d,e,f,g,h,ii,step;//step为角度步长Р step=360.0/Nx; temp=choose; // Nx为360度内取样点数Рangle=input0+step*i;Рx1=3.1415926*angle/180; Рxx=x1*x1;Рa=1-xx/16/17;b=1-xx/14/15*a;c=1-xx/12/13*b;d=1-xx/10/11*c;e=1-xx/8/9*d;f=1-xx/6/7*e;g=1-xx/4/5*f;h=1-xx/2/3*g;ii=x1*h;Р output1[i]= 32767*ii; //利用泰勒级数计算出正弦波的数值,存放到output1中Р output[i]=amp*output1[i]/8+q/8; Р}