# Standalone GPS L1 C/A Receiver for Lunar Missions
## 2 The _WeakHEO_ Receiver Architecture
### GPS Tracking  
#### 2.6.1 Bit Synchronisation and Navigation Data Decoding from very Weak Signals  
Following the acquisition stage, the acquisition engine passes its estimates of Doppler, Doppler rate, code offset and bit position to the tracking channel and is then free to look for the next satellite. The position of the navigation data bit edge must be located and confirmed. This is necessary as although the acquisition uses full navigation data bit length accumulations of 20 ms, it only computes 10 branches spaced 2 ms apart to reduce complexity. In the tracking channel 20 branches, spaced 1 ms apart are then formed and accumulated to confirm the bit edge position. During this process the tracking channel operates a low bandwidth FLL (0.2 Hz) initialised with the estimation of Doppler, Doppler rate, code offset and bit position from the acquisition engine. Following confirmation of the bit edge position, decoding of the navigation data bits is started. The theoretical probability of a navigation data bit error of the C/A code signal assuming carrier phase tracking is given by [23]:  
\[P_{B}=\frac{1}{2}erfc\left(\sqrt{c/n_{0}\tau_{a}}\right) \tag{7}\]  
where \(erfc\) is the complementary error function, \(c/n_{0}\) is the carrier to noise density ratio (scalar) and \(\tau_{a}\) is the accumulation time (20 ms for C/A code). The probability of a bit error is 0.13 at a \(C/N_{0}\) of 15 dB-Hz and 0.056 at 18 dB-Hz. A \(C/N_{0}\) of 27.5 dB-Hz is required to give a probability of bit error of \(10^{-6}\). As each subframe is 300 bits long, this probability would result in less than one contaminated subframe in every 3000. However, as shown in [29; 30], the fact that the message is regularly repeating can be exploited to effectively increase the accumulation time and reconstruct the message at weaker signal levels. The data decoding procedure can be divided into two steps, the first step is frame synchronization (finding the preamble), the second step is to decode the desired data from multiple subframe repetitions. As depicted in Figure 10, each GPS frame contains 5 sub-frames. Every sub-frame has 6 s duration. It starts with a known 8 bit preamble and consists of 10 words. Each word has 30 bits. The preamble marks the beginning of each sub-frame and is repeated every 6 s.  
The following steps are used to find out the position of the preamble from received data (see also Figure 11). 1. Store 20 frames (_i.e._, 20 \(\times\) 30 s, or 100 sub-frames, _i.e._, 30,000 bits) of original demodulated data in a vector \(A\). 2. Search for all the preamble-like sequences. Find all the likely preambles of vector \(A\), and store these correlation values in vector \(B\). Due to the possible 180\({}^{\circ}\) phase ambiguity induced by phase tracking and the chance of cycle slips with weak signals, positive and negative correlations are searched for. 3. Matrix \(C\) is generated by reshaping the correlation vector \(B\) into sub-frame length rows. Each column then represents a possible preamble location in the sub-frame. The size of this matrix is 300 \(\times\) 100. The absolutes values of matrix \(C\) are then accumulated down the columns to form a vector \(D\). Figure 10: GPS frame structure. The three largest correlations of vector \(\mathbf{D}\) are recorded. The largest value should be the correct position of the preamble, however, with weak signals other possible locations may need to be checked. 5. The first position is assumed correct, the vector \(\mathbf{A}\) reshaped into a matrix of sub-frame length rows and the sub-frame number from each successive sub-frame is checked after column wise accumulation. If the sub-frame number is incrementing correctly, this position is declared correct and used in subsequent processing. Otherwise, the other probable positions of the preamble are checked. Assuming the signal is tracked consistently throughout, after preamble correlation and column wise accumulation, the right position of preamble will be found and the sub-frame will be synchronized.