# A Novel Coding Based Dimming Scheme with Constant Transmission Efficiency in VLC Systems
## 3 The Proposed Coding Scheme
### Dimming Encoder  
In this subsection, the encoding structure is given. To make our presentation clear, some notations are given as follows:  
1. For a binary data sequence where the occurrence ratio of the bits of one and two is the same, based on the required dimming level, we first divide it into a certain number of blocks with binary data length \(K\), denoted as \(\mathbf{b}=[b_{K},\cdots,b_{2},b_{1}]\), which is taken as the input of the \"dimming encoding\" part. 2. The dimming code is denoted as \(\mathbf{g}=[\mathbf{g}_{K},\cdots,\mathbf{g}_{2},\mathbf{g}_{1}]\), where \(\mathbf{g}_{i}=[g_{iK},\cdots,g_{2},g_{i1}]\) with \(i\in\{1,2,\cdots,K\}\), which corresponds to the specific dimming level. The normalized code weight of dimming code \(\mathbf{g}\) is: \[W=\frac{\sum_{i=1}^{K}\sum_{j=1}^{K}g_{ij}}{K^{2}}.\] (3)
3. We perform the bitwise AND operation on block code \(\mathbf{b}\) and each subsection of dimming code \(\mathbf{g}_{i}\) to generate new codeword \(\mathbf{c}_{i}=[c_{iK},\cdots,c_{2},c_{i1}]\). Then, we combine each \(\mathbf{c}_{i}\) to make the transmitted data \(\mathbf{c}=[\mathbf{c}_{K},\cdots,\mathbf{c}_{2},\mathbf{c}_{1}]\), which satisfies the dimming requirement. For any random  
Figure 2: Block diagram of the proposed scheme. OOK, on-off keying. input data sequence, the ratio of bits of zeroes and ones is the same. Namely, these block codes are transmitted with equal probability. Therefore, the dimming level can be expressed as:  
\[\gamma= \begin{cases}\frac{W}{2},&0<\gamma\leq 0.5,\\ 1-\frac{W}{2},&0.5<\gamma<1.\end{cases}  \tag{4}\]  
Therefore, the key point of the problem is the construction of the dimming code. To better distinguish the generation of codewords, we provide the following principles to construct the dimming code \(\mathbf{g}\). **Principle 1**. : _The construction of the dimming code._  
1. _The dimming code corresponding to the minimum dimming level should guarantee that_ \(g_{ij}=1\) _when_ \(i=j\) _and_ \(g_{ij}=0\) _when_ \(i\
eq j\)_._
2. _As mentioned above, the dimming factor can be changed proportionally with the code weight of the dimming code. To increase the dimming level, we can successively increase the number of \"_ON_\" levels of each_ \(\mathbf{g}_{i}\)_. Therefore, the dimming resolution is_ \(\tilde{\gamma}=\frac{1}{2K^{2}}\)_._
3. _The dimming code with_ \(\gamma\in(0.5,1)\) _is the same as the_ \(\gamma\in(0,0.5)\) _part, and accordingly, the generated data are_ \(\bar{\mathbf{c}}_{i}=[\varepsilon_{iK},\cdots,\bar{\varepsilon}_{i2},\bar{ \varepsilon}_{i1}]\)_, where_ \(\bar{\mathbf{c}}_{ik}=1-\varepsilon_{ik}\)_._  
**Example 1**. : _To make the encoding process clear, without loss of generality, we make \(K=3\) here, so the dimming code under different dimming levels is as summarized in Table 1. Meanwhile, the construction of the generated codewords under dimming factor \(\gamma=\frac{1}{6}\) with \(K=3\) is shown in Table 2._  
From the above analysis, the transmission efficiency can be expressed as:  
\[\
u=\frac{1}{K}, \tag{5}\]  
where the transmission rate can be fixed under different dimming levels when the bandwidth is given. We conclude the performance comparison under different \(K\) where the corresponding dimming level and dimming range are determined, as shown in Table 3. The analysis shows that we can obtain a wider dimming range and more precise dimming levels with the increase of parameter \(K\). However, a large value of \(K\) may degrade the performance of transmission efficiency. Thus, we can choose the proper dimming scheme depending on the specific transmission condition. Consequently, we can summarize the above-mentioned encoding process as Algorithm 1 where \(\bigotimes\) denotes the operation of bitwise AND.