目录
1 LLI方式检测周跳
/* detect cycle slip by LLI --------------------------------------------------*/
/* args : rtk_t *rtk IO gps solution structure
* obsd_t *obs I satellite observations
* int i I index of obs
* int rcv I 1: rover receiver; 2: base receiver
*/
static void detslp_ll(rtk_t *rtk, const obsd_t *obs, int i, int rcv)
{
unsigned int slip,LLI;
int f,sat=obs[i].sat;
trace(3,"detslp_ll: i=%d rcv=%d\r\n",i,rcv);
for (f=0;f<rtk->opt.nf;f++) { //nf是频点个数(1:L1,2:L1+L2,3:L1+L2+L5)
if (obs[i].L[f]==0.0|| //L当前相位
fabs(timediff(obs[i].time,rtk->ssat[sat-1].pt[rcv-1][f]))<DTTOL) {
continue;
}
/* restore previous LLI */
if (rcv==1) LLI=getbitu(&rtk->ssat[sat-1].slip[f],0,2); /* rover */
else LLI=getbitu(&rtk->ssat[sat-1].slip[f],2,2); /* base */
/* detect slip by cycle slip flag in LLI */
if (rtk->tt>=0.0) { /* forward */
if (obs[i].LLI[f]&1) {
errmsg(rtk,"slip detected forward (sat=%2d rcv=%d F=%d LLI=%x)\r\n",
sat,rcv,f+1,obs[i].LLI[f]);
}
slip=obs[i].LLI[f];
}
else { /* backward */
if (LLI&1) {
errmsg(rtk,"slip detected backward (sat=%2d rcv=%d F=%d LLI=%x)\r\n",
sat,rcv,f+1,LLI);
}
slip=LLI;
}
/* detect slip by parity unknown flag transition in LLI */
if (((LLI&2)&&!(obs[i].LLI[f]&2))||(!(LLI&2)&&(obs[i].LLI[f]&2))) {
errmsg(rtk,"slip detected half-cyc (sat=%2d rcv=%d F=%d LLI=%x->%x)\r\n",
sat,rcv,f+1,LLI,obs[i].LLI[f]);
slip|=1;
}
/* save current LLI */
if (rcv==1) setbitu(&rtk->ssat[sat-1].slip[f],0,2,obs[i].LLI[f]);
else setbitu(&rtk->ssat[sat-1].slip[f],2,2,obs[i].LLI[f]);
/* save slip and half-cycle valid flag */
rtk->ssat[sat-1].slip[f]|=(unsigned char)slip;
rtk->ssat[sat-1].half[f]=(obs[i].LLI[f]&2)?0:1;
}
}
- 由于前向处理和后向处理,在利用LLI进行周跳判断上有所不同。因此在处理过程中,仅以前向为例;
- LLI=getbitu(&rtk->ssat[sat-1].slip[f],0,2); 首先将上一历元该卫星的周跳标志取出存在LLI变量中,该变量之后会用来判断上一历元和当前历元,半周跳标志(LLI&2,即LLI的bit 1位)是否发生变化;
- slip=obs[i].LLI[f];将当前历元原始观测量中的LLI赋值给slip变量;
- 如果上一历元和当前历元的半周跳标志不同,则认为有周跳,将slip的第0位置1;
- 存放当前历元的LLI和周跳。
注:后向处理和前向处理之间的区别:仔细观察代码,会发现后向处理中,判断周跳利用的是前一历元的LLI,而不是当前历元的LLI,而前向处理,使用的是当前历元的LLI。原因:假设一组连续8个历元的整周模糊度为:1-1-1-1-50-50-50-50,在历元5时,LLI=1。那么在前向处理时,将第5个历元标记为周跳是没问题的,因为在历元5,整周模糊度由1跳变为50。但是在后向处理时,虽然原始数据中历元5的LLI为1,但是实际周跳应该在历元4,因为后向处理时,历元4的整周模糊度由50跳变为1。
2 MW方式检测周跳
- GF组合本质上是计算。如果没有周跳发生,那么上一历元和当前历元的GF值应该是一致的。
- GF组合根据其表达式可以推导其噪声:σ G F = 2 σ L \sigma_{GF}=\sqrt{2}\sigma_LσGF=2σL。该周跳检测的阈值也可以根据噪声水平进行设定,GAMP中同样也根据采样间隔和高度角对阈值进行了调整,感兴趣可以参考其论文和代码。