# An Energy-Efficient Game-Theory-Based Spectrum Decision Scheme for Cognitive Radio Sensor Networks
## 3 Energy-Efficient Game-Theory-Based Spectrum Decision
### Coordination Mode (C Mode)
#### 3.2.3 Spectrum Decision Module of C Mode  
In the spectrum decision module, the CHs are responsible for selecting an operating channel and a backup channel, and managing their CMs. The selected operating and backup channels may  
Figure 2: Residual-energy-based clustering. be licensed channels or unlicensed channels. There are four tasks in the spectrum decision module: spectrum characterization, spectrum selection, CM coordination, and spectrum access. All sensor nodes (CHs and CMs) perform spectrum characterization. Although CMs are not involved in spectrum selection, they need to characterize the spectrum in order to update the spectrum history, which they will use if they become CHs on the next frame. The input of spectrum characterization is the outcome of the spectrum sensing module. The sensor nodes characterize the licensed channels and the SNR calculation for licensed channels (\(SNR_{x}\)) is as follows:  
\[SNR_{x}={{({P_{PUBsignal}})}_{x}}/{{({P_{PUnoise}})}_{x}} \tag{3}\]  
where \(({{P_{PUBsignal}}})_{x}\) is the power received from the closest PU on licensed channel \(A_{x}\) inside the sensor node's transmission range, \(({{P_{PUBnoise}}})_{x}\) is the power received from all PUs except for the closest one inside its interference range. We determine that the best \(SNR_{x}\) is equal to \(0/0\), which means that there is no PU at all. The next best \(SNR_{x}\) is equal to \(0/V\) (\(V\) is an arbitrary value), which means that all PUs are outside the sensor node's transmission range, even though there are PUs inside its interference range. In our algorithm, we replace the value \(0/0\) to \(1\) (one) and \(0/V\) to \(0\) (zero). Using the SNR value, the status of the licensed channel is updated. If \(SNR_{x}=1\), then:  
\[Status{{({A_{x}})}_{i}}=(idle) \tag{4}\]  
otherwise:  
\[Status{{({A_{x}})}_{i}}=(busy) \tag{5}\]  
We include a Markov chain to predict the channels' status and to update the channel holding time. Channel holding time is defined as the expected \"time\" that the channel will remain idle for licensed channels or clean for unlicensed channels (\"time\" refers to the number of frames.) We created a Markov chain for each licensed channel, as shown in Figure 3.  
Markov chains are updated based on the spectrum characterization status. The value \((1-p)\) is the probability of an idle channel to remain idle and it is considered to calculate the channel holding time as follows: If \((1-p)^{t}>p_{\textit{thres}}\), \(t\geq 1\), and \(t_{\textit{max}}\geq 1\), then:  
\[(CHT_{x})_{f}=(CHT_{x})_{\textit{ffprev}}+\sum_{t=1}^{t_{\textit{max}}}1 \tag{6}\]  
where \((CHT_{x})_{f}\) and \((CHT_{x})_{\textit{ffprev}}\) are the channel holding times on channel \(A_{x}\) for the current frame and the previous frames, respectively. The term \((1-p)^{t}\) is the probabilities that an idle channel will  
Figure 3: Markov chain for a licensed channel (\(p\) = probability that an idle channel becomes busy, \(q\) = probability that a busy channel becomes idle). remain idle for time \(t\), \(p_{thres}\) is a predetermined probability, and \(t_{max}\) is the highest integer for which the statements \((1-p)^{t}>p_{thres}\) is still valid. If \((1-p)<p_{thres}\), then:  
\[\left(CHT_{x}\right)_{f}=\frac{1}{2}(CHT_{x})_{fprev} \tag{7}\]  
If \(p=0\), then:  
\[\left(CHT_{x}\right)_{f}=\left(CHT_{x}\right)_{fprev}+CHT_{\max} \tag{8}\]  
where \(CHT_{max}\) is a predetermined constant. Spectrum selection tasks are performed only by the CHs. CMs go to sleep to save energy during spectrum selection tasks, and they wake up to receive configuration settings at the beginning of CM coordination tasks. In C mode, the outcome is the selection of one operating channel and one backup channel. CHs are divided into four types depending on the number of idle licensed channels. The CH types are:  
\[Type(CH)_{i}=