[OpenSource_GPS] How to calculate the CN0

Dongsheng Song cninsds at gmail.com
Fri Mar 9 00:34:09 PST 2007


           Hello everyone,
           I looked into the opensourcegps program, and found the formula
calculating CN0 is Chan[ch].CN0 = 10.0 * log10( Chan[ch].avg_20ms /
1395.0*Chan[ch].avg_20ms /
1395.0 * 25.0 * 1.7777 + 1.0) . I know the CN0(db) = 10 * log10(C/N),but i
can't understand that form with so many constants. Who can help me to
explain the meaning of Chan[ch].avg_20ms and the derivation of the
constants. I am also confused with the program below. What is the mean of
the pull_code_k,the pull_code_d and the carrier form.

pull_code_k =  50, pull_code_d =  7,
       pull_carr_k = -12, pull_carr_d = 28,
       phase_test  = 500, rms = 312;

//  GP2021 has two tracking arms only: prompt & dither
  i_sum = Chan[ch].i_prompt + Chan[ch].i_dith;
  q_sum = Chan[ch].q_prompt + Chan[ch].q_dith;
//  i_sum = Chan[ch].i_prompt;
//  q_sum = Chan[ch].q_prompt;

  prompt_mag   = rss( Chan[ch].i_prompt, Chan[ch].q_prompt);
  dith_mag     = rss( Chan[ch].i_dith, Chan[ch].q_dith);
  Sum[ch] += prompt_mag + dith_mag;

// code tracking loop
  if ( prompt_mag != 0 || dith_mag != 0)
  {
    Cod_Phs[ch] = RT_Ctrl->earlylate * pull_code_k *
      ((prompt_mag - 2 * dith_mag) << 14) /
       (prompt_mag + 2 * dith_mag);

    dcod_phs = pull_code_d *
      (Cod_Phs[ch] - Cod_Phs_Prv[ch]);

//  don't close the loop for 2 ms to avoid transients
    if ( Pull_In_Count[ch] > 2 )
    {
      Chan[ch].cod_frq += (Cod_Phs[ch] + dcod_phs) >> 14;
//      Chan[ch].cod_frq += ((pul_cod_c1 + pul_cod_c2) * Cod_Phs[ch] +
//                          - pul_cod_c1 * Cod_Phs_Prv[ch]) >> 14;
//      rt_printk("ch_pull_in(): ch_code -> Chan[%d].cod_frq\n", ch,
Chan[ch].cod_frq);
      ch_code( ch, Chan[ch].cod_frq);
    }
  }
  Cod_Phs_Prv[ch] = Cod_Phs[ch];

  Best Regards
  Dongsheng Song
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.psas.pdx.edu/pipermail/opensource_gps/attachments/20070309/d7dd521b/attachment.htm 


More information about the opensource_gps mailing list