Спасибо! Наткнулся ещё на такое описание
http://processors.wiki.ti.com/index.php/Ef...n_of_Real_InputПоходу я что-то не понимаю... Механизма у меня не пашет.
float mq15tofl(short a){return ((float)a / (float)0x8000);}
void GenRealTransform(void)
{
int i;
int n=FILTER_FFT_SIZE;
for (i = 0; i < FILTER_FFT_SIZE; i++)
{
FILTER_FFT_REAL[2 * i] = mfl2q15(0.5 * (1.0 - sin (2 * PI / (double) (2 * n) * (double) i)));
FILTER_FFT_REAL[2 * i + 1] = mfl2q15(0.5 * (-1.0 * cos (2 * PI / (double) (2 * n) * (double) i)));
FILTER_FFT_REAL[FILTER_FFT_SIZE + 2 * i] = mfl2q15(0.5 * (1.0 + sin (2 * PI / (double) (2 * n) * (double) i)));
FILTER_FFT_REAL[FILTER_FFT_SIZE + 2 * i + 1] = mfl2q15(0.5 * (1.0 * cos (2 * PI / (double) (2 * n) * (double) i)));
}
}
void FFT_Split (int n, short *restrict pIn, short *pATable, short *pBTable, short *pOut)
{
int i;
short Tr, Ti;
pIn[2 * n] = pIn[0];
pIn[2 * n + 1] = pIn[1];
#pragma UNROLL(2)
for (i = 0; i < n; i++)
{
Tr = ((int)pIn[2 * i] * pATable[2 * i]>>15 - (int)pIn[2 * i + 1] * pATable[2 * i + 1]>>15 + (int)pIn[2 * n - 2 * i] * pBTable[2 * i]>>15 + (int)pIn[2 * n - 2 * i + 1] * pBTable[2 * i + 1]>>15);
Ti = ((int)pIn[2 * i + 1] * pATable[2 * i]>>15 + (int)pIn[2 * i] * pATable[2 * i + 1]>>15 + (int)pIn[2 * n - 2 * i] * pBTable[2 * i + 1]>>15 - (int)pIn[2 * n - 2 * i + 1] * pBTable[2 * i]>>15);
pOut[2 * i] = Tr;
pOut[2 * i + 1] = Ti;
// Use complex conjugate symmetry properties to get the rest..
pOut[4 * n - 2 * i] = Tr;
pOut[4 * n - 2 * i + 1] = -Ti;
}
pOut[2 * n] = pIn[0] - pIn[1];
pOut[2 * n + 1] = 0;
}
DSP_fft16x16(FILTER_FFT_TWIDDLE,FILTER_FFT_SIZE,FILTER_FFT_MEMORY, FILTER_FFT_RESULT);
FFT_Split(FILTER_FFT_SIZE, FILTER_FFT_RESULT, FILTER_FFT_REAL, FILTER_FFT_REAL+FILTER_FFT_SIZE, FILTER_FFT_MEMORY);