Got me! I promised to publish the code including the FFT handling as soon as I had tidied it up. But still haven't :sleep:
First, you need to add the DSP library to the makefile as described in the Wiki. Then, the header file has to be included in each C file which contains calls to the library functions:
#include "cr_dsplib.h"
I just copied the files cr_dsplib.h and libcr_dsplibFFT_cm3.a into the folder where my source files are.
Since the input signal for the FFT is real in my case (i. e. the imaginary part is always zero), every other number of the input array is zero:
static s16 psi_Input[128];
static s16 psi_Output[128];
//fill input buffer for FFT
for(i=0, j=0; i<BUF_SIZE; i++)
{
psi_Input[j] = buffer[i]; //real part
j++;
psi_Input[j] = 0; //imaginary part
j++;
}
Then the FFT is computed just by calling:
vF_dspl_fftR4b16N64(psi_Output, psi_Input); //FFT is calculated HERE
Since I had a real (read: non-complex) input signal, only the first 33 bins psi_Output[0]...psi_Output[32] contain useful information.
Hope it's clearer now. If you have more questions, just ask.
Ingo