IWR6843ISK-ODS: Modification in CFAR HWA config

Part Number: IWR6843ISK-ODS

Tool/software:

Hi,

In TI's firmware, the CFAR config (in HWA) takes input as uint16_t and log2mag. But I have modified the config parameters to take the input as uint32_t and magnitude squared. I have validated the magnitude square value which I got from doppler FFT. That is proper. But I'm not sure whether I'm getting the correct output from the CFAR HWA. But overall my detected points are wrong (getting dopplerIdx as 0 for all detected points in the DPIF_CFARDetList struct).

The modified parameters in CFAR HWA config is mentioned below :
In CFAR HWA config :
hwaParamCfg.source.srcAIdx = numDopplerBins * sizeof(uint32_t); // range domain
hwaParamCfg.source.srcBIdx = sizeof(uint32_t); // range domain
hwaParamCfg.source.srcAIdx = sizeof(uint32_t); // doppler domain
hwaParamCfg.source.srcBIdx = numDopplerBins * sizeof(uint32_t); // doppler domain
hwaParamCfg.source.srcWidth = HWA_SAMPLES_WIDTH_32BIT;
hwaParamCfg.accelModeArgs.cfarMode.operMode = HWA_CFAR_OPER_MODE_MAG_SQR_INPUT_REAL;
In CFAR EDMA config :
syncACfg.aCount = staticCfg->numRangeBins * staticCfg->numDopplerBins * sizeof(uint32_t);
Other than above params do I need to change any other parameters in the CFAR config (in HWA) and CFAR process or any threshold values in cfarCfg (in configuration file)?
Looking forward for your response.
Thanks & Regards
Sathya Prabha M
  • Hello.

    Is there a reason why you are changing from uint16 to uint32?  By changing the type you will be changing how much information from the L3 data you pull into the CFAR computation, and if the appropriate changes in the doppler DPU and the memory configuration in DPC_config aren't accounting for this you could be using incorrect data which could lead to the results you are seeing.

    Sincerely,

    Santosh

  • Hi Santosh,

    I have modified the output of doppler FFT as uint32_t and magnitude (not log2mag). Then squared the magnitude values to get the magnitude square value. So to feed that doppler FFT output as CFAR HWA input I have changed the HWA source params. The changes you mentioned was doppler DPU (which is already done). Also I have changed the memory configurations in the below lines :

    #define DPC_OBJDET_DET_MATRIX_DATABUF_BYTE_ALIGNMENT       (MAX(sizeof(uint32_t), \
                                                                    DPU_CFARCAPROCDSP_DET_MATRIX_BYTE_ALIGNMENT)) // modified as uint32_t 
    I hope you are mentioning about the above code changes in DPU_config.
    Also I changed the detMatrix.dataSize like below :
    detMatrix.dataSize = staticCfg->numRangeBins * staticCfg->numDopplerBins * sizeof(uint32_t);
    Other than this do I have to change any other memory configurations to match this HWA CFAR input?
    Or Am I missing any parameters in HWA CFAR config and CFAR process (like SNR and noise calculation)?
    Thanks & Regards
    Sathya Prabha M
  • Are you modifying the paramsets in the CFAR DPU in the cfarproc_configParser functions to account for when making this size change?   This would probably need to be done as well.  Is there a reason why you are changing all the DPU inputs/outputs to uint32t(I assume since you changed doppler you changed range and angle as well)?

    Sincerely,

    Santosh

  • Hi Santosh,  

    Sorry for the late reply.

    Yes, I changed the cfar config parser functions. Since this is a customer query I'm changing this. 

    As per the HWA documentation, for log2mag mode, CUT > threhsoldScale + noise

    for linear mode, CUT > threshold * noise

    noise = noise_sum/2^divshift

    Also, the threshold is interpreted as 14.4 format for linear mode and it is 7.11 for log mode.

    For ex :  thresholdScale is set as 15 (from cfg file). As per the below code snippet, the thresholdScale is converted to 1500.

    threshold = threshold * MMWDEMO_CFAR_THRESHOLD_ENCODING_FACTOR;
     cfarCfg.thresholdScale    = (uint16_t) threshold;
     
    After, it will go into the MmwDemo_convertCfarToLinear() API and its output will be 480 (which is written into the CFAR_THRESH register).
    So this 480 is interpreted as 7.11 format for log scale (i.e 480/2^11).
    Similarly, what will be equivalent thresholdScale for linear mode (magsqr) and its calculation?

    Also, if the output of doppler FFT is log2mag, the cfar threshold (i.e 15 dB) will be converted from dB to log2mag mode. Similarly if the output of doppler FFT is magnitude square, then the cfar threshold should be converted from dB to magsqr (which is linear scale mode). For that, we have to change in MmwDemo_convertCfarToLinear() function also. Could you please guide me to change the function accordingly?

    Kindly provide responses to both of the above queries.

    Thanks & Regards
    Sathya Prabha M
  • Hi Santosh, 

    Please reply to the above query.

    Also, From configuration file, the cfar threshold value is 15 (which is uint16_t), but that value is written into the 18bit HWA register(CFAR_THRESH). Can you explain how CFAR HWA is storing the 16bit value into the 18bit register?

    I anticipate your reply.

    Thanks & Regards

    Sathya Prabha M

  • Hi Santosh, 

    Any update on this. Kindly reply on this thread.

    Thanks & Regards

    Sathya Prabha M

  • Hello Sathya.

    Similarly, what will be equivalent thresholdScale for linear mode (magsqr) and its calculation?

    I believe the scaling is done in the HWA code which should just be 10^(dB/20) as the log scaling is dB = 20 * log(threshold).

    Also, From configuration file, the cfar threshold value is 15 (which is uint16_t), but that value is written into the 18bit HWA register(CFAR_THRESH). Can you explain how CFAR HWA is storing the 16bit value into the 18bit register?

    The actual writing into that register is not publicly available but I believe the value is just 0 padded to fit in the 18-bit field.

    For that, we have to change in MmwDemo_convertCfarToLinear() function also. Could you please guide me to change the function accordingly?

    It should be the same as the formula in this function.  I'm not quite sure why you need to change the scaling if you are changing to uint32_t.  I want to come back to the reason for this change because I don't think it will make any impact on the result of the CFAR output.  Can you pleas explain what the overall change you are trying to affect by going from uint16 to uint32?

    Sincerely,

    Santosh