I try (unsuccessful) to implement FFT application on C5535.
As recommended on TI's sprabb6b I execute hwafft module:
void do_fft(Int16 *real_data, Int16 *fft_real, Int16 *fft_imag, Uint16 scale)
{
Uint16 i, data_selection = 0;
Int32 *complex_data, *bitrev_data, *temp_data, *fft_data;
/* Initialize relevant pointers */
bitrev_data = bitreversed_buffer;
temp_data = temporary_buffer;
complex_data = complex_buffer;
/* Convert real data to "pseudo"-complex data (real, 0) */
/* Int32 complex = Int16 real (MSBs) + Int16 imag (LSBs) */
for (i = 0; i < FFT_LENGTH; i++)
{
*(complex_data + i) = ( (Int32) (*(real_data + i)) ) << 16;
}
/* Perform bit-reversing */
hwafft_br(complex_data, bitrev_data, FFT_LENGTH);
/* Perform FFT */
if (scale)
{
data_selection = hwafft_256pts(bitrev_data, temp_data, FFT_FLAG, SCALE_FLAG);
}
else
{
data_selection = hwafft_256pts(bitrev_data, temp_data, FFT_FLAG, NOSCALE_FLAG);
}
/* Return appropriate data pointer */
if (data_selection)
{
fft_data = temp_data;
}
else
{
fft_data = bitrev_data;
}
/* Extract real and imaginary parts */
for (i = 0; i < FFT_LENGTH; i++)
{
*(fft_real + i) = (Int16)((*(fft_data + i)) >> 16);
*(fft_imag + i) = (Int16)((*(fft_data + i)) & 0x0000FFFF);
}
}
On compilation of hwafft_rom.asm and hwafft.asm receive error :
[E9999] Illegal directive or mnemonic.
The change of "mnemonic" to "algebraic" on assembly source language - not resolve the problem
Can I ask You to supply implemented FFT (HWA FFT) on C5535.