此文为网友解惑:
rtklib中有一个通过观测值的失锁标识符来检测周跳的函数如下:
/* detect cycle slip by LLI --------------------------------------------------*/
static void detslp_ll(rtk_t *rtk, const obsd_t *obs, int n)
{
int i,j;
trace(3,"detslp_ll: n=%d\n",n);
for (i=0;i<n&&i<MAXOBS;i++) for (j=0;j<rtk->opt.nf;j++) {
if (obs[i].L[j]==0.0||!(obs[i].LLI[j]&3)) continue;
trace(3,"detslp_ll: slip detected sat=%2d f=%d\n",obs[i].sat,j+1);
rtk->ssat[obs[i].sat-1].slip[j]=1;
}
}
关于失锁标识符的解释是这样的:
Loss of lock indicator (LLI). | |
| 0 or blank: OK or not known | |
| Bit 0 set : Lost lock between previous and current | |
| observation: Cycle slip possible. | |
| For phase observations only. | |
| Bit 1 set : Half-cycle ambiguity/slip possible. | |
| Software not capable of handling half cycles | |
| should skip this observation. | |
| Valid for the current epoch only. | |
| Bit 2 set : Galileo BOC-tracking of an MBOC-modulated signal| |
| (may suffer from increased noise).
什么意思呢?
对于一个二进制数,Bit 0 set表示将第0位设置为1,也就是这样:
0001
不就是1吗?
同理:
Bit 1 set -> 0010
Bit 2 set -> 0100
分别是2和4。并且我们可以知道,失锁标识符最大的情况是0111
,也就是十进制的7。
通过说明可以知道,当Bit 0 set或Bit 1 set 时可能有周跳发生,也就是0,1位为1的时候,那么可能发生周跳的情况为:
0001 -> 1
0010 -> 2
0011 -> 3
0101 -> 5
0110 -> 6
0111 -> 7
既然我们知道第0位或第1位为1时可能有周跳,那么任意一个失锁标识符与0011
取&
不为0时可能有周跳,也就是程序中的与3
取&
可能有周跳。
补充:为什么任意一个失锁标识符与0011
取&
不为0时可能有周跳?
我们知道:
0010
&
0011
=
0010
那么任意一个失锁标识符与0011
取&
不为0时,该失锁标识符在零位一位必然有至少一个为1,通过失锁标识符的含义可知这两位有一个为1便有周跳的可能。