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.

TDA2EXEVM: PkDetect Alg to Process 16 RX Channels on EVE

Part Number: TDA2EXEVM

Hi,

We are using PkDetect Alg plugn to process 16 RX channels output from 4 EVEs running 2D FFT. We create a usecase where we output of 4 FFTs running on 4 EVEs are merged and sync together to form input of PkDetect Alg running on EVE1. The output of PkDetect Alg doesn't look correct however. We are looking for some pointers on how to setup the PkDetect input parameters to let EVE1 knows of the 16RX channels we need it to process. Code snippet below are what we are not sure about.

Thanks You,

--Khai

inBufAddr[4] contains 4 pointers to 4 FFT output buffers

pObj->pProcessInArgs->inAlgArgs.inBufs.bufDesc[PEAK_DETECTION_TI_BUFDESC_IN_ANTENNA_DATA_BUF]->bufPlanes[0].buf = inBufAddr; // Khai: NOT sure if this is correct
pObj->pProcessInArgs->inAlgArgs.outBufs.bufDesc[PEAK_DETECTION_TI_BUFDESC_OUT_BUFFER]->bufPlanes[0].buf = (UInt8 *)&pkDetDesc->objBuf;
pObj->pProcessInArgs->inAlgArgs.outBufs.bufDesc[PEAK_DETECTION_TI_BUFDESC_OUT_ENERGY_BUFFER]->bufPlanes[0].buf = (UInt8 *)&pkDetDesc->energyBuf;
if (algLinkParams->enableAntennaDataOut == 1)
{
pObj->pProcessInArgs->inAlgArgs.outBufs.bufDesc[PEAK_DETECTION_TI_BUFDESC_OUT_ANTENNA_DATA]->bufPlanes[0].buf = (UInt8 *)&pkDetDesc->antData;
}

pObj->pProcessInArgs->inAlgArgs.inArgs.bufDescription.numChunks = fftMetadata->bufDesc.numChunks;
pObj->pProcessInArgs->inAlgArgs.inArgs.bufDescription.numAntennas = fftMetadata->bufDesc.numAntennas; // Khai: numAntennas=4. Should this be multiply by 4
pObj->pProcessInArgs->inAlgArgs.inArgs.bufDescription.numVertPoints = fftMetadata->bufDesc.numVertPoints;

// Khai: What about the rest of below setting?

for (i = 0U; i < fftMetadata->bufDesc.numChunks; i++)
{
pObj->pProcessInArgs->inAlgArgs.inArgs.bufDescription.numHorzPoints[i] = fftMetadata->bufDesc.numHorzPoints[i];
pObj->pProcessInArgs->inAlgArgs.inArgs.bufDescription.offsetBwAntennas[i] = fftMetadata->bufDesc.offsetBwAntennas[i];
pObj->pProcessInArgs->inAlgArgs.inArgs.bufDescription.pitch[i] = fftMetadata->bufDesc.pitch[i];
}
pObj->pProcessInArgs->inAlgArgs.inArgs.enableTxDecoding = algLinkCtrlParams->enableTxDecoding;
pObj->pProcessInArgs->inAlgArgs.inArgs.numTx = algLinkCtrlParams->numTx[currProfile];
pObj->pProcessInArgs->inAlgArgs.inArgs.numRx = algLinkCtrlParams->numRx[currProfile];
pObj->pProcessInArgs->inAlgArgs.inArgs.offsetBwTx = fftMetadata->bufDesc.offsetBwAntennas[0] * algLinkCtrlParams->numRx[currProfile];
pObj->pProcessInArgs->inAlgArgs.inArgs.offsetBwRx = fftMetadata->bufDesc.offsetBwAntennas[0];
pObj->pProcessInArgs->inAlgArgs.inArgs.txDecodingCoefficients = (Int16*)algLinkCtrlParams->txDecodingCoefficients;
pObj->pProcessInArgs->inAlgArgs.inArgs.rangeDim = algLinkCtrlParams->rangeDim[currProfile];
pObj->pProcessInArgs->inAlgArgs.inArgs.dopplerDim = algLinkCtrlParams->dopplerDim[currProfile];
memcpy((void *)&pObj->pProcessInArgs->inAlgArgs.inArgs.algoParams.cfarCaDb,
(const void *)&algLinkCtrlParams->cfarCaDb, sizeof(PEAK_DETECTION_TI_CfarCaDbParams));

  • Hi Khai,

        Before programming peak detection applet. Have you configured the output of doppler FFT to have a bigger pitch so that all four EVE's data comes in a single buffer which is what will be fed to peak detection applet?


    Regards,

    Anshu

  • Hi Anshu,

    Thanks for getting back. No, I wasn't aware what you said can be done. How this can be done I am not sure. Please advice...

    What I understand is that the output doppler FFT from each EVE is stored in a single buffer (of 4RX 2DFFT data). With that in mind, PkDetect applet will have 4 pointers to 4 independent 2DFFT buffers as input. How can these be put together to allow PkDetect applet to know they are one consecutive data set of 16 RDM buffers to be processed.

    Thanks,

    --Khai

  • Hi Khai,

        You can control the pitch of the output buffer of Doppler FFt by setting the following parameter. 

    bufDesc[FFT_TI_BUFDESC_OUT_BUFFER]->bufPlanes[0].width : This field indicates the pitch in bytes of the output buffer. This field is
    used only when FFT direction is FFT_TI_DIRECTION_VERTICAL. if the value for this is set to zero then the pitch will be calculated internally. For this case size of this buffer should be same as size of input buffer.
    If user wants to control the pitch of output buffer then user should first call the Control call to figure out the minimum pitch required and user is expected to give pitch which is greater or equal to the minimum pitch. The maximum supported pitch is 32767.

        Can you confirm if you are programming the above pitch to account for all the 4 EVE's output

    Regards,

    Anshu

  • Hi Anshu,

    Can we have setup a call to have some understanding? I took a look at the FFT Apple. There are 3 occurrences of the bufDesc[FFT_TI_BUFDESC_OUT_BUFFER]->bufPlanes[0].width are all set to 0.

    My question is even if I set the width here to something different than 0, this setting applies to 4 FFT instances. There are still 4 FFT output buffers. Somewhere somehow there is a piece of code that performs the assembling of the 4 buffers into a single buffer as input to PkDetect Applet. Can you explain how this is done?

    Thanks,

    --Khai

  • Hi Khai,

       Have you looked at the following usecase:

    C:\PROCESSOR_SDK_VISION_03_08_00_00\vision_sdk\apps\src\rtos\radar\src\usecases\cascade_radar_object_detect

        This usecase is splitting the FFT across multiple EVE's and hence must be doing something similar to what you are trying to do.


    Regards,

    Anshu

  • Hi Anshu,

    Cab you point me to a piece of code in that usecase that does the assembling of the 4 individual buffers into one if bufPlanes[0].width is not 0?

    Thanks,

    --Khai

  • Hi Khai,

        After speaking to the team internally it turns out that current implementation is not the way i thought. So in current cascade radar usecase each EVE is independently writing the output to a different buffer and this output is then processed in DSP.

        But the approach which i suggested is still applicable. You can provide a bigger pitch for the output of doppler FFT. You can refer the following file :

    C:\PROCESSOR_SDK_VISION_03_08_00_00\vision_sdk\apps\src\rtos\radar\src\alg_plugins\alg_fxns\radarfft2\radarFft2.c

      Search for outputBufferpitch to find the place where this pitch is set.


    Regards,

    Anshu

  • Hi Anshu,

    I am trying to at least understand the magic behind simply assigning outputBufferpitch a pitch number that's equal to the pitch of 16 RX channels would automatically arrange all sensor RX data into a single buffer presented to PkDetect Alg. Can you please elaborate on how this works? I simply don't have confidence in doing so without understanding how it comes about.

    Thanks,

    --Khai

  • Hi Khai,
        There is no magic here :). I am assuming that you will provide output pointers to each EVE correctly. This is how I am visualizing this :

      Here each EVE writes output with a pitch of outputBufferPitch but it will only write 4Rx of data and the pointer to each EVE is at an offset of 4 RX. This will make sure eventually you will get all 16 Rx in a single buffer. Hope this clarifies :

     

    Regards,

    Anshu

  • Hi Anshu,

    One question. Since radarProcessLink_algPlugin.c performs buffer allocation for FFT output and it will allocate the largest buffer size if 4 profiles presents. With each EVE output points to the beginning of each respective buffer, there will be holes for the smaller cube size profiles in the output buffer presenting to PkDetect. Would PkDetect be able to figure this out? Or the 16 RX FFT output data really have to be back to back?

    Thanks,

    --Khai

  • Hi Khai,

         16 Rx data is expected to be back to back, and you can control it by appropriately giving the pointer for each EVE and a bigger pitch corresponding to 16 Rx.

    Regards,

    Anshu