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.

TDA3LA: Formula to calculate PkDetect target energy

Part Number: TDA3LA

Hi,

I would like to understand what's the formula used to calculate the target energy in PkDetect Alg in Vision SDK. I was given the C source file in peak_detection_tb.c to look but I can't seem to follow the code very well to figure out. Can you please provide the formula? The PkDetect input is 1 or more RX channel's RDMs.

Thanks,

--Khai

  • Hi Khai,

       Peak detection first  we compute the sum of the energy across all the channels, this is stored in 32 bit. This energy is then converted into 16 bit by using binary log. This is the every which is then used for CFAR CA and hence the final energy in the output is actually a binary log of actual energy for a particular detection.

    Regards,

    Anshu

  • Hi Anshu,

    Can you please provide the formula to calculating Energy value in PkDetect output?

    Reading code and pieces the information from the code together is not straight forward. I would think you should have the document somewhere to code it up in the code, don;t you?

    Thanks,

    --Khai

  • HI Khai,
       Following piece of code does a sum of energy across antennas :

    void vcop_peak_detection_energy_across_antenna_cn(
    int16_t *inputData,
    uint32_t *outputData,
    uint16_t numRows,
    uint16_t numAntennas,
    uint16_t numHorzPtPerAntenna,
    uint16_t pitch
    )
    {
    uint64_t outEnergy;
    int16_t inDataR;
    int16_t inDataI;
    uint32_t inDataOffset;
    uint32_t outDataOffset;
    uint32_t rowIdx;
    uint32_t idx;
    uint32_t antennaIdx;

    for ( rowIdx = 0; rowIdx< numRows; rowIdx++)
    {
    for ( idx = 0; idx < numHorzPtPerAntenna ; idx++)
    {
    outEnergy = 0;
    for ( antennaIdx = 0; antennaIdx < numAntennas; antennaIdx++)
    {
    inDataOffset = antennaIdx * numHorzPtPerAntenna * 2 +
    idx * 2 +
    rowIdx * (pitch/sizeof(int16_t));

    inDataR = inputData[inDataOffset];
    inDataI = inputData[inDataOffset + 1];

    outEnergy += (inDataR * inDataR) + (inDataI * inDataI);
    }
    outDataOffset = idx + rowIdx * numHorzPtPerAntenna;
    outputData[outDataOffset] = SATURATE(outEnergy,1,0xFFFFFFFF);
    }
    }

    }

      This energy is then converted to binary log, which is stored in a 16 bit container in Q8 format.

    Regards,

    Anshu