Texas Instruments TMS320C67 DSP Series Programmer's Reference Manual page 32

Library
Hide thumbs Also See for TMS320C67 DSP Series:
Table of Contents

Advertisement

Algorithm
for ( i = 1, j = n2/radix + 1; i < n2 - 1; i++)
{
index[i] = j - 1;
for (k = n2/radix; k*(radix-1) < j; k /= radix)
j -= k*(radix-1);
j += k;
}
index[n2 - 1] = n2 - 1;
}
This is the C equivalent for the assembly code. Note that the assembly code
is hand optimized and restrictions may apply.
void DSPF_sp_bitrev_cplx(double* x, short* index, int nx)
{
int
i;
short
i0, i1, i2, i3;
short
j0, j1, j2, j3;
double xi0, xi1, xi2, xi3;
double xj0, xj1, xj2, xj3;
short
t;
int
a, b, ia, ib, ibs;
int
mask;
int
nbits, nbot, ntop, ndiff, n2, halfn;
nbits = 0;
i = nx;
while (i > 1)
{
i = i >> 1;
nbits++;
}
nbot
= nbits >> 1;
ndiff
= nbits & 1;
ntop
= nbot + ndiff;
n2
= 1 << ntop;
mask
= n2 - 1;
halfn
= nx >> 1;
for (i0 = 0; i0 < halfn; i0 += 2)
{
b
= i0 & mask;
DSPF_sp_bitrev_cplx
DSPLIB Reference
4-7

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the TMS320C67 DSP Series and is the answer not in the manual?

Questions and answers

Table of Contents