IWR6843: measureRangeBiasAndRxChanPahse and compRangeBiasAndRxChanPhase

Part Number: IWR6843

Tool/software:

Hello TI team,

I have a question about measureRangeBiasAndRxChanPahse and compRangeBiasAndRxChanPhase.
When calculating the correction coefficients for each virtual antenna, I think that not only phase correction but also amplitude correction is performed.
Could you explain why amplitude correction is also performed?
What is the benefits of amplitude correction?
Do the benefits vary depending on the angle estimation method?

Regards,
Kei

  • Hi,

    Amplitude correction is meant to correct for bias in the range estimation. Phase error is to correct for bias in the angle estimation.

    Best,

    Nate

  • Hi Nathan,

    Regarding amplitude correction, could you provide more details on why it is intended to correct for bias in range estimation?

    Regards,
    kei

  • Hi Nathan,

    I looked at the post you shared, but it didn't include the information I was looking for.

    Let me explain the 'amplitude correction' that I mentioned in my previous comment.
    It is the 'gain offset' in 'Rx Channel Gain/Phase Offset'.


    C:/ti/mmwave_sdk_03_06_00_00-LTS/packages/ti/datapath/dpc/objectdetection/objdetdsp/docs/doxygen/html/index.html


    The document says, 

    The rx channel phase and gain estimation is done by finding the minimum of the magnitude squared of the virtual antennas and this minimum is used to scale the individual antennas so that the magnitude of the coefficients is always less than or equal to 1. 


    So, my question is,
    Is the purpose of the process of adjusting the amplitudes simply to ensure that the coefficients are less than or equal to 1?
    Or is there a reason to improve the accuracy of angle estimation?

    Regards,
    Kei

  • Hi Kei,

    Perhaps I misunderstood your question - the range compensation is used in the algorithm to improve the range estimation by

    "The peak position is then used to compute the square root of the sum of the magnitude squares of the virtual antennas (taken from 1D-FFT Radar Cube matrix) for the peak and its two nearest neighbors. These three magnitudes and their positions are used to do parabolic interpolation to find the more accurate peak location from which the range bias is estimated as this interpolated peak position minus the configured target distance X. "

    The phases across the antennas are used to improve the angle estimation. It looks like they are all scaled to be less than or equal to the magnitude of the minimum complex number as you point out.

    "In the above calculations, the division by magnitude squared for each element achieves the gain compensation part i.e equalizes the different tx-rx path gains – during compensation (Compensation), when the input antenna samples are multiplied with their corresponding above coefficients, the result has the same magnitude for all virtual antennas. Similarly, the multiplication by complex conjugate achieves phase compensation. The use of minimum of the data set allows for maximal utilization of the 16-bits of fixed point precision to represent the coefficients – the compensation vector will have unity amplitude for the minimum element and less than unity for the rest. "

  • Hi Nathan,

    Thank you for your response.

    My question is: Why is it necessary to equalize the amplitudes between each virtual antenna?

    You mentioned in your response:
    "There is a part in your response that says
    The use of minimum of the data set allows for maximal utilization of the 16-bits of fixed point precision to represent the coefficients – the compensation vector will have unity amplitude for the minimum element and less than unity for the rest."

    I understand that scaling the signal amplitudes of each virtual antenna to match the one with the smallest amplitude enables maximal use of the 16 bits of fixed point precision when representing the coefficients.

    However, as I mentioned above, my question remains: Why do we need to equalize the amplitudes of each virtual antenna in the first place?

    Regards,
    Kei

  • Hi Kei,

    However, as I mentioned above, my question remains: Why do we need to equalize the amplitudes of each virtual antenna in the first place?

    Are you referring to the output coefficients when you say this? The coefficients that get output could be of equal amplitude (amplitude of 1) so they don't scale the input signal up and down when we use the coefficients to correct the AOA estimation. Else, I am not sure what you're asking, because it's clear you understand the scaling of the signal amplitudes to match the smallest amplitude for best precision.

    Best,

    Nate

  • Hi Nathan,

    Let me explain again.

    First, I have illustrated my understanding with a diagram. Is that correct?

    Next, regarding the main question: Which of the following two options is correct?

    1.
    Purpose: Gain offset compensation.
    Method: Use the smallest signal amplitude among the antennas as the reference, which allows for maximal utilization of the 16-bit fixed-point precision when representing the coefficients.

    2.
    Purpose: Achieve maximal utilization of the 16-bit fixed-point precision when representing the coefficients.
    Method: When perform compensation, use the smallest signal amplitude among the antennas as the reference.

    If option 1 is correct, why is gain offset compensation needed? What is the purpose of the gain offset?

    Regards,
    Kei

  • Hi Kei,

    I believe option 2 is correct. I don't know what you mean by gain offset here.

    Best,

    Nate

  • Hi Nathan,

    Thank you for your response. I apologize, but to ensure a clear answer, I have created a simple question. I would like you to answer the following question: What is the purpose of the processing performed by 'scal = 32768. / xMagSq[i] * sqrt(xMagSqMin);'   in the following code?

    static void DPC_ObjDetDSP_rangeBiasRxChPhaseMeasure
    (
        DPC_ObjectDetection_StaticCfg       *staticCfg,
        float                   targetDistance,
        float                   searchWinSize,
        uint16_t                *detMatrix,
        uint32_t                *symbolMatrix,
        DPU_AoAProc_compRxChannelBiasCfg *compRxChanCfg
    )
    {
        cmplx16ImRe_t rxSym[SYS_COMMON_NUM_TX_ANTENNAS * SYS_COMMON_NUM_RX_CHANNEL];
        cmplx16ImRe_t *tempPtr;
        float sumSqr;
        uint32_t * rxSymPtr = (uint32_t * ) rxSym;
        float xMagSq[SYS_COMMON_NUM_TX_ANTENNAS * SYS_COMMON_NUM_RX_CHANNEL];
        int32_t iMax;
        float xMagSqMin;
        float scal;
        float truePosition;
        int32_t truePositionIndex;
        float y[3];
        float x[3];
        int32_t halfWinSize ;
        float estPeakPos;
        float estPeakVal;
        int32_t i, ind;
        int32_t txIdx, rxIdx;
    
        uint32_t numRxAntennas = staticCfg->ADCBufData.dataProperty.numRxAntennas;
        uint32_t numTxAntennas = staticCfg->numTxAntennas;
        uint32_t numRangeBins = staticCfg->numRangeBins;
        uint32_t numDopplerChirps = staticCfg->numDopplerChirps;
        uint32_t numSymPerTxAnt = numDopplerChirps * numRxAntennas * numRangeBins;
        uint32_t symbolMatrixIndx;
    
        uint16_t maxVal = 0;
    
        truePosition = targetDistance / staticCfg->rangeStep;
        truePositionIndex = (int32_t) (truePosition + 0.5);
    
        halfWinSize = (int32_t) (0.5 * searchWinSize / staticCfg->rangeStep + 0.5);
    
        /**** Range calibration ****/
        iMax = truePositionIndex;
        for (i = truePositionIndex - halfWinSize; i <= truePositionIndex + halfWinSize; i++)
        {
            if (detMatrix[i * staticCfg->numDopplerBins] > maxVal)
            {
                maxVal = detMatrix[i * staticCfg->numDopplerBins];
                iMax = i;
            }
        }
    
        /* Fine estimate of the peak position using quadratic fit */
        ind = 0;
        for (i = iMax - 1; i <= iMax + 1; i++)
        {
            sumSqr = 0.0;
            for (txIdx=0; txIdx < numTxAntennas; txIdx++)
            {
                for (rxIdx=0; rxIdx < numRxAntennas; rxIdx++)
                {
                    symbolMatrixIndx = txIdx * numSymPerTxAnt + rxIdx * numRangeBins + i;
                    tempPtr = (cmplx16ImRe_t *) &symbolMatrix[symbolMatrixIndx];
                    sumSqr += (float) tempPtr->real * (float) tempPtr->real +
                              (float) tempPtr->imag * (float) tempPtr->imag;
                }
            }
    #ifdef SUBSYS_DSS
            y[ind] = sqrtsp(sumSqr);
    #else
            y[ind] = sqrt(sumSqr);
    #endif
            x[ind] = (float)i;
            ind++;
        }
        DPC_ObjDetDSP_quadFit(x, y, &estPeakPos, &estPeakVal);
        compRxChanCfg->rangeBias = (estPeakPos - truePosition) * staticCfg->rangeStep;
    
        /*** Calculate Rx channel phase/gain compensation coefficients ***/
        for (txIdx = 0; txIdx < numTxAntennas; txIdx++)
        {
            for (rxIdx = 0; rxIdx < numRxAntennas; rxIdx++)
            {
                i = txIdx * numRxAntennas + rxIdx;
                symbolMatrixIndx = txIdx * numSymPerTxAnt + rxIdx * numRangeBins + iMax;
                rxSymPtr[i] = symbolMatrix[symbolMatrixIndx];
                xMagSq[i] = (float) rxSym[i].real * (float) rxSym[i].real +
                            (float) rxSym[i].imag * (float) rxSym[i].imag;
            }
        }
        xMagSqMin = xMagSq[0];
        for (i = 1; i < staticCfg->numVirtualAntennas; i++)
        {
            if (xMagSq[i] < xMagSqMin)
            {
                xMagSqMin = xMagSq[i];
            }
        }
    
        for (txIdx=0; txIdx < staticCfg->numTxAntennas; txIdx++)
        {
            for (rxIdx=0; rxIdx < numRxAntennas; rxIdx++)
            {
                int32_t temp;
                i = txIdx * numRxAntennas + rxIdx;
                scal = 32768./ xMagSq[i] * sqrt(xMagSqMin);
    
                temp = (int32_t) MATHUTILS_ROUND_FLOAT(scal * rxSym[i].real);
                MATHUTILS_SATURATE16(temp);
                compRxChanCfg->rxChPhaseComp[staticCfg->txAntOrder[txIdx] * numRxAntennas +
                                             rxIdx].real = (int16_t) (temp);
    
                temp = (int32_t) MATHUTILS_ROUND_FLOAT(-scal * rxSym[i].imag);
                MATHUTILS_SATURATE16(temp);
                compRxChanCfg->rxChPhaseComp[staticCfg->txAntOrder[txIdx] * numRxAntennas
                                             + rxIdx].imag = (int16_t) (temp);
            }
        }
    }

    Regards,
    Kei

  • Hi Kei,

    The purpose of this scal line is to scale the complex numbers down by the magnitude of the minimum-magnitude response, just like your diagram shows (though I think without the complex conjugation).

    Best,

    Nate

  • Hi Nathan,

    I apologize for bothering you with so many questions, but could you explain why it is necessary to scale the complex numbers down by the magnitude of the minimum-magnitude response?

    Regards,
    Kei

  • Hi Kei,

    Similarly, the multiplication by complex conjugate achieves phase compensation. The use of minimum of the data set allows for maximal utilization of the 16-bits of fixed point precision to represent the coefficients

    The purpose of this is to achieve maximal utilization of the 16 bites of fixed point precision.

    Best,

    Nate

  • Hi Nathan,

    Thank you for your response. I understand that the purpose is to achieve maximal utilization of the 16 bites of fixed point precision.
    However I think that the goal is to compensate for the gain imperfections of each antenna. Is my understanding correct?

    Regards,
    Kei

  • HI Kei,

    Yes your understanding is correct.

    Best,

    Nate

  • Hi Nathan,

    Then, what is the purpose to compensate for the gain imperfections of each antenna? (This is exactly what I want to know.)

    Regards,

    Kei

  • Hi Kei,

    The purpose of compensating the gain imperfections is in case one of the antennas is significantly more or less sensitive than another. If this were the case, then the angle estimate will be degraded. That's why they are scaled down.

    Best,

    Nate

  • Hi Nathan,

    Thank you for answering various things. I understand.

    Regards,
    Kei