# Flickering-Free Distance-Independent Modulation Scheme for OCC
## 3 Theoretical Description of the Proposed Modulation
### Wake up Process  
As stated in the previous section, the 2D mean and 2D standard deviation can be employed for determining a change in the light input signal. Consequently, these values can detect the transmission start as the base of the system's wake up procedure. Since the emitters can start the transmission at any time, the camera is constantly acquiring frames. However, there must be a mark that triggers the data extraction, also known as the wake up signal. For this scheme, a change in the LED's input signal was selected as the token. If the LED-based lamp is not emitting data, it will be constantly turned on. Therefore, \(\sigma_{ROI}(x,y)\) will be close to zero and \(\mu_{ROI}(x,y)\) will have its maximum value. When the transmission starts, the LED will vary its state from on to off continuously. As a result of this change, \(\sigma_{ROI}(x,y)\) increases while \(\mu_{ROI}(x,y)\) decreases, triggering the data extraction on the camera's communication side. Similarly, when the transmission ends, the emitter receives once again a constant signal at its input. Therefore, \(\sigma_{ROI}(x,y)\) returns to the minimum value and \(\mu_{ROI}(x,y)\) increases, stopping the information's extraction process. As can be observed on the Rx side of Figure 7, the wake up process is based on a comparison of consecutive frames' 2D mean, and analysis of actual frame's 2D standard deviation. Since the procedure started assuming that the system is not transmitting data (State = waiting), the maximum possible value was assigned to the 2D mean as initial value, \(\mu_{ROI_{b}}(x,y)=255\). In the case of the 2D standard deviation, a threshold value is needed and 3% of the maximum value was selected (\(\sigma_{Th}(x,y)=6.3750\)), based on experimental intermediate results. When a frame (\(F_{N}\)) is captured, the ROI that contains the emitter's projection is extracted for calculating the 2D mean (\(\mu_{ROI_{N}}(x,y)\)) and standard deviation (\(\sigma_{ROI_{N}}(x,y)\)). Then the obtained values are compared with the previous frame's mean and the threshold standard deviation. Depending on the comparison's outcome and the current system's state, \(F_{N}\)'s ROI can be stored for data extraction or ignored. If the algorithm was waiting for a transmission, the standard deviation is greater than the threshold (\(\sigma_{ROI_{N}}(x,y)>\sigma_{Th}(x,y)\)), and the mean decreases (\(\mu_{ROI_{N}}(x,y)<\mu_{ROI_{N-1}}(x,y)\)), then a transmission has started. Therefore, the system's state change to transmitting and the frame's ROI is stored. In the same way, if the algorithm is in the \"emitting data\" state, the frame's ROI is stored except when the standard deviation is lower than the threshold (\(\sigma_{ROI_{N}}(x,y)<\sigma_{Th}(x,y)\)), and the mean increases (\(\mu_{ROI_{N}}(x,y)>\mu_{ROI_{N-1}}(x,y)\)). In this case, the transmission is assumed to be stopped, the system's state changes to waiting and the frame is ignored. In Table 1, the obtained values from three experiments are shown. In all the examples, the camera was acquiring frames at a rate of 25 fps. In the first case, the original frames \(F_{(a)}\) were gray-scale images of \(640\times 480\) that were taken in a room with the light turned on. The camera's exposure time was low. For the second case, \(F_{(b)}\) were color images of \(1280\times 720\) taken by a camera with default characteristics in a room where the light was turned off. In the last case, the camera's setting were high contrast, low brightness, and low exposure time for \(1280\times 720\) color images \(F_{(c)}\), taken in a room with the light turned off. With this procedure, the transmission is detected. However, when the communication starts there are three options regarding the acquisition of the emitter's projection (ROI):