## 2 Theory
### Sampling Scheme Based on Binary Fringe Correction (BFC)  
In the decoding process of a rolling shutter effect (RSE)-based underwater optical camera communication (UOCC) system, conventional clock recovery (CR) based on a synchronization head is widely used. However, due to the exposure overlapping effect [19], the duration of the received synchronization header may not be an integer multiple of bit duration. Although the interpolation scheme was proposed in [23; 24] to increase the effective sampling points for synchronization and demodulation, binary fringes whose length is not an integral multiple of the sampling interval will still be obtained after thresholding, which will lead to dislocation sampling, as shown in Figure 2.  
To solve this situation, a binary fringe correction (BFC) method is proposed in this paper; the flow chart is shown in Figure 3. Firstly, linear interpolation is used to make the fringe width of one bit be odd and recorded as X. After thresholding, a binary sequence containing only 0 or 1 is obtained. Then, according to the statistics of the black and white stripes, the arrays \(L_{1}\) and \(L_{2}\) (containing the length elements of the black and white stripes, respectively), and the arrays \(P_{1}\) and \(P_{2}\) (containing the starting position elements of the black and white stripes, respectively) are obtained. One case is that the first element of \(P_{1}\) is less than that of the corresponding position of \(P_{2}\), which means that the dark stripe will be recovered preferentially. Then fringe correction is executed, which is done by increasing the index \"cursor\" in the array \(L_{1}\). The next step is to check the length of the dark fringe. When the fringe length of the corresponding position of \"cursor\" (\(L_{1}(cursor)\) or \(L_{2}(cursor)\)) is less than \(\left\lfloor\frac{1}{3}X\right\rfloor\), it is considered to be caused by noise that can be neglected, where \([\cdot]\) is a rounding symbol (for example \([4.85]=5\), \([3.2]=3\)). In this case, the next corresponding bright stripe will be restored. Otherwise, the fringe will be corrected based on the multiple of X and the recovery of dark and bright stripes is done alternately. For instance, if the number of pixel rows occupied by a bit is 9 after interpolation, a black stripe of length 7 will be corrected to 9, the next white stripe of length 38 will be corrected to 36, and so on.  
It is worth noting that the length of \(L_{1}\) and \(L_{2}\) will always differ by 1 due to the alternate appearance of dark and bright stripes. The loop will stop until the cursor moves to the end of the shorter one between \(L_{1}\) and \(L_{2}\). Finally, for the longer array (\(L_{1}\) or \(L_{2}\)), we should correct the corresponding fringe again. In the other case, the operation is similar, but the bright stripe will be restored preferentially. What is more, in order to guarantee that each sampling can obtain the value exactly in the middle of the fringe, it is necessary to ensure that one bit occupies an odd number of pixel rows after interpolation.  
Figure 2: Schematic diagram of sampling offset and the binary fringes correction (BFC) method.