3 void fft(
double real[
FFT_SIZE],
double img[FFT_SIZE],
double real_twid[FFT_SIZE/2],
double img_twid[FFT_SIZE/2]){
4 int even, odd, span, log, rootindex;
8 outer:
for(span=FFT_SIZE>>1; span; span>>=1, log++){
9 inner:
for(odd=span; odd<
FFT_SIZE; odd++){
13 temp = real[even] + real[odd];
14 real[odd] = real[even] - real[odd];
17 temp =
img[even] +
img[odd];
18 img[odd] = img[even] - img[odd];
21 rootindex = (even<<log) & (FFT_SIZE - 1);
23 temp = real_twid[rootindex] * real[odd] -
24 img_twid[rootindex] * img[odd];
25 img[odd] = real_twid[rootindex]*img[odd] +
26 img_twid[rootindex]*real[odd];
volatile unsigned char img[WIDTH][HEIGHT]
void fft(double real[FFT_SIZE], double img[FFT_SIZE], double real_twid[FFT_SIZE/2], double img_twid[FFT_SIZE/2])