Tool/software: Code Composer Studio
Hi,
In the SDK 3.2,the CFAR SNR expressed in 0.1 steps of dB is computed by the following formula:SNR=10*10lg(abs(S/N)^2),if I want to compute the variance according to CRLB,the fuction convertSNRdBToVar should be modified as follows:
float convertSNRdBToVar(uint16_t SNRdB,uint16_t bitW, uint16_t n_samples, float resolution)
{
float fVar, RVar;
int32_t inputActual;
float scaleFac = (n_samples*resolution);
float resThresh = 2 * resolution * resolution;
// float invSNRlin = antilog2(-SNRdB, bitW) * 2;
float invSNRlin = antilog10((int32_t)(-SNRdB), 100) * 2; // My modification We assume our estimator is 3dB worse than the CRLB.
/* CRLB for a frequency estimate */
#ifdef MATLAB
fVar = (float)invSNRlin * (6.0f/((2.0f*PI_)*(2.0f*PI_)))/(n_samples*n_samples - 1);
#else
fVar = (float)invSNRlin * (6.0f/((2.0f*PI_)*(2.0f*PI_))) * recipsp((n_samples*n_samples - 1));
#endif
/* Convert to a parameter variance using the scalefactor.*/
RVar = fVar*scaleFac*scaleFac;
if (RVar < resThresh)
{
RVar = resThresh;
}
return RVar;
}
The function antilog10 is defined as:
float antilog10(int32_t inputActual, uint16_t frac)
{
float output;
float input = (float)inputActual;
input = divsp(input , (float)(frac));
output = exp10sp(input);
return output;
}
The invSNR(equal to (N/S)^2) is computed by the function antilog10.Can anybody tell me my modifiction is right or not?
Thanks,
Regards,
Rata