《基于TI DSP的通用算法实现》程序代码
源代码在线查看: example 3-2.c
;Example 3 - 2. Bit Reversion for Float-Point Complex DIT Radix-2 FFT C Listing
/***************************************************************/
/* bitRevData --- pointer to the index of bit reversion */
/* revLen --- length of FFT */
/***************************************************************/
void bit_rev(struct complexData * bitRevData, int revLen)
{
struct complexData tempRev;
int iRev, jRev, kRev, halfLen;
halfLen = revLen >> 1; jRev = 0;
for (iRev=0; iRev if (iRev < jRev){
tempRev = bitRevData[jRev];
bitRevData[jRev] = bitRevData[iRev];
bitRevData[iRev] = tempRev;
}
kRev = halfLen;
while (kRev jRev = jRev - kRev;
kRev = kRev >> 1;
}
jRev=jRev+kRev;
}
}