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.

How to convert input signal to Q31 format, Fixed-Point DSP Library C2000

I'm tending to use FFT function of C2000 Fixed-Point DSP Library. I know that its input must be in Q31 format, and my signal is as follows :

49203
50510
51788
52585
52961
52990
52798
52374
51778
51066
...

How can I change values into Q31 format to apply FFT ?

Or could I direct this signal into the input of FFT function without any changes?

All advices would be appreciated :)

Thanks all,

Tam

  • I'm in trouble with this nearly a week

    Could anyone help me please ?

    Thanks all,

    Tam

  • I don't really understand your question.

    Do you want to convert a floating point to IQ31 format? Something like:

    float_t f;

    _iq    x;

    x = _IQ31(f);

    But I don't really see _IQ31()  define anywhere, only _IQ30(). It seems there is no _IQ31() in the library.

  • This is C2000 Fixed-Point DSP Library http://www.deyisupport.com/cfs-file.ashx/__key/communityserver-discussions-components-files/56/0410.C28x_5F00_Fixed_5F00_Point_5F00_Library_5F00_v1_5F00_01.pdf

    You can refer to page 21 (RFFT32), They indicate that input variable ipcbsrc of FFT module must be in Q31 format.

    I'm tending to convert long to Q31 format so as to implement FFT.

    Thanks,

    Tam

  • I see that you have an array to feed in. What is the format for the array element?

    Can you just go through the array and convert the elements to IQ31?

    On page 24, the example shows:

    long ipcbsrc[2*N];

    long ipcb[2*N];
    

    /* Create an Instance of FFT module RFFT32 fft=RFFT32_32P_DEFAULTS;

    main() {

        ..............................
         // Generate sample waveforms:
    

    for(i=0; i < (N*2); i=i+2) {

    ipcbsrc[i] =(long)real[i] //Q31

          ipcbsrc[i+1] = 0;
        }
    
    So basically, the example uses a type conversion to make sure it 32 bit (ipcbsrc[i] =(long)real[i] //Q31 ), I think.