# Primary User Localization Algorithm Based on Compressive Sensing in Cognitive Radio Networks
## 4 Basic Idea of PU-CSL Algorithm and Efficiency Analysis  
The data shown in Figure 2 assume that \(N\) SUs are randomly distributed in CRN. Based on the corresponding relation between received source signal energy and its location, the source signal collects received energy at each receiver, namely energy fingerprint, which is regarded as its exclusive identity label. Within one sensing period, SUs collect the energy of the source signal within the sensing band. We define \(E_{i}\) as the energy collected at the \(i_{th}\) SU from source signal node, where \(i=1,2,\cdots,N\), then the energy fingerprint of the source signal node can be described as:  
\[\mathbf{E}=(E_{1},\cdots,E_{i},\cdots,E_{N})^{T} \tag{9}\]  
Similarly, we define \(E_{ik}\) as energy from the \(i_{th}\) SU to the \(k_{th}\) SU (the theoretical energy value between two nodes can be calculated using the signal transmission model). Then energy fingerprints between the \(i_{th}\) cognitive node and all SUs are defined as \(\mathbf{m}_{i}=(E_{i1},\cdots,E_{ik},\cdots,E_{iN})^{T}\), where the value of \(E_{ik}\) can be obtained using channel transmission model or actual measurement. In distributed cognitive radio networks, nodes that participate in the collaborative spectrum sensing can acquire sensing information of neighboring nodes by reporting channels (such as the energy values required by the algorithm in this paper). The channel transmission model or measured values are two kinds of means to obtain energy values. We use the channel transmission model to obtain the energy value and use the software platform to simulate the algorithm. When the algorithm is applied to the actual wireless scenarios, the measured energy values are indispensable. All the energy fingerprints of SUs in CRN are combined into the sparse transforming matrix \(M\):  
\[\mathbf{M}=(\mathbf{m}_{1},\cdots,\mathbf{m}_{i},\cdots,\mathbf{m}_{N})^{T} \tag{10}\]  
Energy fingerprint \(\mathbf{E}\) can be represented according to sparse transforming basis \(M\):  
\[\mathbf{E}=\sum_{i=1}^{N}\mathbf{m}_{i}\mu_{i}=\mathbf{M}\mathbf{\mu} \tag{11}\]  
where \(\mu_{i}\) represents the degree of correlation between the \(i_{th}\) SUs and source signal node, \(\mathbf{\mu}=(\mu_{1},\cdots,\mu_{i},\cdots,\mu_{N})^{T}\). Generally, once SUs get closer to the source signal node, the signal energy fingerprint between it and other SUs becomes more similar. In other words, as the distance between SUs and the source signal node gets smaller, the degree of correlation \(\mu_{i}\) becomes greater, otherwise \(\mu_{i}\) will be smaller or even zero. Furthermore, the main constituents of energy fingerprint \(\mathbf{E}\) are described by a few close SUs' energy fingerprints. Only several SUs has greater correlation coefficients, and the rest are zero or close to zero. It means that the degree of correlation vector \(\mathbf{\mu}\) is sparse. According to Equation (4), defining CS information operator as \(\mathbf{A}^{{}^{\prime}}=\mathbf{\Psi}\mathbf{M}\), thus measurement vector \(\mathbf{y}\) can be written as  
\[\mathbf{y}=\mathbf{\Phi}\mathbf{E}=\mathbf{\Phi}\mathbf{M}\mathbf{\mu}=\mathbf{A}^{{}^{\prime}}\mathbf{\mu} \tag{12}\]  
where \(\mathbf{y}\) is the measurement vector of each SU received signal strength (RSS), \(\mathbf{\Phi}\) is grid transfer relationship between each SU and PU source signal. The normalized correlation coefficient \(\mathbf{\mu}\) can be reconstructed by basic CS according to Equation (6). Then the weighted value \(\omega_{i}\) of each SU can be obtained as follows  
\[\omega_{i}=\frac{\mu_{i}}{\sum_{i=1}^{N}\mu_{i}} \tag{13}\]  
Assume \((S_{i}(x),S_{i}(y))\) is coordinate of the \(i_{th}\) SU, then 2-dimensional location of source signal node \((P(x),P(y))\) can be estimated by using WCL  
\[(P(x),P(y))=\sum_{i=1}^{N}\omega_{i}(S_{i}(x),S_{i}(y)) \tag{14}\]  
Figure 2: The relation between primary user (PU) source signal and secondary users (SUs). The following Figure 3 denotes the source node localization flowchart of the PU-CSL algorithm during one sensing period.