AnsweredAssumed Answered

4096 Point FFT Causes 'Out of Memory' on BF-506F

Question asked by sidhantgupta on Jul 12, 2010
Latest reply on Aug 9, 2010 by sidhantgupta

Hello!

 

I have recently started evaluating the ADSP-BF506F EZ-KIT Lite for an application where I need to compute a FFT over a spectral width of 1 Mhz (ADC at 2 Mhz) such that the per bin frequency width is at most around 488. So that calls for 2048 bins across the 1 Mhz spectral width, or basically 4096 point FFT computation.

 

I have successfully been able to run a 2048 point FFT with the following code:

 

 

#include <filter.h>

#include <complex.h>

#include <math.h>

#include <math_const.h>

#include <stdio.h>


#define FFT_SIZE 2048


complex_fract16 twiddle_table[FFT_SIZE/2];

complex_fract16 fft_vector[FFT_SIZE];


fract16 input_vector[FFT_SIZE];

fract16 mag_fft_vector[FFT_SIZE];


void create_sine_wave(float);


int main( void )

{

     int block_exponent, i;

 

     //Generate Twiddle Table

     twidfftrad2_fr16(twiddle_table, FFT_SIZE);

 

    

     //Generate Input

     create_sine_wave(1000);

 

   

      //Computer FFT

     rfft_fr16(input_vector, fft_vector, twiddle_table, 1, FFT_SIZE, &block_exponent, 1);

 

 

     for(i=0;i<FFT_SIZE; i++)

     mag_fft_vector[i] = cabs_fr16(fft_vector[i]);

 

 

     printf("\nDone");

     fflush(stdout);

 

 

return 0;

}


void create_sine_wave(float f)

{

int i;

float fs = 48000.0;


//generate input

for (i=0; i<FFT_SIZE; i++) {

input_vector[i] = (fract16) (sin(2*PI*f*((float)i/fs))*32760.0);

}

}


However, when I try to compute a 4096 point FFT, I get an error: "Out of memory in output section 'bsz_L1_data_a' in processor 'p0'". Now if I understand correctly, a 4K point FFT should take up a total of  28K (8K input, 8K output, 4K twiddle,8K mag) out of 68K of total RAM.

 

What am I missing or misunderstanding here? Also, is there a way to see how much RAM is being consumed by various sections of my code?

 

Please advise.

 

Thank you for your help.

 

Rgds,

SG

Outcomes