Hi,
I am trying to take fft in audio sample project given in pspdrivers_01_30_01. I am using OMAP L137 EVM and I am new in TI DSPs. As you know, in audio sample project the audio input is taken from line in jack and the output is given from the headphone out without any change. I have tried to take fft first and then take inverse fft in order to hear the input signal again, but strange sounds were heard from the output.
The first thing I have tried is to add the real fft function with a modification. This example is taken from the following link;
http://processors.wiki.ti.com/index.php/Efficient_FFT_Computation_of_Real_Input
This function is modified as follows;
void Real_FFT (float *input, float *output)
{
int i, rad, nTemp = N / 2;
float *twiddle;
if (nTemp == 16 || nTemp == 64 || nTemp == 256 || nTemp == 1024 || nTemp == 4096 || nTemp == 16384)
rad = 4;
else if (nTemp == 8 || nTemp == 32 || nTemp == 128 || nTemp == 512 || nTemp == 2048 || nTemp == 8192)
rad = 2;
else
{
printf ("%d Value of N is not supported \n", N);
exit (0);
}
// Real FFT of length N/2
for (i = 0; i < N/2; i++)
{
pRFFT_In[2 * i] = input[2*i]; //arrange real input sequence to
pRFFT_In[2 * i + 1] =input[2*i+1]; //N/2 complex sequence..
//printf("input[%d] = %15.4f\n",2*i,input[2*i]);
}
tw_gen (w, N / 2);
split_gen (A, B, N / 2);
twiddle = (float *) w;
DSPF_sp_fftSPxSP (N / 2, pRFFT_In, twiddle, pTemp, brev, rad, 0, N / 2);
// FFT Split call to get complex FFT out of length N..
FFT_Split (N / 2, pTemp, A, B, pRFFT_Out);
IFFT_Split (N / 2, pRFFT_Out, A, B, pTemp);
// Inverse FFT Calculation using N/2 complex IFFT..
DSPF_sp_ifftSPxSP (N / 2, pTemp, twiddle, output, brev, rad, 0, N / 2);
}
And it was called inside Audio_echo_Task() as;
Real_FFT((float *)&rcv,(float *)&xmt);
1) I have decreased the "BUFLEN" from 2560 to 1024 to be compatible with the FFT size (The fft size N = 1024)
2) I have changed .far in .cmd file from IRAM to SDRAM in order to solve the link error.
3) After the is compiled and linked with success, there are two remarks remain as shown below;
"D:/Program Files/Texas Instruments/C6000 Code Generation Tools 6.1.9/include/math.h", line 63: remark: function "_FMOD" was declared but never referenced
"D:/Program Files/Texas Instruments/C6000 Code Generation Tools 6.1.9/include/mathf.h", line 141: remark: function "_FMODF" was declared but never referenced
The second thing I have tried is to call the complex fft functions with the same logic, but the result does not change. Again I heard strange sounds or no sound.
What can be wrong? Can you give an idea about this issue? Is there any setting in order to use DSPLIB together with DSP/BIOS?
Thanks&Best Regards,
Fikret