How to calculate the CN0
"Dongsheng Song" <[email protected]> Fri, 9 Mar 2007 16:34:09 +0800
| Newsgroups | gmane.comp.hardware.gps.opensource |
|---|---|
| Message-ID | <[email protected]> |
--===============5143853342367001017==
Content-Type: multipart/alternative;
boundary="----=_Part_87409_4467966.1173429249516"
------=_Part_87409_4467966.1173429249516
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
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
------=_Part_87409_4467966.1173429249516
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
<div> Hello everyone,</div>
<div> 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.
</div>
<div> </div>
<div>pull_code_k = 50, pull_code_d = 7, <br> pull_carr_k = -12, pull_carr_d = 28,<br> phase_test = 500, rms = 312;</div>
<p>// GP2021 has two tracking arms only: prompt & dither<br> i_sum = Chan[ch].i_prompt + Chan[ch].i_dith;<br> q_sum = Chan[ch].q_prompt + Chan[ch].q_dith;<br>// i_sum = Chan[ch].i_prompt;<br>// q_sum = Chan[ch].q_prompt;
</p>
<p> prompt_mag = rss( Chan[ch].i_prompt, Chan[ch].q_prompt);<br> dith_mag = rss( Chan[ch].i_dith, Chan[ch].q_dith);<br> Sum[ch] += prompt_mag + dith_mag;</p>
<p>// code tracking loop<br> if ( prompt_mag != 0 || dith_mag != 0)<br> {<br> Cod_Phs[ch] = RT_Ctrl->earlylate * pull_code_k * <br> ((prompt_mag - 2 * dith_mag) << 14) /<br> (prompt_mag + 2 * dith_mag);
</p>
<p> dcod_phs = pull_code_d * <br> (Cod_Phs[ch] - Cod_Phs_Prv[ch]);</p>
<p>// don't close the loop for 2 ms to avoid transients<br> if ( Pull_In_Count[ch] > 2 )<br> {<br> Chan[ch].cod_frq += (Cod_Phs[ch] + dcod_phs) >> 14;<br>// Chan[ch].cod_frq += ((pul_cod_c1 + pul_cod_c2) * Cod_Phs[ch] +
<br>// - pul_cod_c1 * Cod_Phs_Prv[ch]) >> 14;<br>// rt_printk("ch_pull_in(): ch_code -> Chan[%d].cod_frq\n", ch, Chan[ch].cod_frq);<br> ch_code( ch, Chan[ch].cod_frq);
<br> }<br> }</p>
<div> Cod_Phs_Prv[ch] = Cod_Phs[ch];</div>
<div> </div>
<div> Best Regards</div>
<div> Dongsheng Song</div>
------=_Part_87409_4467966.1173429249516--
--===============5143853342367001017==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
opensource_gps mailing list
[email protected]
http://lists.psas.pdx.edu/cgi-bin/mailman/listinfo/opensource_gps
--===============5143853342367001017==--