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.

CCS/AWR1843BOOST: Some questions about the function convertSNRdBToVar in the MRR demo

Part Number: AWR1843BOOST

Tool/software: Code Composer Studio

Hi,

  In the MRR demo,there is a function convertSNRdBToVar,which is defined as follows:

float convertSNRdBToVar(uint16_t SNRdB,uint16_t bitW, uint16_t n_samples, float resolution)
{
    float fVar, RVar;
    float scaleFac  = (n_samples*resolution);
    float resThresh = 2 * resolution * resolution;//question 2
    float invSNRlin = antilog2(-SNRdB, bitW) * 2; // We assume our estimator is 3dB worse than the CRLB.
    
    /* CRLB for a frequency estimate */
    fVar = (float)invSNRlin * (6.0f/((2.0f*PI_)*(2.0f*PI_))) * recipsp((n_samples*n_samples - 1));
        
    /* Convert to a parameter variance using the scalefactor.*/
    RVar = fVar*scaleFac*scaleFac; //question 1
   
    if (RVar < resThresh)  //question 3
    {
        RVar = resThresh;
    }
    return RVar;
}

1. The variable  scaleFac is a scale factor,why is this variable introduced?

2.The variable resThresh is equal to 2 * resolution * resolution, what does that means?

3.After the variable RVar is obtained, why does RVar  compare with resThresh?

4.Generally,the conditon RVar < resThresh is almost satisfied in all cases, beacuse according to the formula:

RVar = fVar*scaleFac*scaleFac

        =(float)invSNRlin * (6.0f/((2.0f*PI_)*(2.0f*PI_))) * recipsp((n_samples*n_samples - 1))*(n_samples*resolution)*(n_samples*resolution)

        =invSNRlin* (3.0f/((2.0f*PI_)*(2.0f*PI_))) * recipsp((n_samples*n_samples - 1))*n_samples*n_samples*(2 * resolution * resolution)

because recipsp((n_samples*n_samples - 1))*n_samples*n_samples≈1:

        ≈invSNRlin* (3.0f/((2.0f*PI_)*(2.0f*PI_))) *(2 * resolution * resolution)

        =invSNRlin* (3.0f/((2.0f*PI_)*(2.0f*PI_))) *resThresh

because invSNRlin<1:

    =>  RVar <(3.0f/((2.0f*PI_)*(2.0f*PI_))) *resThresh

because (3.0f/((2.0f*PI_)*(2.0f*PI_)))<1:

    =>   RVar< resThresh

It seems like the CRLB is needless.

Thanks,

Regards,

Rata

  • Hi Rata,

    The demo is a reference code for customers to get started. If you think there a better and efficient way to implement the same you can incorporate the same in your design/algorithm code.

    I would check with algo team about your queries and get back to you. 

    Thanks,

    Raghu

  • Thanks,I look forward for your reply.

  • Hi Rata, 

    1. The variable  scaleFac is a scale factor,why is this variable introduced?

    To convert the variance from 'frequency domain' to the required variable's domain.

    2.The variable resThresh is equal to 2 * resolution * resolution, what does that means?

    We wanted the minimum CRLB variance to be at-least  '2 * resolution * resolution' - in order to help the kalman filter stability. You can experiment with differnt resThresh values to see what suits your kalman filter better.  

    3.After the variable RVar is obtained, why does RVar  compare with resThresh?

    See above.

    4.Generally,the conditon RVar < resThresh is almost satisfied in all cases, beacuse according to the formula:

    That is correct. In an earlier version, this condition didn't exist, which resulted in some instability in the Kalman filter. You can experiment by removing this requirement, and seeing the performance of the Kalman filter. 

    Regards

    Anil

  • Thank you,I will try.