# Constant Transmission Efficiency Dimming Control Scheme for VLC Systems
## 3 The Proposed Dimming Control Scheme
### Encoding/Decoding Procedure the ECWCS Scheme  
In the last subsection, the codeword set \(\mathcal{S}\) is constructed by Algorithm 1. By the construction of the codeword set, we can obtain the mapping relation between the original binary sequence and the dimming coded binary sequence from the table like Tables 1 and 2. In this subsection, the encoding/decoding procedure will be introduced. For the encoding procedure, we first divide the original binary signal \(\mathbf{s}\) into several length-\(k\) binary sequences. Then we map the binary sequence \(\mathbf{b}\) to the length-\(n\) dimming coded binary sequence \(\mathbf{c}\). In the end, we can obtain the transmitted binary signal \(x\). For the decoding procedure, paper [19] provide a fast decoding algorithm. Motivated by the contents in paper [19], we provide a decoding algorithm to decrease complexity. We know that the traditional Maximum Likelihood (ML) decoding algorithm is to compare \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Original Binary Sequence** & **Dimming Coded Binary Sequence** & **Original Binary Sequence** & **Dimming Coded Binary Sequence** \\ \hline
000 & 00000001 & 100 & 00010000 \\
001 & 00000010 & 101 & 00100000 \\
010 & 00000100 & 110 & 01000000 \\
011 & 00001000 & 111 & 10000000 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: The mapping between the original binary sequence and the dimming coded binary sequence with \(k=3\), \(n=8\), and \(\gamma=1/8\). \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Original Binary Sequence** & **Dimming Coded Binary Sequence** & **Original Binary Sequence** & **Dimming Coded Binary Sequence** \\ \hline
000 & 00000011 & 100 & 00110000 \\
001 & 00000110 & 101 & 01100000 \\
010 & 00001100 & 110 & 110000011 \\
011 & 00011000 & 111 & 10000111 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The mapping between the original binary sequence and the dimming coded binary sequence with \(k=3\), \(n=8\), and \(\gamma=5/16\). the probability density function of the received sequence \(\mathbf{r}\) conditioned on the coded binary sequence \(\mathbf{c}\) when the system is a single-input single-output system, which is expressed as [20]:  
\[p(\mathbf{r}|\mathbf{c})=\frac{1}{(\sqrt{2\pi\sigma^{2}})^{N}}\text{exp}(-\frac {\|\mathbf{r}-\mathbf{c}\|^{2}}{2\sigma^{2}}). \tag{7}\]  
The decoder can be simplified as:  
\[\hat{\mathbf{r}}=\arg\min\|\mathbf{r}-\mathbf{c}\|^{2}. \tag{8}\]  
In order to decrease the complexity of the decoding procedure, the decoder can also be given as:  
\[\|\mathbf{r}-\mathbf{c}\|^{2}=\|\mathbf{r}\|^{2}+\|\mathbf{c}\|^{2}-2\mathbf{ r}^{T}\mathbf{c}. \tag{9}\]  
When the received signal is the same one and the code weight is a constant, the decoder is represented by:  
\[\hat{\mathbf{r}}=\arg\max\mathbf{r}^{T}\mathbf{c}. \tag{10}\]  
Due to the coded sequence \(\mathbf{c}\) is a binary sequence, we should only find the position of bit '1' in \(\mathbf{c}\) and sum the elements at the same position in \(\mathbf{r}\). For example, when \(\mathbf{c}=[1,1,0,0]\) and \(\mathbf{r}=[1.05,0.83,0.35,0.21]\), the summation is \(1.05+0.83=1.88\). After we get the estimated sequence \(\hat{\mathbf{r}}\) of \(\mathbf{r}\), we can recover the original binary data by looking up from the table like Tables 1 and 2. The proposed decoding algorithm is for the constant weight codes. Therefore, according to the two cases in the last subsection, there are two cases for the decoding algorithm. The two cases are as follows:  
1. When the dimming factor \(\gamma=\frac{i}{n}\), the code weight of every codeword in the codeword set \(\mathcal{S}\) is \(i\). Thus we can utilize the proposed decoding algorithm directly. 2. When the dimming factor \(\gamma\
eq\frac{i}{n}\) and \(\frac{1}{n}<\gamma<\frac{n-1}{n}\), the code weight of every codeword in set \(\mathcal{S}\) is not a constant. First we find the range \(\frac{i}{n}<\gamma<\frac{i+1}{n}\) and calculate \(m=n\times 2^{k}\times\gamma\), \(q=(m-2^{k}i)/2\).