# Real-Time Implementation of Multiband Spectrum Sensing Using SDR Technology
## 4 Real-Time Experiments and Results
### Implemented Scenario  
The implemented environment is presented in Figure 15. Here, four SDR devices were employed. Three of these four SDR devices were established as \(SU_{\text{s}}\) and one was established as a _PU_. Additionally, a cellphone was used as a _PU_. Characteristics of each device used, as well as the parameters associated with the experimentation, are described in Table 2. In this real-time implementation, all these devices were controlled by an application developed by the authors that is briefly explained later. The order in which the SDR devices were located was dictated by the next priority: LimeSDR mini, followed by HackRF One and, finally, RTL-SDR. This priority was given by the bandwidth that each device can handle. Accordingly, the display and alignment of the signals in the application were carried out: (i) the display of the signals was based on the bandwidth of each connected device; (ii) the alignment of the sign  
Figure 14: Delivered signals from the “detection of primary users” block. Figure 15: Implemented scenario. to the device that can perceive the widest bandwidth. That is, all the signals would be at the same power level as the device with the highest bandwidth; nevertheless, this processing does not change the shape of the PSD or the occupation of the signal in any way. This alignment only allows for better aesthetics in the application. In addition to the signal perceived by the (RTL-SDR), 1/8 of the beginning and 1/8 of the end of the frame were omitted, which means that 1/4 of the original frame was omitted (see Figures 14 and 16). With this processing, distortion in the signal was avoided at the beginning and at the end. This distortion was due to the quality of the RTL hardware. Due to this phenomenon, the RTL-SDRs only perceived 2.4 MHz of bandwidth (see Table 2). Moreover, the sliding time window module had a delay (average) of 0.0065 s between the SDR devices and the PC (this value did not depend on the number of samples contained in the PSD). The PSD estimation module showed an execution time (mean) of 0.017 s in a frame with 512 samples, 0.018 s in a frame with 1024 samples, 0.02 s in a frame with 2048 samples, and 0.026 s in a frame with 4096 samples. The module for impulsive noise removal showed an execution time (average) of 0.00047 s in a frame with 512 samples, 0.00051 s in a frame with 1024 samples, 0.00071 s in a frame with 2048 samples, and 0.0011 s in a frame with 4096 samples. The estimation of frequency bands and detection of primary user module showed an execution time (mean) of 0.0339 s in a frame with 512 samples, 0.0468 s in a frame with samples, 0.0775 s in a frame with 2048 samples, and 0.1264 s in a frame with 4096 samples. This means that, on average, this implementation took 0.0621 s in a frame with 512 samples, 0.07181 s in a frame with 1024 samples, 0.10471 s in a frame with 2048 samples, and 0.156 s in a frame with 4096 samples. These values were measured using a laptop computer with 12 GB of RAM and an Intel i5 processor, and 10,000 frames were analyzed for each value. According to the parameters and configurations mentioned in Table 2, the \(SU_{s}\) were observed as contiguous bands, as shown in Figure 16, which means that a total of 24.8 MHz \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Tx/Rx** & \(SU_{1}\) & \(SU_{2}\) & \(SU_{3}\) & \(PU_{1}\) & \(PU_{2}\) \\ \hline Device & HackRF One & RTL-SDR 0005 & RTL-SDR 0002 & LimeSDR Mini & Cell phone call \\ Tx Frequency (MHz) & - & - & - & 847.8 & 842.5 \\ Type of transmission & - & - & - & OFDM & CDMA [43] \\ Tx Bandwidth (MHz) & - & - & - & 1 & 5 \\ Rx Frequency (MHz) & 835 & 846.2 & 848.6 & - & - \\ Rx Bandwidth (MHz) & 20 & 2.4 & 2.4 & - & - \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Parameters of the considered devices. Figure 16: Frequency range perceived by \(SU_{s}\). of bandwidth was perceived.