# Flickering-Free Distance-Independent Modulation Scheme for OCC
## 5 Methodology
### Experimental Setup
\begin{cases}375.00\;\text{Hz}&\approx 375.0\;\text{Hz}&\text{DATA}=10 \\ 379.17\;\text{Hz}&\approx 379.0\;\text{Hz}&\text{DATA}=11\\ 383.33\;\text{Hz}&\approx 383.5\;\text{Hz}&\text{DATA}=01\\ 387.50\;\text{Hz}&\approx 387.5\;\text{Hz}&\text{DATA}=00\end{cases}  \tag{14}\]  
In the medium range case, the target distance was \(D=30\) m. For this separation, the selected emitter (\(d_{y}=0.595\)) has at least 36 vertical pixels (calculated using Equation (6)). Then, the minimum frequency multiplier is calculated as follows:  
\[\alpha>\frac{2*0.6048}{4\left[\arctan\left(\frac{0.595}{2*30}\right)\right]}\]  
\[\alpha>29.98\]  
This value was selected for the experimental implementation. Based on the distance and the frequency multiplier, the system's frequencies were determined using Equation (13). In the same way, by applying Equation (7), a strips' vertical width of 18 pixels was calculated. The calculated frequencies were:  
\[f_{\text{SW}}= \begin{cases}750.00\;\text{Hz}&\approx 750.0\;\text{Hz}&\text{DATA}=10 \\ 754.17\;\text{Hz}&\approx 754.0\;\text{Hz}&\text{DATA}=11\\ 758.33\;\text{Hz}&\approx 758.5\;\text{Hz}&\text{DATA}=01\\ 762.50\;\text{Hz}&\approx 762.5\;\text{Hz}&\text{DATA}=00\end{cases}  \tag{15}\]  
Finally, for the long range case, a distance \(D=70\) m was selected and the lamp (\(d_{y}=0.595\)) in the frames has 15 vertical pixels (calculated using Equation (6)). Therefore, the minimum frequency multiplier is calculated as follows:  
\[\alpha>\frac{2*0.6048}{4\left[\arctan\left(\frac{0.595}{2*70}\right)\right]}\]  
\[\alpha>71.14\]  
The value of \(\alpha=75\) was selected for the frequency multiplier. Using Equation (13) the system's frequencies were determined, while by applying Equation (7) a strip's size of 7.2 pixels was calculated. The frequencies were:  
\[f_{\text{SW}}= \begin{cases}1875.00\;\text{Hz}&\approx 1875.0\;\text{Hz}&\text{DATA }=10\\ 1879.17\;\text{Hz}&\approx 1879.0\;\text{Hz}&\text{DATA}=11\\ 1883.33\;\text{Hz}&\approx 1883.5\;\text{Hz}&\text{DATA}=01\\ 1887.50\;\text{Hz}&\approx 1887.5\;\text{Hz}&\text{DATA}=00\end{cases}  \tag{16}\]  
At each location, before starting the transmission, a photo of the lamp turned on was taken. These frames were used to locate the light source for each distance D. For this purpose, at first the image was manually masked around the lamp location for eliminating the great part of the background. Then the resulting frame was binarized using [PERSON]'s thresholding technique. Therefore, the binary image was segmented to obtain the lamp's centroid. By applying Equations (5) and (6), the pixel distances of the panel were calculated. With these data, the exact ROI containing only the emitter was obtained and used for cropping the video frames. Afterwards the videos were processed using the cropped frames. At first, the 2D mean and standard deviation of the image were computed for performing the wake up process described in Section 3.3. In this particular case, the symbol \"10\" was selected as the header of the transmissions, for determining if the transmission started before, during, or after the acquisition of the light source pixels. Once the system changed its status to transmitting, the images were grouped together depending on the number of consecutive frames that represented each symbol. Finally, each group of m frames were put through the data extraction procedure described in Figure 2. At first a min-max normalization was applied for assuring the same pixel's intensity range in all the frames. Then the PCC was calculated for the corresponding consecutive frames. For example, in the case of \(m=3\) and a synchronized signal, two PCC values would be computed: \(PCC(F_{n},F_{n+1})\) and \(PCC(F_{n+1},F_{n+2})\). For the demodulation process, the average value of PCC was used. The obtained symbols were stored gradually in a vector. When the system detected the transmission's end employing the wake up process, the stored data vector was compared to the transmitted data. From this comparison, the BER of the communication was directly extracted.