This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Interpret FFT results.Help needed

Hi,

I was able to compute 1024-point FFT of an input signal.

Following are the values stored in the memory as an output from the FFT computation. I need a help to interpret these values.

Memory Locations and the corresponding Values stored in them are shown below:

Memory ::::0x2000---0x2001---0x2002---0x2003---0x2004---0x2005---0x2006---0x2007

Values:::::::0x0021---0x0021---0x0017---0xFFED---0x0002---0x0001---0x0008---0xFFFA

Could someone brief me how to identify the real and the imaginary part ???

  • Hi all,

    I am waiting for someone to give their views !!!

    FFT output from Matlab and the processor should be exactly same right ??

  • Hi Anand,

    HWAFFT data types are described in Section 4.1 Data Types - http://www.ti.com/lit/an/sprabb6b/sprabb6b.pdf

    The HWAFFT functions use an Int32 pointer to reference these complex vectors. Therefore, each 32-bit
    element contains the 16-bit real part in the most significant 16 bits, and the 16-bit imaginary part in the
    least significant 16 bits

    Hope this helps,
    Mark 

  • Hi Mark,

    It means in the above example ::

    Memory ::::0x2000---0x2001---0x2002---0x2003---0x2004---0x2005---0x2006---0x2007

    Values:::::::0x0021---0x0021---0x0017---0xFFED---0x0002---0x0001---0x0008---0xFFFA

    Then : FFT_output(0) =  {&(0x2000)}  + i   {&(0x2001)}

              FFT_output(1) = {&(0x2002)}  + i    {&(0x2003)}

              FFT_output(2) = {&(0x2004)}  + i    {&(0x2005)}

    Is it right ???

  • Yes that is correct.

    Make sure the array is 32-bit aligned.. see the appendix.

    Hope this helps, 
    Mark 

  • Hi, Thankx for your resposnce. I have read the appendix which you had pointed out. They have discussed Methods for Aligning the Bit-Reverse Destination Vector. They have also pointed out in the usage notes that Data and Scratch Buffers Must Reside at Data Locations Less Than 0x10000. In my code, Data and Scratch Buffers are loctaed @ 0x1000 and 0x2000 respectively which makes me in the safe zone.Still my FFT results are not matching the corresponding Matlab outputs.

    ===========================================================================

    Following is my code:

    void fft(Int32 signal[])
    {

        Int32 *result = 0; Int32 *data_br = 0; Uint16 out_sel = 0; Int32 *scratch= 0;
        Float32 real_part[INPUT_BUFFER/2];
        Float32 imaginary_part[INPUT_BUFFER/2];

        data_br = data_br_buf; // Using PRAGMA and ALLIGN directive i have made sure that these data buffers are in the safe zones
        scratch = scratch_buf; // Using PRAGMA and ALLIGN directive i have made sure that these data buffers are in the safe zones


        hwafft_br(signal,data_br,INPUT_BUFFER);
        out_sel = hwafft_1024pts(data_br, scratch, FFT_FLAG, SCALE_FLAG);


        if (out_sel == OUT_SEL_DATA)
        {
            result = data_br;
        }
        else
        {
            result = scratch;
        }   
    ===========================================================================

    Please note that, the values from the FFT are not matching the correspondning Matlab outputs. I gave the same signal to
    Matlab and C5515 to test this out. I tried calculating the fundamental frequency from the FFT outputs from the C5515. It was strange to
    see that fundamental frequency was perfectly matching with the input frequency.

    Does anyone know what could be the problem ??