## 3 Simulation Setup
### Implementation-Oriented Model (R-Model)
By dividing the sample values by the square root of \(\mathbf{y}_{i}\!\,^{\dagger}\mathbf{y}_{i}/n\), which is the average power of \(\mathbf{y}_{i}\), one obtains a sequence with unitary average power. Since \(\mathbf{X}\) is Gaussian, \(\{\mathbf{y}_{i}\}\) have Gaussian distributed sample values, conditioned on the corresponding channel gain. If \(\sigma^{2}\) is the variance of these (complex) samples after the effect of the LNA and the AGC, to guarantee that six standard deviations (practically the whole signal excursion or \(99.73\%\) of the sample values) of the I&Q signals will be within \([-D/2,D/2]\), we shall have \(6\sqrt{\sigma^{2}/2}=D\), which means that the signal power at the output of the AGC will be \(\sigma^{2}=2D^{2}/36\). This justifies the factor \(D\sqrt{2}/6\) in Equation (7). Finally, as the name indicates, the overdrive factor \(f_{\text{od}}\geq\) is included as a multiplier in Equation (7) to simulate different levels of signal clipping caused by real ADCs, _i.e._, it produces signal amplitudes greater than or equal to 6. For example, an \(f_{\text{od}}=1.2\) means that the dynamic ranges of the signals at the input of the I&Q ADCs will be \(20\%\) larger than the dynamic ranges of the ADC's inputs. The I&Q clippings act on each sample value s applied to their inputs according to \(s\leftarrow\text{sign}(s)\text{min}(|s|,D/2)\). From above one can see that the AGC will affect not only the noise level that corrupts the received samples in the \(i\)-th CR, but will also change the statistical behavior of the amplified samples of \(\mathbf{y}_{i}\). Based on this we conjecture that ED as well as other detection techniques that demand knowledge of the noise variance information, such as MED (or RLRT), must take the gains in Equation (7) into account in both the noise variance estimate and in the derivation of new test statistics different from Equations (5) and (6). Further investigations on this issue are beyond the scope of this paper, representing an opportunity for future contributions. Back to the description of the implementation-oriented model based on Figure 1, the whitening filter matrix \(\mathbf{W}\)[24] that multiplies the MA-filtered, amplified and perhaps clipped versions of \(\{\mathbf{y}_{i}\}\) is computed with floating point according to \(\mathbf{W}=\mathbf{U}\mathbf{C}^{-1}\), where \(\mathbf{U}\) is the orthogonal matrix from \(\mathbf{Q}=\mathbf{U}\mathbf{\Sigma}\mathbf{K}^{\mathsf{T}}\), the singular-value decomposition of the covariance matrix \(\mathbf{Q}\). The elements of \(\mathbf{Q}\) are \(Q_{ij}=a_{|i-j|}\), with \(\{a_{k}\}\) representing the discrete autocorrelation function of the MA filter impulse response, _i.e._, \(a_{k}=(1-k/L)\), for \(k\leq L\), and \(a_{k}=0\) otherwise, for \(i,j,k=0,1,\ldots,(n-1)\). Matrix \(\mathbf{C}\) is the lower triangular matrix from the Cholesky decomposition of \(\mathbf{Q}\). The effect of the analog to digital conversion of the processed sample values that will be sent to the FC is modeled by a quantizer with configurable number \(N_{\text{q}}\) of quantization levels. Assuming no bit errors in the reporting channels, the modified received matrix \(\mathbf{Y}=\mathbf{H}\mathbf{X}+\mathbf{V}+\mathbf{V}_{\text{IN}}\) in the implementation-oriented model is then formed at the FC, from which the covariance matrix \(\mathbf{R}\) is computed, and then the eigenvalues \(\{\lambda_{i}\}\), \(i=1,2,\ldots,m\). The test statistics for GLRT, MMED, MED, and ED are respectively computed from Equations (3)-(6). In each detection technique, the corresponding test statistic is compared with a threshold computed from the desired false alarm probability, and a final decision upon the occupancy of the sensed channel is reached.