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.

Fixed to Floating point conversion

Other Parts Discussed in Thread: TMS320C6713B

What are the exact high level routines that should be used when converting a fixed point to a floating point number?

I have audio data coming in fixed point and I need it to be floating point.

I am using a TMS320C6713B DSP.

Thank You

  • If in C code, use a cast operation:

    int i;
    ...
    float f = (float) i;
    

    If using assembly code, you would use the INTSP or INTSPU instructions.  There are also INTDP and INTDPU instructions for conversion to double-precision floating point numbers.

    That should be all you need to do.

    Regards, Daniel

     

  • Daniel has already given you good advice, but I want to add one thing.  You can also explicitly call the assembly instructions in your C code using compiler intrinsics, as in:

    int i;

    float f = _intsp(i);

    This should be functionally identical to using a simple C cast.

  • Thank you,

    Maybe you can also answer this:

    I have 2 separate boards 1 using TDM in the other I2S.

    The I2S seems to enter the DSP as an unsigned int.

    The TDM as Floating Point.

    Is this normal?  Am I missing something else in the configuration?

  • I personally don't know.  The interfaces are just going to transmit bits stuffed into frames/slots/etc, so it seems the source of those bits would be the one who determines whether the data is fixed or float data.  What are the data sources and the software interfaces used to read the data?

    Regards, Daniel