# Multi-Attributes, Utility-Based, Channel Quality Ranking Mechanism for Cognitive Radio Networks
## 2 Methodology  
The proposed model involves three main processes: spectrum sensing, channel quality estimation, and channel ranking. As shown in Figure 1, the first step of this model consists of performing spectrum sensing using either energy detection [4; 5; 6; 7; 8; 9], cyclostationary features detection [10; 11; 12; 13; 14; 15], or matched filter detection [16; 17]. This spectrum-sensing process determines the list of free frequency channels. The second process involves the estimation of the parameters related to the quality of each free frequency channel, such as the occupancy of the channel, \(SNR\), information capacity of the channel, bit error rate, etc. The channel ranking calculates the global utility of each frequency channel and then ranks all the free channels. The frequency channel with the highest utility value is chosen as the best channel for transmission. In the \"ACTION\" function, the selected frequency channel is used for communication. The proposed utility function is described as follows. Let us consider that the radio spectrum is divided into \(M\) frequency channels, of which \(N\) frequency channels are free. \(\text{F}=\{f_{1},f_{2},\,\ldots,f_{N}\}\) denotes the list of these \(N\) free channels for which the quality of the channel is increasing as the subscript of the frequency is increasing. Figure 2 shows the expected utility function of the frequency channels. The \(x\)-axis represents the list of frequencies from \(f_{1}\) to \(f_{100}\), and the \(y\)-axis represents the expected utility ranging from 0 to 1. The frequency channel \(f_{1}\) has the lowest quality, and as we increase the subscript of the frequency, the quality of the channel increases until reaching the frequency with the highest frequency that correspond to the channel with the best quality. Figure 1: Processes of selecting the best channel. The utility function of these parameters can be approximated by a sigmoid function, which is expressed as:  
\[U_{w}(x)=\frac{1}{1+e^{-\sum_{i=0}^{N}w_{i}x_{i}}} \tag{1}\]  
where \(w_{i}\) denotes the weight associated with the parameter \(x_{i}\), and \(N\) is the number of features used to estimate the quality of the channel. Equation (1) can be rewritten as:  
\[U_{w}(x)=\frac{1}{1+e^{-w^{T}x}} \tag{2}\]  
where \(x\) is the \(N\)-dimensional vector made of the parameters \(x_{i}\), \(w\) is the \(N\)-dimensional vector made of the weights \(w_{i}\), and \(T\) is the transpose operator. To find the weight \(w_{i}\) corresponding to each utility parameter \(x_{i}\), we define the cost function as:  
\[J(w)=\frac{1}{2m}\sum_{i=1}^{m}\left(U_{w}\left(x^{(i)}\right)-y^{(i)}\right)^ {2} \tag{3}\]  
where \(y\) is the expected global utility and \(m\) is the number of training data. Then, the problem of finding the weights can be solved by minimizing the following cost function:  
\[\underset{w}{\min}J(w) \tag{4}\]  
To minimize the cost function, we use the Gradient Descent algorithm. This algorithm updates all the weights simultaneously until the convergence to a global minimum. These weights are updated using the following formula:  
\[w_{j}:=w_{j}-\alpha\frac{\partial}{\partial w_{j}}J(w) \tag{5}\]  
where \(\alpha\) is the learning rate and \(\frac{\partial}{\partial w_{j}}J(w)\) is the partial derivative regarding the weights \(w_{j}\). Figure 2: Expected utility of the frequency channels. Consider \(n\) parameters that are encompassed in the global utility function. All of these parameters are updated simultaneously, and Equation (5) can be rewritten as:  
\[ \begin{split} w_{1}&:=w_{1}-\alpha\frac{\partial}{ \partial w_{1}}J(w)\\ w_{2}&:=w_{2}-\alpha\frac{\partial}{\partial w_{2} }J(w)\\ &\qquad\qquad\vdots\\ w_{n}&:=w_{n}-\alpha\frac{\partial}{\partial w_{n} }J(w)\end{split}  \tag{6}\]  
The partial derivative \(\frac{\partial}{\partial w_{j}}J(w)\) becomes the following:  
\[\frac{\partial}{\partial w_{j}}J(w)=\frac{1}{m}\sum_{i=1}^{m}\Bigl{(}U_{w} \Bigl{(}x^{(i)}\Bigr{)}-y^{(i)}\Bigr{)}x_{j}^{(i)} \tag{7}\]  
where \(m\) is the number of element in the training set.