DSP_fft
#include <stdio.h> #include <stdlib.h> #if 0
#define DIG_REV(i, m, j) ((j) = (_shfl(_rotl(_bitr(_deal(i)), 16)) >> (m))) #else
# define DIG_REV(i, m, j) |
|
|
| \ | ||
do { |
|
|
|
|
| \ |
unsigned _ = (i); |
|
|
| \ | ||
_ = ((_ & 0x33333333) << | 2) ((_ & ~0x33333333) >> | 2); | \ | |||
_ = ((_ & 0x0F0F0F0F) << | 4) ((_ & ~0x0F0F0F0F) >> | 4); | \ | |||
_ = ((_ & 0x00FF00FF) << | 8) ((_ & ~0x00FF00FF) >> | 8); | \ | |||
_ = ((_ & 0x0000FFFF) << 16) ((_ & ~0x0000FFFF) >> 16); | \ | |||||
(j) = _ >> (m); |
|
|
| \ | ||
} while (0) |
|
|
|
|
| |
#endif |
|
|
|
|
|
|
void fft_cn |
|
|
|
|
|
|
( |
|
|
|
|
|
|
const short *restrict w, |
|
|
|
| ||
int n, |
|
|
|
|
|
|
short | *restrict x, |
|
|
|
| |
short | *restrict y |
|
|
|
| |
) |
|
|
|
|
|
|
{ |
|
|
|
|
|
|
int stride, i, j, k, t, s, m; |
|
|
| |||
short | xh0, xh1, | xh20, | xh21; |
|
|
|
short | xl0, xl1, | xl20, | xl21; |
|
|
|
short | xt0, yt0, | xt1, | yt1; |
|
|
|
short | xt2, yt2, | xt3, | yt3; |
|
|
|
/*−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−*/
/* Inform the compiler that the input array ”x”, twiddle factor array | */ |
/* ”w” and output array ”y” are double word aligned. In addition, the | */ |
/* number of points to be transformed is assumed to be greater than or | */ |
/* equal to 16, and less than 32768. | */ |
/*−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−*/ #ifndef NOASSUME
C64x+ DSPLIB Reference |