老式数控系统编程哪位大神说一下

2024-12-28 12:07:22
推荐回答(1个)
回答1:

void IFFT(FFT_HANDLE *hfft, COMPLEX * FD2TD)
{

int i,j,k,butterfly,p;

int power = NumberOfBits(hfft->count);

for(k = 0; k < hfft->count; k++)

FD2TD[k] = FD2TD[k] / COMPLEX(hfft->count, 0.0);

/*蝶形运算*/
for(k = 0; k < power; k++)
{

for(j = 0; j < 1< {

butterfly = 1 << (power-k);

p = j * butterfly;

int s = p + butterfly / 2;

for(i = 0; i < butterfly/2; i++)

{

COMPLEX t = FD2TD[i + p] + FD2TD[i + s];

FD2TD[i + s] = (FD2TD[i + p] - FD2TD[i + s]) * COMPLEX(hfft->wt[i*(1< -hfft->wt[i*(1<
FD2TD[i + p] = t;
}
}
}
/*----按照倒位序重新排列变换后信号----*/

for (k = 0; k < hfft->count; k++)

{
int r = BitReverise(k, power);
if (r > k)
{

COMPLEX t = FD2TD[k];

FD2TD[k] = FD2TD[r];

FD2TD[r] = t;
}
}
}