# Performance Analysis of a Color-Code-Based Optical Camera Communication System
## 3 Test and Results
### Bit Error Ratio Test  
The color matching and color sensitivity of the CMOS camera used in the receiver varies according to the manufacturer. During the tests, RGB and HSV color spaces were used with the receiver camera to demonstrate their performance in decoding. In order to determine the bit error ratio of the designed color-coded VLC system, a data packet consisting of 2400 bits was generated, as shown in Figure 13. For this purpose, first the six-character text \"Li-Fi\" and then the six-character text \"#Test-\" were sent 25 times consecutively. Since each color channel represents 3 bits, there are 48 bits in total in 16 color channels, and when 50 frames are sent, there are 2400 bits, i.e., 300 bytes of data are transmitted. There is a delay time of \(\Delta\)t between frames and this time can be changed in the software on the transmitter side. Figure 12: Overview of the test system. Figure 13: Test scenario for detecting the number of erroneous bits. In order to detect the number of erroneous bits depending on the communication rate, the delay time between frames was chosen as 1 s, 0.2 s, 0.1 s, and 0.05 s. These delay times correspond to data transmission rates of 48 bps, 240 bps, 480 bps, and 960 bps, respectively. At these communication rates, the number of erroneous bits was determined for a distance of 120 cm, 220 cm, and 320 cm. Tables 1 and 2 show the variations in the number of erroneous bits for RGB and HSV color spaces depending on the distance and data rate. Table 1 shows how many bits in a 2400-bit data packet are received incorrectly when decoding with RGB color space at the receiving unit. When frames were sent at 1 s intervals, it took 50 s to send the 2400-bit data packet. At a distance of 120 cm, the 2400-bit data packet was received without error. When the distance between the monitor and the camera was 220 cm, the number of erroneous bits was 2. For a distance of 320 cm, 13 bits were detected incorrectly. When the data transmission rate was increased, the number of erroneous bits increased. At 960 bps, the transmission time for a 2400-bit data packet is 2.5 s. The number of erroneous bits was 196 bits for 120 cm, 707 bits for 220 cm, and 910 bits for 320 cm. Table 2 shows how many bits in a 2400-bit data packet are received incorrectly when decoding with the HSV color space at the receiving unit. At 48 bps, error-free data transmission was achieved up to a distance of 320 cm. At 960 bps, the number of erroneous bits was 154 bits for 120 cm, 643 bits for 220 cm, and 832 bits for 320 cm. It was observed that the error rate was lower when using the HSV color space compared to the RGB color space. Figure 14 plots the number of erroneous bits for RGB and HSV color spaces using the values in Tables 1 and 2. The environment where the tests were carried out was illuminated with a room lamp and no external lighting was used. The lamp was not switched on and off during the tests. In the RGB color space, as the distance between the transmitter and receiver increases, the contrast values between the colors get closer to each other and the error rate increases during the decoding phase. As can be seen in Figure 14, when the communication speed increased, the error rate increased more in the RGB color space than in the HSV color space. This is because the negative effects of the camera during exposure exceed the threshold value in the RGB color space. Although the phone used has 120 frame/s capability, due to the distorting effect of exposure, the system speed dropped to 40 frame/s. The tests were conducted up to a maximum speed of 20 frame/s. In the HSV color space, decoding is not based on the brightness of the color. For example, it is easier to distinguish a very bright red color from a less bright red color in the HSV color space. As the brightness of the