# Double-Threshold Cooperative Spectrum Sensing Algorithm Based on Sevcik Fractal Dimension
## 2 Double-Threshold Cooperative Spectrum Sensing Algorithm Based on Sevcik Fractal Dimension  
### The Noise Seccik Fractal Dimension  
The SFD of the modulated signal and that of noise have different randomness, so the spectrum sensing model can be constructed using this difference. In the following, we first discuss the calculation of SFD. Assume that the signal waveform whose length is \(N\) consists of the point \((x_{i},y_{i})\), \(0\leq i\leq N-1\). We first normalize the waveform. \[x_{i}^{*}=\frac{x_{i}}{x_{\text{max}}} \tag{1}\]  
\[y_{i}^{*}=\frac{y_{i}-y_{\text{min}}}{y_{\text{max}}-y_{\text{min}}} \tag{2}\]  
where \(x_{\text{max}}\) is the maximum value of \(x_{i}\), and \(y_{\text{max}}\) and \(y_{\text{min}}\) respectively denote the maximum and minimum value of \(y_{i}\). The total length of the curve is calculated as  
\[L=\sum_{i=1}^{N-2}\sqrt{\left(x_{i+1}^{*}-x_{i}^{*}\right)^{2}+\left(y_{i+1}^{ *}-y_{i}^{*}\right)^{2}} \tag{3}\]  
The communication signal sequence is a continuous positive integer and \(x=0,1,2,\ldots,N-1\), thus \(x_{\text{max}}=N-1\) and \(x_{i+1}^{*}-x_{i}^{*}=1/N-1\). Equations (1) and (3) are equivalent to  
\[x_{i}^{*}=\frac{i}{N-1} \tag{4}\]  
\[L=\sum_{i=1}^{N-2}\sqrt{\frac{1}{\left(N-1\right)^{2}}+\left(y_{i+1}^{*}-y_{i }^{*}\right)^{2}} \tag{5}\]  
The SFD of the signal is  
\[D=1+\frac{\text{ln}(L)+\text{ln}(2)}{\text{ln}\left[2\times(N-1)\right]} \tag{6}\]  
Figure 1: Sevcik fractal dimension of different kinds of signals. ASK: amplitude shift keying; FSK: frequency shift keying; QPSK: quadrature phase shift keying; WGN: white Gaussian noise. The SFDs of different kinds of signals are simulated in Figure 1, where the signals include: 2 amplitude shift keying (2 ASK), 2 frequency shift keying (2 PSK), 2 phase shift keying (2 PSK), 4 ASK, 4 FSK, quadrature phase shift keying (QPSK) and white Gaussian noise signal. The simulation parameters are set as follows: bandwidth \(B=20\,\mathrm{kHz}\), carrier frequency \(f_{c}=10\,\mathrm{kHz}\), sampling frequency \(f_{s}=40\,\mathrm{kHz}\), baseband symbol rate \(R_{b}=1000\,\mathrm{bit/s}\), the frequency deviation of the 2 FSK signal is \(5000\,\mathrm{Hz}\), and the frequency deviation of the 4 FSK signal is \(2500\,\mathrm{Hz}\). The noise is additive white Gaussian noise (AWGN). Observing Figure 1, the noise SFD fluctuates randomly between 1.79 and 1.83 with the SNR increasing, whereas the SFDs of the six kinds of modulation signals are decreasing with SNR. From the figure, the SFDs of the modulation signals are gradually separated from the noise SFD for SNRs greater than \(-25\,\mathrm{dB}\). It can be inferred that the noise SFD can be set as the threshold when using SFD in spectrum sensing, and thus the signal can be distinguished from noise when the SNR is greater than a certain value. The fluctuation of noise power could affect the performance of spectrum sensing, and thus result in the detection probability decreasing or the false alarm probability increasing. In order to further prove that the calculation of SFD is insensitive to Gaussian noise, we analyze the influence of noise power on SFD. The received signal follows the Gaussian distribution \(y(n)\sim N(0,\sigma^{2})\) when there is no primary user. Applying N-point discrete Fourier transform (DFT) to \(y(n)\):  
\[\tilde{Y}(k)=\sum_{n=0}^{N-1}y(n)\exp(-j\frac{2\pi}{N}kn)\,\ k=0,1,\ldots,N-1 \tag{7}\]  
Since \(\tilde{Y}(k)\) is a linear combination of \(y(n)\), it also follows the Gaussian distribution. The mean and variance of \(\tilde{Y}(k)\) are expressed as  
\[E\left[\tilde{Y}(k)\right]=\sum_{n=0}^{N-1}E\left[y(n)\right]\exp\left(-j\frac {2\pi}{N}kn\right)=0 \tag{8}\]  
\[D\left[\tilde{Y}(k)\right]=\sum_{n=0}^{N-1}E\left[y^{2}(n)\right]=N\sigma^{2} \tag{9}\]  
where \(E[\cdot]\) and \(D[\cdot]\) respectively denote mean and variance. Assume \(\tilde{Y}(k)=Y_{r}(k)+jY_{i}(k)\), both the real and imaginary parts of the received signal \(\tilde{Y}(k)\) follow the Gaussian distribution \(\mathcal{N}(0,\frac{N\sigma^{2}}{2})\).