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.

IWR6843AOPEVM: 1DFFT data with cmplx16ReIm_t format output and parse

Part Number: IWR6843AOPEVM

Hi, 

I'm using "mmwave_industrial_toolbox_4_7_0\labs\out_of_box_demo\68xx_aop_mmwave_sdk_hwa" for developing.

And I modified function "DPC_ObjectDetection_execute" in "objectdetection.c" file.

I just want UART output 1DFFT with cmplx16ReIm_t format, so I just open 1DFFT function, and I save that data into the data structure reserved for azimuthStaticHeatMap since the data size and type would be similar. 

/* fill azimuthStaticHeatMap */
    for (rgn = 0; rgn < subFrmObj->staticCfg.numRangeBins - 1; rgn++)
    {
        for (tant = 0; tant < subFrmObj->staticCfg.numVirtualAntennas; tant++)
        {
            subFrmObj->dpuCfg.aoaCfg.res.azimuthStaticHeatMap[rgn * subFrmObj->staticCfg.numVirtualAntennas + tant].imag = 0;
            subFrmObj->dpuCfg.aoaCfg.res.azimuthStaticHeatMap[rgn * subFrmObj->staticCfg.numVirtualAntennas + tant].real = 0;
        }
    }

    for (tant = 0; tant < subFrmObj->staticCfg.numTxAntennas; tant++)
    {
        for (rant = 0; rant < (subFrmObj->staticCfg.numVirtualAntennas / subFrmObj->staticCfg.numTxAntennas); rant++)
        {
            for (rgn = 0; rgn < subFrmObj->staticCfg.numRangeBins - 1; rgn++)
            {
                temp = (((cmplx16ReIm_t *)subFrmObj->dpuCfg.rangeCfg.hwRes.radarCube.data) +
                        tant * subFrmObj->staticCfg.numRangeBins * subFrmObj->staticCfg.numDopplerBins * (subFrmObj->staticCfg.numVirtualAntennas / subFrmObj->staticCfg.numTxAntennas) +
                        rant * subFrmObj->staticCfg.numRangeBins +
                        rgn);

                subFrmObj->dpuCfg.aoaCfg.res.azimuthStaticHeatMap[rgn * subFrmObj->staticCfg.numVirtualAntennas + tant * (subFrmObj->staticCfg.numVirtualAntennas / subFrmObj->staticCfg.numTxAntennas) + rant].imag = temp->imag;
                subFrmObj->dpuCfg.aoaCfg.res.azimuthStaticHeatMap[rgn * subFrmObj->staticCfg.numVirtualAntennas + tant * (subFrmObj->staticCfg.numVirtualAntennas / subFrmObj->staticCfg.numTxAntennas) + rant].real = temp->real;
            }
        }
    }

Please help to check if my code is correct.

And I output the 1DFFT data with cmplx16ReIm_t format through UART

/* Send data for static azimuth heatmap */
    if (pGuiMonSel->rangeAzimuthHeatMap)
    {
        UART_writePolling (uartHandle,
                           (uint8_t*)&tl[tlvIdx],
                           sizeof(MmwDemo_output_message_tl));

        UART_writePolling (uartHandle,
                (uint8_t *) result->azimuthStaticHeatMap,
                result->azimuthStaticHeatMapSize * sizeof(cmplx16ImRe_t));

        tlvIdx++;
    }

Lastly, I use python to parse the data, I use struct.unpack('Q8I', header) to parse header, but I'm not sure how to parse cmplx16ReIm_t data.

I use struct.unpack('<h', imag) and struct.unpack('<h', real) to parse the data. Is this correct?

Looking forward to your help.

Thanks

Best,

Yunlong

  • HI, Yunlong:

    The ID FFT output is available for every chirp, and for azimuthStaticHeatMap calculation, only the average of the 1D FFT output (over chirp) is calculated. 

    Did you just trying to send out the 1D FFT output of the first chirp?   

    And where in the code did you add the UART output code?   Did you follow the code to output azimuthStaticHeatMap? 

    Regarding the python parser, search some previous e2e thread, you may find some good information, such as e2e.ti.com/.../iwr1642-uart-output-data-python-script

    Best,

    Zigang

  • Hi Zigang,

    I just want to send out the 1D FFT data (first chirp) with cmplx16ReIm_t format. 

    I have not modified the UART output code, I just modified the "DPC_ObjectDetection_execute" in "objectdetection.c" file. Please check is it correct ?

    Regarding the python parser, I checked all the previous e2e thread, but I'm not found some information about azimuthStaticHeatMap parser. There are just parseDetectedObjects, parseRangeProfile and parseStats. But the data format is different with azimuthStaticHeatMap.

    Looking forward to your help.

    Thanks

    Best,

    Yunlong

  • Hi, Yunlong:

    We can not support code review for your code change.   The right way is to use ccs for debug.  You can easily import the ccs project for 6843AOP OOB demo from the project spec file included in the Tirex https://dev.ti.com/tirex/explore/node?node=AIHy77joqu3jXFmjqwkBKQ__VLyFKFf__LATEST, and start debug from there.  IF you just want to check this vector for debug purpose, I would suggest you to check the memory through UART debug instead of output them through UART.  

    But if you are insist to get this data to PC, here are some suggestions:

    You need to understand the data format between the two structure.  And since the azimuthStaticHeatMap is output to the host through UART already, you do not need to add additional code for that (like UART_writePolling).   

    In terms of parsing, can you use OOB demo visualizer to record the data first, and then there is a parser located in SDK package that can tell you how to parse the recorded data.   C:\ti\mmwave_sdk_03_05_00_04\packages\ti\demo\parser_scripts\mmw_demo_example_script.py

    Best,

    Zigang

  • Hi Zigang, 

    Thanks for your help, we solved this problem.

    Best,

    Yunlong