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.

What is the Q format of the FFT algorithm in EVE

Hi, 

I'm using the FFT algo. in EVE to realize the 2D-FFT of the radar signal processing.

The singed int (16-bit) format is used, but I can not find out the Q format from the given documents.
I need some help.

Thank you very much.

  • Hi, Benz,

    Experts have been notified and will comment directly here.

    Regards,
    Mariya
  • Hi Benz,

        Input data is 16bit signed integer number. You can control the Q format of windowing coefficients and twiddle factor  using FFT_TI_InArgs->windowingScaleFactor and FFT_TI_InArgs->scaleFactors[] respectively. These parameters apply rounding operation ( ( x + (1<<(n-1) ) >> n ) )after windowing and at each stage of FFT respectively. Just as an example if your twiddle factors are in Q15 format than you can provide FFT_TI_InArgs->scaleFactors[] = 15 to get the correct result. It is important to note that we should make sure that output at each stage of FFT is within 15 bits. This is required so that multiplication by twiddle factor doesnt overflow because of the bit growth at each stage of FFT. You will have to chose these scale factors to take care of both Q format and scaling required to limit the output at each stage to be within 15 bits. 

    Regards,

    Anshu

  • Hi Benz,
    Just a little correction. In our implementation twiddle factor is in Q15 format and input data is stored in 16 bit signed integer. On top of this user can provide there own scaling at each stage of FFT using FFT_TI_InArgs->scaleFactors[] parameter. Hope this will clarify your doubt. Let me know if you have any further doubt.

    Regards,
    Anshu
  • Hi Anshu,
    I've understood most of it. When I tested the FFT algo in Processor_SDK_Radar_02_11_00_00, I found that the FFT_TI_InArgs->scaleFactors[] was all set to 2 by default. According to your description, this format should be Q2. Compared with Q15, these factors should be very large. However, when I inputed a (-7000~7000) sine wave, the output peak abs_value is not very large(just 4096), this is why?
    Thanks
  • Hi Benz,

       As mentioned in my second answer in our implementation the twiddle factors are always stored in Q15 format. So even if you give FFT_TI_InArgs->scaleFactors as 0, output will still be down shifted by 15 ( because of Q15 format for twiddle factors). In our implementation default value of scaleFactor is chosen as 2  which internally translates to downshift by 17 ( 15 + 2 ). For Radix 4 based FFT implementation each stage output can grow by 2 bits so if we down shift by 2 at each stage we will ensure that next stage will not overflow.

    Regards,

    Anshu