## 4 Implementation
### Proposed Modulation Scheme  
As illustrated in Figure 3, our system applies an LED array, which is formatted into a spatial frame to guarantee synchronization between the light source and camera during data transmission. The four external LED areas are delineated by blue squares, which are strategically designed for angle detection. Figure 4 shows BER curve for the optical OOK modulation. By detecting the four corners of the LED array, the positions of all LEDs are readily computed through perspective transformation. With the purpose of data transmission, our scheme utilizes 40 LEDs to encode data, as visually depicted in Figure 5. A distinctive feature of our approach involves the introduction of four position anchor components situated at the corners, as illustrated in Figure 5. Additionally, particular attention is paid to the location of corner 3 to support spinning on the decoder part. The training signal segment is made up of 16 LEDs that are labeled as position anchors. These LEDs use the zeros crossing technique to help the camera distinguish between the \"on\" and \"off\" states of each LED. Furthermore, preamble is added to every data frame so that the receiver can determine the commencement of the frame more easily.  
Figure 3: System architecture of the deep-learning decoder for threshold prediction.  
Line coding and the deep-learning decoder technique were used to increase the SNR, which in turn increased the communication distance. Further, deep-learning algorithms were incorporated to aid in the detection of multiple LED arrays, particularly in the presence of mobility effects, aiming to boost the overall OCC system. Each captured image corresponds to a data packet and it makes data synchronization between the receiver and transmitter difficult in practice owing to the unstable frame per second (fps) of the camera. For example, if the camera parameter specified by the manufacturer is 30 fps, in reality, the frame rate per second may fluctuate above or below the 30 fps threshold. This must be taken into account and controlled to ensure the performance of the OCC system. Owning to the data packet rate on the transmitter side is almost constant, which makes undersampling and oversampling phenomena occur on the camera side. In the case that the data packet rate sent in 1 s is greater than the camera frame rate in 1 s, the undersampling phenomenon will occur, causing the camera to be unable to keep up with the data packets one by one in a sequence, resulting in missing data, which affects the system's data transmission and reception. On the other hand, if the speed of the data packet sent in one second is lower than the frame rate of the camera in one second, oversampling occurs. The camera may capture a data packet two to three times, resulting in redundancy and duplicate data. To solve the two cases of oversampling and undersampling, we propose to use SN as the identifier for each data packet. This makes data decoding easier and achieves the highest accuracy. The camera parameters and implementation requirements determine the SN length that can be adjusted. Extended SN lengths are recommended in situations where the camera quality is low or the conditions are not ideal, which leads to a higher rate of  
Figure 4: BER curve for the optical OOK modulation.  
Figure 5: Spatial frame format in an LED array.  
packet loss. By contrast, the SN length shortens with a higher camera quality, which boosts system performance. In Figure 5, the SN length is 2 bits, and the preamble length is 6 bits. We can adjust the length of the SN and preamble depending on camera parameters and implementation requirements. The payload will be displayed in the data area with a length of 40 bits per frame, where the ON or OFF status of the LED represents either a 1 or 0 bit.