Universal and Effective Decoding Scheme for Visible Light Positioning Based on Optical Camera Communication

As a promising approach to implement indoor positioning, visible light positioning (VLP) based on optical camera communication (OCC) image sensor has attracted substantial attention. However, the decoding schemes of existing VLP systems still face many challenges. First, the transmission channel between transmitters and receivers can be easily affected by environmental changes, resulting in poor thresholding performance. Second, the inherently unsynchronized air transmission channel issue remains a big obstacle for decoding data. The above two problems limit the application of VLP systems, where various mobile devices are used as receivers and the properties of transmission channel are constantly changing with the movement of receivers. In this paper, a universal and effective decoding scheme named pixel-to-bit calculation (PBC) decoding algorithm for VLP systems is proposed and experimentally demonstrated. It includes a Staged Threshold Scheme which provides excellent thresholding performance for different transmission channel conditions, as well as a Synchronous Decoding Operation to automatically synchronize the clock between transmitters and receivers. A decoding rate of 95.62% at the height of 2.73 m is realized in a practical Robotic-based VLP system embedded with our proposed PBC decoding scheme. In addition, experimental results show that the average decoding rate of the proposed PBC decoding scheme reaches 99.9% when applying different transmitters and receivers.


Introduction
With the ever-growing demand for various indoor location-based services (LBS) [1], indoor positioning systems have attracted intensive investigations in recent years. However, Global Positioning System (GPS) cannot provide accurate indoor location information since the signals would be blocked by buildings. Due to the booming development of green lighting technology, visible light positioning (VLP) has attracted researcher's attention for its great potential in the field of indoor positioning [2][3][4]. Since the mounting locations of indoor LEDs are usually fixed, the LED lights can be used as artificial visual landmarks. Therefore, VLP systems can utilize the visible light beams as the medium to transmit related LED location information for further position calculation. Compared to other indoor positioning proposals, such as radio frequency identification (RFID) [5], wireless local area network (WIFI) positioning technology [6], and Bluetooth positioning technology [7], VLP can provide many advantages, such as immunity to electromagnetic interference and low power consumption, and can simultaneously achieve lighting and positioning. The hardware cost is also reduced greatly since VLP utilizes the common LED lights in modern buildings to provide accurate positioning without resorting to any other specialized infrastructure. Moreover, most mobile phones on the market are equipped with a Complementary Metal-Oxide-Semiconductor (CMOS) image sensor, which can be used as VLP receivers. Therefore, the image sensor (IS)-based VLP has a great advantage in realizing indoor positioning.
For IS-based VLP systems [8,9], at the transmitter, each LED is assigned with a unique identifier (UID) correlating to its accurate coordinate in real world. In addition, each UID data is combined with a fixed header to form a complete data packet, which will be transmitted repeatedly over the air by modulating the light intensity with on-off keying (OOK) modulation at a high frequency. As for the mobile receiver, the transmitted UID data are obtained through a decoding scheme. Meanwhile, the corresponding coordinate of LED in real world can be retrieved, with which the accurate position of the receiver can be calculated through positioning algorithm. The decoding process plays an important role in IS-based VLP systems since the positioning algorithm can only calculate the correct location under the premise that the decoding result is completely correct. However, the decoding process is rarely discussed or analyzed in many IS-based VLP system studies. Their default view is that the decoding process is completely correct or just simply neglected this issue, which is actually a significant part in VLP systems that is worth investigating.
As for decoding schemes, in [10,11], convolution neural network (CNN) method is used. However, it needs plenty of images for CNN training in advance, which is not practical in actual indoor positioning scenarios. In [12], a machine learning method is created to distinguish LEDs with different features, but it can only support a small number of LEDs. Moreover, other neutral network learning methods are also proposed to distinguish ID features [13][14][15][16]. Nevertheless, the above decoding schemes suffer high computational complexity and require large memory space. Actually, most conventional OCC decoding schemes [17][18][19] demodulate data through a thresholding scheme as well as a sampling scheme. The thresholding scheme is applied to transform the captured 2-dimensional (2D) picture into a 1D logic sequence composed of 0 s and 1 s. Various threshold schemes including Polynomial threshold (PL), Iterative threshold (IA) and Quick adaptive threshold (QA) have been proposed and evaluated in the previous paper [18]. In addition, an extreme value averaging (EVA) scheme [19] is proposed with better thresholding performance. However, the performance of these threshold algorithms will deteriorate if the properties of the transmission channel change such as the increase of transmission distance, the variation of the illumination, and so on. The parameters in these algorithms should be manually adjusted so as to get the optimal decoding results. Generally, the previous mentioned thresholding schemes can only perform well for a specific transmission channel condition. Hence, the existing threshold schemes need to be further enhanced to ensure good performance under different transmission channel conditions without adjusting algorithm parameters.
Furthermore, the sampling scheme is designed to synchronize the clock between LED transmitter and CMOS image sensor receiver to decode the accurate UID data. It applies a fixed sampling interval to extract as many effective sampling points as possible for synchronization. The value of sampling interval is determined by the LED transmitting frequency and the CMOS camera rolling rate. However, different CMOS image sensors usually have different camera rolling rates, which prevents the existing sampling scheme from coping with various receivers. In addition, the fact is that the camera rolling rate has not been provided in any commercial products. Therefore, an extra measurement experiment of camera rolling rate should be conducted to synchronize the clock between LED transmitter and CMOS image sensor receiver manually [20], which increases the difficulty and complexity of decoding. Moreover, the sampling scheme also leads to sampling frequency offset (SFO) which would deteriorate the decoding performance. Hence, a linear interpolation is usually applied to mitigate the SFO effect, which increases the processing time, calculation complexity as well as the memory capacity. In [21], a new sampling scheme based on length estimation (LE) is proposed. However, to estimate the bit duration, an extra synchronization operation is still needed to find two correct header locations. In fact, most existing decoding schemes can only achieve good performance with the help of an extra synchronization, which limits the application of VLP systems. In [22], a RollingLight system is built to enable light to talk to diverse off-the-shelf rolling shutter cameras without extra synchronization. However, it is only effective for Frequency Shift Keying (FSK) modulation. Consequently, the decoding scheme still requires an automatic synchronization function for OOK modulation to handle with different mobile phone receivers in practical scenarios.
In this paper, a universal and effective decoding scheme, named pixel-to-bit calculation (PBC) scheme, is proposed and experimentally demonstrated. This innovative approach provides an automatic synchronization function for different LED transmitters and CMOS image sensor receivers. Besides, it also has an excellent threshold performance which can resist environmental changes. More specifically, the proposed PBC decoding scheme firstly utilizes a Staged Threshold Scheme to obtain a 1D logic sequence, and then, a Synchronous Decoding Operation is designed to decode the right UID data through automatically synchronizing the clock between transmitters and receivers. Not only can the proposed PBC scheme resist environmental variation and remain high decoding rate for long transmission distance, but it can synchronize the clock between transmitters and receivers and be applied in different camera receivers simultaneously without adjusting parameters of the PBC scheme. Therefore, the proposed PBC decoding scheme can significantly promote the application of VLP systems in practical scenarios. Meanwhile, the designed Synchronization Decoding Operation method is a newly innovative way to synchronize the clock between transmitters and receivers, and it can be extended to other communication fields using unsynchronized air transmission channel or even water transmission channel [23] to solve the sampling offset issue. Furthermore, there is no interpolation or sampling operation during the whole decoding process, which provides low complexity and reduces the processing time as well as the required memory capacity. We embed the proposed PBC scheme in a Robotic-based VLP system, and the decoding rate can be up to 95.72% when the transmission distance is 2.73 m. Moreover, experimental results show that the average decoding rate of the proposed PBC scheme can reach 99.9% when tested with different LED transmitting frequencies and various mobile receivers. It is worth mentioning that this paper focuses on presenting our innovations in designing the decoding scheme. For a comprehensive understanding of positioning algorithm such as triple, double, or single LEDs positioning calculation algorithm in IS-based VLP systems, we refer readers to previous works [24][25][26][27], which have achieved an average positioning accuracy of 1-4 cm, and our contributions are as follows: (1) This paper proposed a novel thresholding method that can resist environmental changes when compared with previous thresholding schemes, which can improve the decoding performance thus enhance the robustness of visible light positioning application. (2) The novel proposed PBC scheme can automatically synchronize the clock between transmitters and different camera receivers, which shows excellent generalization ability and can ensure high decoding rate when different mobile phones are used in practical scenarios. (3) A decoding rate of 95.72% in a practical Robotic-based VLP system when the transmission distance is 2.73 m is realized, which makes it possible for visible light positioning to be applied in larger indoor places. (4) A series of ablation study experiments have been conducted to prove that the decoding rate of proposed PBC scheme would not be influenced by factors like frequency, camera ISO value, camera rolling rate, or code sequence, which shows the superiorities of proposed PBC scheme.
The remainder of this paper is organized as follows. In Section 2, we first introduce the system principle and illustrate the theory of the proposed PBC scheme. Then, we describe the setup of our experiment and analyze the experiment results in Section 3. We also conduct an ablation study in Section 4. Finally, Section 5 concludes this paper.

System Principle
The flow chart of an IS-based VLP system is shown in Figure 1. The VLP system is realized by decoding the UID data assigned at the transmitter side and further utilizing the position algorithm to calculate location. However, this paper only discusses the UID decoding process, which is a vital part of the VLP system. The VLP system utilizes the rolling shutter effect to transform UID data into black and white stripes of different widths. Therefore, the receiver threshold firstly gets the stripes and figures out strip width representing one data logic on the encoding side. Then, the transmitted UID data between two Headers can be obtained by matching the captured Headers. In this section, we first introduce the rolling shutter effect which VLP systems rely on to demodulate the UID data, and the second part describes the inevitable sampling frequency offset issue that exists in the previous decoding schemes. Last but not the least, we illustrate the principle of our proposed PBC decoding scheme in detail and state the proposed scheme's gain theoretically.
The remainder of this paper is organized as follows. In Section 2, we first intro the system principle and illustrate the theory of the proposed PBC scheme. Then, w scribe the setup of our experiment and analyze the experiment results in Section 3 also conduct an ablation study in Section 4. Finally, Section 5 concludes this paper.

System Principle
The flow chart of an IS-based VLP system is shown in Figure 1. The VLP syste realized by decoding the UID data assigned at the transmitter side and further util the position algorithm to calculate location. However, this paper only discusses the decoding process, which is a vital part of the VLP system. The VLP system utilize rolling shutter effect to transform UID data into black and white stripes of diff widths. Therefore, the receiver threshold firstly gets the stripes and figures out strip w representing one data logic on the encoding side. Then, the transmitted UID data betw two Headers can be obtained by matching the captured Headers. In this section, we introduce the rolling shutter effect which VLP systems rely on to demodulate the data, and the second part describes the inevitable sampling frequency offset issue exists in the previous decoding schemes. Last but not the least, we illustrate the prin of our proposed PBC decoding scheme in detail and state the proposed scheme's theoretically.

Rolling Shutter Effect
The rolling shutter mechanism adopts a sequential read-out architecture, as sh in Figure 2. It conducts the exposure in a row-by-row (or column-by-column) mann stead of exposing the whole image simultaneously at a single moment. Consequen series of light source states (on/off) will be captured in one image frame, forming c sponding bright or dark stripes. Taking advantage of the rolling shutter effect, the data will be transformed to black and white stripes of different widths. Moreover, the transmitted data is transmitted at a fixed frequency, each data bit will be conv into a stripe with fixed width. Finally, the UID data can be decoded by measuring the width representing one data logic on the encoding side. Usually, the strip width doe change with the location or the orientation of the camera receiver. However, it woul pend on the CMOS camera rolling rate and LED transmitting frequency, as shown in ure 3. Define the LED transmitting frequency and the camera rolling rate of CMOS im sensor receiver as and respectively; then, the pixel length of one data logic ca calculated as / .

Rolling Shutter Effect
The rolling shutter mechanism adopts a sequential read-out architecture, as shown in Figure 2. It conducts the exposure in a row-by-row (or column-by-column) manner instead of exposing the whole image simultaneously at a single moment. Consequently, a series of light source states (on/off) will be captured in one image frame, forming corresponding bright or dark stripes. Taking advantage of the rolling shutter effect, the UID data will be transformed to black and white stripes of different widths. Moreover, since the transmitted data is transmitted at a fixed frequency, each data bit will be converted into a stripe with fixed width. Finally, the UID data can be decoded by measuring the strip width representing one data logic on the encoding side. Usually, the strip width does not change with the location or the orientation of the camera receiver. However, it would depend on the CMOS camera rolling rate and LED transmitting frequency, as shown in Figure 3. Define the LED transmitting frequency and the camera rolling rate of CMOS image sensor receiver as F tx and F r respectively; then, the pixel length of one data logic can be calculated as P bit = F r /F tx .    Usually, CMOS image sensors have diverse specifications [28] such as the camera frame rate, read-out duration, exposure duration, and resolution. Due to the difference of read-out duration and exposure duration, different CMOS cameras might capture different strip widths for a certain transmitting frequency according to the rolling shutter mechanism. Moreover, since CMOS cameras have different resolutions, the pixel width of stripes may be unequal for different cameras even though the bit contained is the same. Furthermore, the value of frame rate is fluctuating and would not be a constant. All these specifications lead to different camera rolling rates for CMOS image sensors. Meanwhile, Figure 3 also shows that the different camera light sensitivity (ISO) may also lead to variation in illumination.

Sampling Frequency Offset
For conventional decoding schemes, the optimal decoding data result can be obtained by setting the sampling interval equal to the pixel length of one data logic and determining a best start point. However, it is worth noticing that the camera rolling rate may not be an integral multiple of the optical clock rate , then the bit duration Usually, CMOS image sensors have diverse specifications [28] such as the camera frame rate, read-out duration, exposure duration, and resolution. Due to the difference of read-out duration and exposure duration, different CMOS cameras might capture different strip widths for a certain transmitting frequency according to the rolling shutter mechanism. Moreover, since CMOS cameras have different resolutions, the pixel width of stripes may be unequal for different cameras even though the bit contained is the same. Furthermore, the value of frame rate is fluctuating and would not be a constant. All these specifications lead to different camera rolling rates for CMOS image sensors. Meanwhile, Figure 3 also shows that the different camera light sensitivity (ISO) may also lead to variation in illumination.

Sampling Frequency Offset
For conventional decoding schemes, the optimal decoding data result can be obtained by setting the sampling interval equal to the pixel length of one data logic P bit and determining a best start point. However, it is worth noticing that the camera rolling rate F r may not be an integral multiple of the optical clock rate F tx , then the bit duration P bit may not be an integer, resulting in sampling offset during the decoding process. What is worse, the impact of the SFO issue will be greater with the increase in the number of transmitted data bits and finally cause error bits for UID data, as shown in Figure 4. may not be an integer, resulting in sampling offset during the decoding process. What i worse, the impact of the SFO issue will be greater with the increase in the number of trans mitted data bits and finally cause error bits for UID data, as shown in Figure 4.

PBC Decoding Principle
The LED area extracted in the frame is firstly converted into grayscale format, i which 255 represents completely bright level while 0 represents completely dark leve

PBC Decoding Principle
The LED area extracted in the frame is firstly converted into grayscale format, in which 255 represents completely bright level while 0 represents completely dark level. After that, the proposed PBC scheme is utilized to decode the right UID data, which includes the Staged Threshold Scheme and Synchronous Decoding Operation, as shown in Figure 5. Later, the principle of the proposed PBC scheme will be described and analyzed in detail.

PBC Decoding Principle
The LED area extracted in the frame is firstly converted into grayscale format, in which 255 represents completely bright level while 0 represents completely dark level After that, the proposed PBC scheme is utilized to decode the right UID data, which in cludes the Staged Threshold Scheme and Synchronous Decoding Operation, as shown in Figure 5. Later, the principle of the proposed PBC scheme will be described and analyzed in detail.

Staged Threshold Scheme
Firstly, a background threshold value T is set to avoid the interference of the back ground. Moreover, a representative value V for each row is computed to generate a 1D array. The V can be calculated as where N is the number of pixels whose grayscale value is higher than T , and P is the sum of grayscale value for these pixels. Next, the smooth operation is applied to eliminate small fluctuations. Then, shift the 1D array one unit left and right, respectively, to get two new arrays. The local maximum and minimum points can be obtained through comparing the values at the same position in three arrays. If the value in original array is greater than values in two new arrays, it is recorded as a local maximum point. Otherwise, if the value in original array is smaller than values in two new arrays, it is recorded as a local mini mum point. Ultimately, all the local maximum and minimum points would divide the original 1D array into a lot of sub-regions. Afterwards, a sub-regional threshold is per formed in each sub-region, respectively. The specific rule of the sub-regional threshold is described as follows: if the difference between local maximum and minimum grayscale pixel values of a sub-region is higher than 20, then this area carries out the sub-regiona

Staged Threshold Scheme
Firstly, a background threshold value T b is set to avoid the interference of the background. Moreover, a representative value V re for each row is computed to generate a 1D array. The V re can be calculated as where N is the number of pixels whose grayscale value is higher than T b , and P sum is the sum of grayscale value for these pixels. Next, the smooth operation is applied to eliminate small fluctuations. Then, shift the 1D array one unit left and right, respectively, to get two new arrays. The local maximum and minimum points can be obtained through comparing the values at the same position in three arrays. If the value in original array is greater than values in two new arrays, it is recorded as a local maximum point. Otherwise, if the value in original array is smaller than values in two new arrays, it is recorded as a local minimum point. Ultimately, all the local maximum and minimum points would divide the original 1D array into a lot of sub-regions. Afterwards, a sub-regional threshold is performed in each sub-region, respectively. The specific rule of the sub-regional threshold is described as follows: if the difference between local maximum and minimum grayscale pixel values of a sub-region is higher than 20, then this area carries out the sub-regional threshold operation and the threshold value is the average of maximum pixel value V max and minimum pixel value V min ; otherwise, the sub-region would remain the same. Moreover, we notice that the brightness of consecutive ones would also affect the pixel value at the junction of black and white stripes, which further influence the threshold value in these junction areas. Therefore, we also define a compensation value T c to prevent an unreasonable decrease in threshold value brought by too-low local minimum pixel values.
Considering that the ISO may vary with different CMOS image sensor receivers even if the LED lamp is the same, the T c should be given as where the P lum is the third largest (to avoid abnormal brightness) pixel value in the 1D array obtained previously. Meanwhile, the minimum and maximum pixel value V min , V max of the sub-regions is represented as where the P min and P max are the minimum and maximum grayscale value in the sub-regions. After implementing the sub-regional threshold step, Global threshold procedure with the threshold of T c is further required to deal with the unchanged sub-regions. Figure 6 shows the experimental grayscale value pattern, the threshold obtained by the Staged Threshold Scheme (orange curve), and the final decoding results.
T 0.5 * P 35 where the P is the third largest (to avoid abnormal brightness) pixel value array obtained previously. Meanwhile, the minimum and maximum pixel va of the sub-regions is represented as where the and are the minimum and maximum grayscale value in regions. After implementing the sub-regional threshold step, Global threshold p with the threshold of T is further required to deal with the unchanged sub-reg ure 6 shows the experimental grayscale value pattern, the threshold obtaine Staged Threshold Scheme (orange curve), and the final decoding results. After thresholding, a 1 × n matrix (n is the frame height of the captured LED area) with only two grayscale pixel values of 255 and 0 is formed ultimately.

Synchronous Decoding Operation
Firstly, the continuous '255' or '0' grayscale pixel values in the 1 × n matrix obtained before are transformed into an integer related to the number of consecutive pixels. For example, five continuous integers like '0 0 0 0 0' should be converted into the integer '5'. Then an integer array (IA) is formed for the follow-up operation. It is worth mentioning that the longest consequent binary digits in the UID payload should be no more than that in the transmitted Header. Therefore, the widest stripe in the image frame can be recognized as the location of the Header. It is worth noticing that as the transmission distance increases, the LED area captured in the frame will be smaller, and the received data will be less, resulting in a reduction in the number of Headers captured in one frame. In general, there are two types of captured LED area images: (a) only one Header is concluded in the whole captured LED area, (b) more than one Header is concluded in the whole captured LED area. Therefore, we need to firstly clarify that if there exists more than one Header according to the first and second largest numbers N 1 , N 2 in IA. The criterion is shown in Equation (4).
, only one header (4) where N bit is the number of the longest consequent binary digits in the transmitted Header. If more than one Header is concluded in the whole captured LED area, then the width of one binary digit (measured in pixels) P bit , which is the key point of synchronization process, can be expressed as where N num is the average of N 1 and N 2 , and N bit is the number of the longest consequent binary digits in the transmitted Header. Next, all the integers in IA are divided by P bit , and the decimal part of the result is further analyzed to get a new integer array (NIA). Afterwards, identify the first pixel value of the 1 × n matrix. If the value is 255, the integers at odd digits in NIA are recorded as p × '1' while the integers at even digits are recorded as q × '0' (p, q is value of the corresponding integer). Otherwise, if the value is 0, the integers at odd digits in NIA are recorded as p × '0' while the integers at even digits are recorded as q × '1'. At last, the UID data payload can be decoded by matching the converted binary array with the designed Header, e.g., '011110', as shown in Figure 7.
Then an integer array (IA) is formed for the follow-up operation. It is worth that the longest consequent binary digits in the UID payload should be no mo in the transmitted Header. Therefore, the widest stripe in the image frame ca nized as the location of the Header. It is worth noticing that as the transmissi increases, the LED area captured in the frame will be smaller, and the receive be less, resulting in a reduction in the number of Headers captured in one fra eral, there are two types of captured LED area images: (a) only one Header is in the whole captured LED area, (b) more than one Header is concluded in captured LED area. Therefore, we need to firstly clarify that if there exists mo Header according to the first and second largest numbers , in IA. The shown in Equation (4).
where is the number of the longest consequent binary digits in the Header.
If more than one Header is concluded in the whole captured LED area, the of one binary digit (measured in pixels) , which is the key point of sync process, can be expressed as where is the average of and , and is the number of the lon quent binary digits in the transmitted Header. Next, all the integers in IA are , and the decimal part of the result is further analyzed to get a new integer a Afterwards, identify the first pixel value of the 1 matrix. If the value is 2 gers at odd digits in NIA are recorded as ′1′ while the integers at even di orded as ′0′ ( , is value of the corresponding integer). Otherwise, if the the integers at odd digits in NIA are recorded as ′0′ while the integers at are recorded as ′1′. At last, the UID data payload can be decoded by m converted binary array with the designed Header, e.g., '011110', as shown in F Figure 7. The process of converting NIA to data bits.
As for another situation where only one Header is captured, the width of digit (measured in pixels) is calculated as Figure 7. The process of converting NIA to data bits.
As for another situation where only one Header is captured, the width of one binary digit (measured in pixels) P bit is calculated as where N 1 is the largest number in IA, and N bit is the number of the longest consequent binary digits in the transmitted Header. The other operations are the same as the former situation. However, we can only find one header in the converted binary array. Therefore, we design aQ Data Information Fusion (DIF) method to decode a complete UID data. Firstly, to avoid inaccurate ROI extraction and incomplete stripes, we need to remove the first and the last two bits in the converted binary array. After that, we can get a short binary array before and after the obtained Header, respectively. In addition, the UID data can be directly decoded if the length of one of the short binary arrays is larger than designed UID data length, as shown in Figure 8a. Otherwise, the two short binary arrays would be merged to get a complete UID data. The process of the proposed DIF method is shown in Figure 8b.
where is the largest number in IA, and is the number of the longest binary digits in the transmitted Header. The other operations are the same as situation. However, we can only find one header in the converted binary array we design aQ Data Information Fusion (DIF) method to decode a complet Firstly, to avoid inaccurate ROI extraction and incomplete stripes, we need to first and the last two bits in the converted binary array. After that, we can binary array before and after the obtained Header, respectively. In addition, t can be directly decoded if the length of one of the short binary arrays is larg signed UID data length, as shown in Figure 8a. Otherwise, the two short bi would be merged to get a complete UID data. The process of the proposed DI shown in Figure 8b.

Theoretical Analysis of the Advantages of PBC Scheme
In this part, the superiorities of the proposed PBC scheme and the rea outperforms other existing decoding schemes are analyzed theoretically. N analyze and illustrate them respectively.

Good Resistance to Environmental Change
The brightness of the captured frame is an important factor affecting th process in decoding schemes. It would be affected by the transmission dista value of cameras, and so on. Hence, we design a compensation value T to b mine the threshold value. The value of T can vary with the brightness of th age, which minimizes the impact of brightness changes during threshold pro while, it is known that the inter-pixel crosstalk and exposure time overlapping the thresholding value of junction areas hard to determine. In addition, in ou PBC scheme, to better threshold the junction area of black and white stripes, threshold value is determined with reference to the value of T , which more s just choosing the average value in conventional schemes. Therefore, the pro

Theoretical Analysis of the Advantages of PBC Scheme
In this part, the superiorities of the proposed PBC scheme and the reasons why it outperforms other existing decoding schemes are analyzed theoretically. Next, we will analyze and illustrate them respectively.

Good Resistance to Environmental Change
The brightness of the captured frame is an important factor affecting the threshold process in decoding schemes. It would be affected by the transmission distance, the ISO value of cameras, and so on. Hence, we design a compensation value T c to better determine the threshold value. The value of T c can vary with the brightness of the whole image, which minimizes the impact of brightness changes during threshold process. Meanwhile, it is known that the inter-pixel crosstalk and exposure time overlapping may cause the thresholding value of junction areas hard to determine. In addition, in our proposed PBC scheme, to better threshold the junction area of black and white stripes, the applied threshold value is determined with reference to the value of T c , which more suitable than just choosing the average value in conventional schemes. Therefore, the proposed PBC scheme has good resistance to environmental changes and is effective for different transmission channel conditions.

Excellent Generalization Ability
The proposed PBC scheme is equipped with an excellent generalization ability, which is essential for the application of VLP systems. For decoding schemes in [17][18][19], the sampling interval must be adjusted to maintain high decoding rate when applying different camera receivers. However, the proposed PBC decoding scheme has no interpolation or sampling operation and it does not need to change parameters to adapt the configuration of different camera receivers. This superiority also makes VLP systems more convenient for practical application since various mobile phone camera receivers are used in actual scenarios. The proposed PBC scheme can automatically calculate the bit duration, which is not a constant but computed for each frame and can vary with different CMOS camera receivers. Hence, it can significantly improve the decoding rate of the proposed PBC scheme even when the camera rolling rate of the mobile receiver is different and unknown. In addition, the proposed PBC scheme can cope with different receivers at the same time while the conventional decoding scheme can only be suitable for a specific receiver.

Low Complexity
The proposed PBC decoding scheme has a great improvement in algorithm complexity, which is conducive to the implementation and application of the PBC scheme. Compared with the previous decoding schemes, the design of Synchronous Decoding operation reduces the complexity to a certain extent. On the one hand, there is no interpolation operation during the proposed PBC scheme, which deceases the amount of data processing and space complexity when compared to schemes in [17][18][19]. For decoding schemes in [17][18][19], they need to add an interpolation process and a sampling operation to make the bit duration be an integer. Worse still, the value of interpolation and sample interval may need to be specially designed according to the camera rolling rate. On the other hand, for the schemes in [10][11][12][13][14], which use neural network or machine learning to conduct decoding process, the algorithm structure and data computation are more complex than the proposed PBC scheme. Moreover, it needs an extra data collecting and network training process that increases the application complexity.

Reasons for Outstanding Performance
As for the reasons why the proposed PBC scheme can perform outstanding decoding rate compared with previous solutions. Firstly, in terms of the Staged Threshold Scheme, it provides a more reasonable and easier way to find the local maximum and minimum points when compared to the EVA algorithm [19], which would not be affected by camera rolling rate of the receiver. Moreover, most threshold schemes use the smoothed data to select the threshold value, which may slightly deviate from the reality. However, the threshold value in our proposed scheme is determined according to the original pixel value data, which is more accurate than existing methods. The smooth operation used in the proposed PBC scheme is only employed to find local maximum and minimum points so as to figure out sub-regions. As for the Synchronous Decoding Operation, compared to conventional sampling method in [18,19], the pixel width of a data bit is measured as a decimal rather than an integer which would inevitably introduce sampling frequency offset, just as illustrated in Section 2. Meanwhile, measuring the pixel width of a certain number of consecutive ones or zeros makes the bit estimation more accurate. Moreover, it also includes a DIF method to resolve long transmission distance situations where there is only one header captured in the frame. Consequently, the decoding rate of the proposed PBC decoding scheme can remain high even when the transmission distance between transmitter and receiver increases.
It needs to be emphasized that Synchronous Decoding Operation can only perform well under the premise of excellent thresholding results. If the thresholding result is poor, the width of one binary digit (measured in pixels) P bit may be inaccurate, ultimately resulting in decoding error in the receiver. In our proposed PBC decoding scheme, the Staged Threshold Scheme can provide superb thresholding results so as to improve the performance of Synchronous Decoding Operation. Generally, the two algorithms in the proposed PBC decoding scheme can complement each other and constitute a novel universal decoding method with high accuracy, which can be verified by the experiments in Sections 3 and 4.

Experiment
In this section, we implement a practical Robotic-based VLP system embedded with our proposed PBC decoding scheme. Although this paper only focuses on decoding process, the proposed PBC decoding scheme is evaluated in a practical real-time Roboticbased VLP system rather than testing the decoding process separately [29]. However, this paper would not explain the positioning algorithm in detail. For the description of the positioning algorithm and the analysis of the positioning results, we refer readers who are interested at this part to our work [30].

Experiment Setup
As shown in Figure 9, three round LED lamps are used as VLP transmitters to transmit specific UID data. The diameter of these smart LED lamp transmitters is 18 cm, and they are installed on yellow poles, whose height can be easily adjusted. Meanwhile, an industrial CMOS camera is installed vertically on the Turtlebot3 (Raspberry Robot), which can be used as the mobile CMOS image sensor receiver in this experiment to capture raw videos for further UID decoding. In addition, we design the fixed Header as (011110), which contains 4 identical consecutive bits, and three UIDs, (01010101), (01100110), and (01110101), are assigned to distinguish three different LED lamps. The exact values of the industrial camera configuration and LED transmitting frequency are not known in this experiment. However, experimental results show that the proposed PBC scheme can perform well without applying an extra synchronization, which shows its superiority compared with other decoding schemes.
Electronics 2021, 10, x FOR PEER REVIEW 12 of 19 Figure 9. Experimental setup of the Robotic-based VLP system that embedded with our proposed PBC decoding scheme.

Results and Analysis
We test the robustness of the proposed PBC decoding scheme by applying four different vertical distance from industrial CMOS camera to LED lamps, which varies from 1.73 m to 2.73 m. It should be noted that although we use the distance value on the centimeter level, the distance change of one centimeter actually has little impact on the decoding performance. These transmission distance values are selected because the maximum Figure 9. Experimental setup of the Robotic-based VLP system that embedded with our proposed PBC decoding scheme.

Results and Analysis
We test the robustness of the proposed PBC decoding scheme by applying four different vertical distance from industrial CMOS camera to LED lamps, which varies from 1.73 m to 2.73 m. It should be noted that although we use the distance value on the centimeter level, the distance change of one centimeter actually has little impact on the decoding performance. These transmission distance values are selected because the maximum support height in this experiment is 2.73 m. Finally, 1200 image frames are collected for each case, and the decoding rate is computed by comparing the decoding result with the corresponding UIDs. The measured decoding rates versus vertical distance from the industrial CMOS camera to LED lamp are shown in Figure 10. The decoding rate remains 100% when the height is 1.73 m and 1.93 m, but it slightly falls when the height increased to 2.36 m and further drops at the height of 2.73 m. The reason is probably that no complete data information is contained in the extracted LED area when the transmission distance is too long. In [8], similar experiments were done to test the decoding rate at different heights. However, the decoding rate would fall to about 20% when the vertical distance is 2.0 m. Moreover, in [31], the decoding rate in their experiment would drop to below 40% when the height is 2.5 m and can hardly decode correct data information when the height increases more. In conclusion, only the proposed PBC decoding scheme can have excellent decoding performance at different heights, which maintains a high decoding rate of 95.62% even when the distance is 2.73 m. It also shows that the proposed PBC scheme has a great advantage in long-distance transmission compared with other decoding schemes. As mentioned before, the brightness of captured frames will be influenced as the measured distance between transmitter and receiver increases, which further affects the thresholding process of conventional decoding schemes. Moreover, the farther the distance, the greater the degree of impact. That is part of the reason why previous schemes in [8,31] cannot remain high decoding rate when transmission distance increases. However, the proposed PBC scheme could resist the brightness variation to a large extent, and the decoding rate can hardly be affected. On the other hand, The LED lamp area in the captured frame would become smaller as the transmission distance increases, resulting in less data received. Therefore, the number of Header captured in one frame may be reduced from more than 2 to only 1. For decoding schemes in [8,31], they can only decode UID data by searching two Headers and extracting the middle UID data. Thus, the decoding process would fail when only one Header is captured in a frame. Nevertheless, we design a DIF method in the proposed PBC scheme to solve this problem, as shown in Figure 8. Consequently, the proposed scheme can keep high decoding rate even when the measured distance between transmitter and receiver increases.

Ablation Study
In this section, we aim to evaluate the performance of our innovative PBC algorithm under different LED transmitting frequencies and mobile phone camera receivers. It also As mentioned before, the brightness of captured frames will be influenced as the measured distance between transmitter and receiver increases, which further affects the thresholding process of conventional decoding schemes. Moreover, the farther the distance, the greater the degree of impact. That is part of the reason why previous schemes in [8,31] cannot remain high decoding rate when transmission distance increases. However, the proposed PBC scheme could resist the brightness variation to a large extent, and the decoding rate can hardly be affected. On the other hand, The LED lamp area in the captured frame would become smaller as the transmission distance increases, resulting in less data received. Therefore, the number of Header captured in one frame may be reduced from more than 2 to only 1. For decoding schemes in [8,31], they can only decode UID data by searching two Headers and extracting the middle UID data. Thus, the decoding process would fail when only one Header is captured in a frame. Nevertheless, we design a DIF method in the proposed PBC scheme to solve this problem, as shown in Figure 8. Consequently, the proposed scheme can keep high decoding rate even when the measured distance between transmitter and receiver increases.

Ablation Study
In this section, we aim to evaluate the performance of our innovative PBC algorithm under different LED transmitting frequencies and mobile phone camera receivers. It also indicates that the proposed PBC scheme can deal with the variation of intensity of illumination since the ISO of different cameras would not be the same. Since this paper focuses on the improvement of thresholding performance and synchronous decoding method, the decoding schemes in [18,19], which are representative of conventional decoding schemes, are also tested for better comparison.
As shown in Figure 11, an experiment is set up to test the performance of the proposed PBC scheme and other conventional decoding schemes. At the transmitter, a personal computer (PC) is used to generate the encoded data, which consists of the 10-bit header (0111111110) and an 8-bit UID payload for position calculation. Then a STM32F4VE receives the data from the PC and sends it to the LED Driver through the I/O port. Afterwards, the LED Driver controls the on-off state of a single white-light LED (pattern: Kecent, KC-CBF09, power: 9 W) to transmit specific data over the air repeatedly, and though the LED driver circuit is different from that in Section 3, it would not affect the performance of our proposed PBC scheme. As for the CMOS image sensor receiver, four types of mobile phones are used to capture the continuous state changes (on/off) of the light emitted from the LED, which includes HUAWEI P30 (P30), iPhone7P (7P), Redmi K20 Pro (K20) and OPPO A59s (A59), with the resolution of 1920 × 1080, 1214 × 1262, 1280 × 720, 1920 × 1088, respectively. The camera exposure time is minimized with the aim of observing clear strip patterns from the modulated LED lamp. In addition, the vertical distance from the front camera of mobile phone to LED is 30 cm and the diameter of the LED is 10 cm. observing clear strip patterns from the modulated LED lamp. In addition, the vertical distance from the front camera of mobile phone to LED is 30 cm and the diameter of the LED is 10 cm. To better verify the automatic synchronization function of the proposed PBC scheme, we configure four LED transmitting frequencies (5000 Hz, 6000 Hz, 7000 Hz, and 8000 Hz) and utilize four mobile phones (P30, 7P, K20, and A59) as receivers to form 16 experimental combinations. We capture 1800 image frames in each experimental situation and test the decoding rate of different decoding schemes in [18,19] as well as our proposed PBC decoding scheme under all 16 experimental conditions. A total of 28,800 frames are collected, and detailed decoding results are listed in Appendix A.

Sampling Interval for Conventional Decoding Schemes
To decode the right UID data successfully, conventional decoding schemes need to adjust the interpolation and sampling operation to get an optimal sampling interval for decoding. However, different types of mobile phones usually have different camera rolling rates, resulting in very different strip widths. Hence, the best sampling intervals would be different for different receiver devices, as shown in Figure 12. Moreover, the sampling interval is not a constant but varies with the transmitting frequency, which means the conventional decoding scheme cannot deal with LED lamps that are equipped with different transmitting frequencies as well. To better verify the automatic synchronization function of the proposed PBC scheme, we configure four LED transmitting frequencies (5000 Hz, 6000 Hz, 7000 Hz, and 8000 Hz) and utilize four mobile phones (P30, 7P, K20, and A59) as receivers to form 16 experimental combinations. We capture 1800 image frames in each experimental situation and test the decoding rate of different decoding schemes in [18,19] as well as our proposed PBC decoding scheme under all 16 experimental conditions. A total of 28,800 frames are collected, and detailed decoding results are listed in Appendix A.

Sampling Interval for Conventional Decoding Schemes
To decode the right UID data successfully, conventional decoding schemes need to adjust the interpolation and sampling operation to get an optimal sampling interval for decoding. However, different types of mobile phones usually have different camera rolling rates, resulting in very different strip widths. Hence, the best sampling intervals would be different for different receiver devices, as shown in Figure 12. Moreover, the sampling interval is not a constant but varies with the transmitting frequency, which means the conventional decoding scheme cannot deal with LED lamps that are equipped with different transmitting frequencies as well.

Sampling Interval for Conventional Decoding Schemes
To decode the right UID data successfully, conventional decoding schemes ne adjust the interpolation and sampling operation to get an optimal sampling interv decoding. However, different types of mobile phones usually have different camera ing rates, resulting in very different strip widths. Hence, the best sampling inte would be different for different receiver devices, as shown in Figure 12. Moreove sampling interval is not a constant but varies with the transmitting frequency, w means the conventional decoding scheme cannot deal with LED lamps that are equi with different transmitting frequencies as well.

Decoding Rate for Various Receivers When Applying Same Transmitting Frequency
We test the decoding rate of different decoding schemes when the LED transmitting frequency is 5000 Hz and various receivers are applied. For conventional decoding schemes in [18,19], we apply the same interpolation in Figure 12 and set the best sampling interval for mobile phone HUAWEI P30, which is chosen as a criterion of the CMOS image sensor receiver in this experiment. Figure 13 shows that the decoding rate of conventional decoding algorithms are down to 0 when different mobile phones rather than HUAWEI P30 are set as receiver. It is because the parameters set in conventional decoding schemes are only suitable when the mobile phone receiver is HUAWEI P30. Nevertheless, the decoding rate can be increased by setting the corresponding sampling interval according to the receiver. On the contrary, the proposed innovative PBC decoding scheme, which has no interpolation and sampling operation, maintains excellent performance with all mobile phone receivers. It can be concluded from the experiment that only the proposed PBC scheme can decode the right UID data under different transmitter and receiver conditions. Meanwhile, the decoding rate of the proposed PBC scheme when setting HUAWEI P30 as mobile phone receiver is also better than that of conventional decoding schemes. Therefore, the proposed PBC scheme is much superior to conventional schemes when applied in actual application scenarios.
Electronics 2021, 10, x FOR PEER REVIEW We test the decoding rate of different decoding schemes when the LED tr frequency is 5000 Hz and various receivers are applied. For conventiona schemes in [18,19], we apply the same interpolation in Figure 12 and set the bes interval for mobile phone HUAWEI P30, which is chosen as a criterion of the CM sensor receiver in this experiment. Figure 13 shows that the decoding rate of co decoding algorithms are down to 0 when different mobile phones rather than P30 are set as receiver. It is because the parameters set in conventional decodin are only suitable when the mobile phone receiver is HUAWEI P30. Neverthel coding rate can be increased by setting the corresponding sampling interval a the receiver. On the contrary, the proposed innovative PBC decoding scheme no interpolation and sampling operation, maintains excellent performance with phone receivers. It can be concluded from the experiment that only the pro scheme can decode the right UID data under different transmitter and receiver Meanwhile, the decoding rate of the proposed PBC scheme when setting HUA mobile phone receiver is also better than that of conventional decoding schem fore, the proposed PBC scheme is much superior to conventional schemes wh in actual application scenarios.

Decoding Rate for Various Transmitting Frequency When Applying Same Receiv
The decoding rates of various LED transmitting frequencies are also comp Figure 13. The decoding rate of various decoding schemes when applied to different receivers (same LED transmitting frequency: 5000 Hz).

Decoding Rate for Various Transmitting Frequency When Applying Same Receiver
The decoding rates of various LED transmitting frequencies are also compared when the mobile phone receiver is the same (HUAWEI P30), as shown in Figure 14. For conventional decoding algorithms, the Polynomial threshold in [18] has better decoding results. The performance of iterative threshold [18] and Quick adaptive threshold scheme [18] as well as the EVA threshold scheme [19] are not satisfactory even though we have tried our best to figure out the optimal parameter value in these algorithms. However, the proposed PBC scheme can maintain excellent performance at four different transmitting frequencies without adjusting any parameters. Figure 13. The decoding rate of various decoding schemes when applied to different receivers (same LED transmitting frequency: 5000 Hz).

Decoding Rate for Various Transmitting Frequency When Applying Same Receiver
The decoding rates of various LED transmitting frequencies are also compared when the mobile phone receiver is the same (HUAWEI P30), as shown in Figure 14. For conventional decoding algorithms, the Polynomial threshold in [18] has better decoding results. The performance of iterative threshold [18] and Quick adaptive threshold scheme [18] as well as the EVA threshold scheme [19] are not satisfactory even though we have tried our best to figure out the optimal parameter value in these algorithms. However, the proposed PBC scheme can maintain excellent performance at four different transmitting frequencies without adjusting any parameters. More importantly, since the proposed decoding scheme can handle situations when different LED transmitting frequency is applied, the frequency division multiplexing method can also be used to increase the number of supporting LED lamps. We just need to ensure the width of stripes is distinguishable between two frequencies when various camera receivers are applied. Consequently, even if the decoded UID data are the same, they can be further distinguished by the value of the largest numbers in IA.

Decoding Rate for Different UID Data Type
As mentioned in Section 2, aiming to realize automatic synchronization between LED transmitter and CMOS image sensor receiver, the longest consequent binary digits in the UID payload are required to be shorter than that in the transmitted Header, which is 8 in the conducted experiment. Hence, we also check the decoding rate when the number of longest consequent binary digits in UID data varies from 1 to 7. Experimental results show that the proposed PBC scheme performs well under all UID data conditions. However, the decoding rate of other decoding schemes is worse than the proposed PBC scheme and will be easily affected when applying different UID payload, as shown in Figure 15. More importantly, since the proposed decoding scheme can handle situations when different LED transmitting frequency is applied, the frequency division multiplexing method can also be used to increase the number of supporting LED lamps. We just need to ensure the width of stripes is distinguishable between two frequencies when various camera receivers are applied. Consequently, even if the decoded UID data are the same, they can be further distinguished by the value of the largest numbers in IA.

Decoding Rate for Different UID Data Type
As mentioned in Section 2, aiming to realize automatic synchronization between LED transmitter and CMOS image sensor receiver, the longest consequent binary digits in the UID payload are required to be shorter than that in the transmitted Header, which is 8 in the conducted experiment. Hence, we also check the decoding rate when the number of longest consequent binary digits in UID data varies from 1 to 7. Experimental results show that the proposed PBC scheme performs well under all UID data conditions. However, the decoding rate of other decoding schemes is worse than the proposed PBC scheme and will be easily affected when applying different UID payload, as shown in Figure 15.

Decoding Rate for Different Header and Data Combination
In this part, we aim to prove the feasibility of different header sequence and UID data

Decoding Rate for Different Header and Data Combination
In this part, we aim to prove the feasibility of different header sequence and UID data combinations for the proposed PBC scheme. We tested four combinations in total. Header (01110) is tested with the UID data length of 10 bits and 12 bits. Meanwhile, Header (011110) is tested with UID data length of 12 bits and 14 bits. Experimental results show that the decoding rate would not be affected by the length of header or data, and all combinations reach an average decoding rate of 99.9%, as shown in Figure 16. Figure 15. The decoding rate of various decoding schemes when the number of longest consequent binary digits in UID data varies from 1 to 7. (LED transmitting frequency: 5000 Hz; receiver: HUAWEI P30)

Decoding Rate for Different Header and Data Combination
In this part, we aim to prove the feasibility of different header sequence and UID data combinations for the proposed PBC scheme. We tested four combinations in total. Header (01110) is tested with the UID data length of 10 bits and 12 bits. Meanwhile, Header (011110) is tested with UID data length of 12 bits and 14 bits. Experimental results show that the decoding rate would not be affected by the length of header or data, and all combinations reach an average decoding rate of 99.9%, as shown in Figure 16.

Conclusions
In this paper, we propose a novel effective PBC decoding scheme with better thresholding performance and automatic synchronization function. The Staged Threshold Scheme can provide excellent threshold results to demodulate signals even when under different transmission channel conditions. In addition, the Synchronous Decoding Operation can calculate the pixel width of one binary digit P bit to automatically synchronize the clock between different LED transmitter and camera receivers, which makes up for the unsynchronized transmission channel issue existing in conventional decoding schemes. Meanwhile, it also includes a Data Information Fusion method to improve decoding performance in the case of long transmission distance. Moreover, less time and memory space are needed since there is no interpolation and sampling operation. Therefore, the proposed PBC scheme has great advantages when applied in practical scenarios. Ultimately, we implement a practical Robotic-based VLP system embedded with our proposed PBC decoding scheme and realize a decoding rate of 95.62% at the height of 2.73 m. Experimental results show that the average decoding rate is 99.9% when applied in different LED transmitters and camera receivers, which is an excellent performance when compared with traditional decoding schemes. In addition, the proposed PBC decoding scheme cannot only be applied to visible light positioning but also be used in other communication areas for better decoding performance. In our future work, we will explore decoding schemes for much longer transmission distance when the transmitted data in a single frame is less than a complete data packet.

Conflicts of Interest:
The authors declare no conflict of interest.

Appendix A
All detailed decoding rates of mentioned decoding schemes in [18,19] and our proposed PBC scheme under various configurations are listed in the following tables. In addition, different from other conventional decoding schemes in [18,19], the sampling interval and interpolation parameters in the following tables would not affect the performance of our proposed PBC decoding scheme since there is no interpolation or sampling operation during the whole decoding process.