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.

IWR1642: 16-bit transform of 2D-FFT results

Part Number: IWR1642

Hi,

I want to convert the 2D-FFT result (32bit) of IWR1642 demo(SDK 2.0.0.4) to 16bit and output it by SPI.
(Request from our customer.)

In the function MmwDemo_interFrameProcessing () in the file dss_data_path.c, DSP_fft32x32 () outputs 32bit 2D-FFT result. Please tell me how to convert this 32bit data to 16bit.

Since I want to leave the IWR1642 demo as it is for the subsequent processing, I want to perform 2D-FFT in 32bit instead of 16bit.

Best Regards,
Hiroyuki Taguchi

  • Hello,

    Can you please value or data structure you are trying to output? Most of the FFT data is in real and imaginary pairs, so you may be able to only output the real part of the data. But please let us know the data. Also, most of these are just integers, so they can be shifted by 16bits before outputting on UART.

    Regards,

    Jackson

  • Hi Jackson,

    I want to output the 2D-FFT results with 16 bits.
    The output target is a 2D-FFT result, full RANGEBIN, virtual antenna, DopplerBin's real and imaginary value.
    The output data of 2D-FFT DSP_FFT32X32 () is 32 Bit, so I want to output it after converting this to 16 bits.
    And I ensure enough frame intervals for SPI output.

    The data order is as follows:

    Real 16bit (rangeBin0, virtualAnt0, dopplerBin0)
    Imag 16bit (rangeBin0, virtualAnt0, dopplerBin0)
    Real 16bit (rangeBin0, virtualAnt0, dopplerBin1)
    Imag 16bit (rangeBin0, virtualAnt0, dopplerBin1)
    ...
    Real 16bit (rangeBin0, virtualAnt0, dopplerBinD-1)
    Imag 16bit (rangeBin0, virtualAnt0, dopplerBinD-1)
    ...
    ...
    Real 16bit (rangeBin0, virtualAntN-1, dopplerBin0)
    Imag 16bit (rangeBin0, virtualAntN-1, dopplerBin0)
    Real 16bit (rangeBin0, virtualAntN-1, dopplerBin1)
    Imag 16bit (rangeBin0, virtualAntN-1, dopplerBin1)
    ...
    Real 16bit (rangeBin0, virtualAntN-1, dopplerBinD-1)
    Imag 16bit (rangeBin0, virtualAntN-1, dopplerBinD-1)
    ...
    ...
    ...
    Real 16bit (rangeBinR-1, virtualAnt0, dopplerBin0)
    Imag 16bit (rangeBinR-1, virtualAnt0, dopplerBin0)
    Real 16bit (rangeBinR-1, virtualAnt0, dopplerBin1)
    Imag 16bit (rangeBinR-1, virtualAnt0, dopplerBin1)
    ...
    Real 16bit (rangeBinR-1, virtualAnt0, dopplerBinD-1)
    Imag 16bit (rangeBinR-1, virtualAnt0, dopplerBinD-1)
    ...
    ...
    Real 16bit (rangeBinR-1, virtualAntN-1, dopplerBin0)
    Imag 16bit (rangeBinR-1, virtualAntN-1, dopplerBin0)
    Real 16bit (rangeBinR-1, virtualAntN-1, dopplerBin1)
    Imag 16bit (rangeBinR-1, virtualAntN-1, dopplerBin1)
    ...
    Real 16bit (rangeBinR-1, virtualAntN-1, dopplerBinD-1)
    Imag 16bit (rangeBinR-1, virtualAntN-1, dopplerBinD-1)

    R=64, N=12, D=32, taoal 96Kbyte


    Best Regards,
    Hiroyuki

  • Hi Jackson,

    Simply, can I adopt how to discard the lower 16 bits out of 32 bits and output only the top 16 bits?

    Best Regards,
    Hiroyuki

  • Hi Jackson,

    Excuse me, the data size earlier is a mistake.
    Correctly:
    R=64, N=8, D=32, taoal 64Kbyte

    Best Regards,
    Hiroyuki

  • Hello Hiroyuki-san,

    Are you trying to discard the imaginary components of the data? Are those the 16 bits you are asking about? I don't know where you are initiating your SPI transfer, but you will need to modify the data structure to remove the imaginary variables, then send via SPI. You will either need to make a new structure to hold this or have a loop in your SPI send command to only write out the real parts.

    Regards,

    Jackson

  • Hi Jackson,

    No. I want to send both imaginary and real numbers in 16bit.
    Since the DSP_fft32x32 () output is 32 bits for both real and imaginary numbers, I want to round these real and imaginary numbers to 16 bits each.

    Best Regards,
    Hiroyuki

  • They are integers, so you should be able to cast and save to 8 bit variables. You will probably need to make a new structure to hold the values. Either look up casting or bit shift operators in C.

    Regards,

    Jackson

  • Hi Jackson,

    thank you for your reply.
    I want to cast in 16bit, but which byte of 32bit should be cast in 16bit?
    Is the upper 2 byte cast correct?

    Best Regards,
    Hiroyuki

  • Yes you want the upper bytes, but casting will do this automatically. Please look up casting in C.