5. MARCO LEGAL Y NORMATIVO POR EL CUAL SE RIGE LA INSTITUCIÓN
6.1. Análisis Teórico, Conceptual y contextual
kS/s up to 16 MS/s to host applications. On-board digital down and up converters provide 15 mHz of tuning resolution and adjustable sample rates [114]
The USRP1 includes connectivity for two daughtercards, enabling two complete transmit/receive chains. In our case, we used only the receive chain by connecting a Basic RX daughterboard, which provides receiving capability to the USRP from 1 to 250 MHz. Fig. 9.1 shows the USRP1 with the Basic RX daughterboard used for the testbed, while Fig.9.2 shows the schematic of USRP1 [114].
Figure 9.2: USRP1 schematic.
9.3
GNU Radio flowgraph
The idea of the parallel Energy Detector originated by the two following constraints: 1. the minimum sample rate of USRP1 is 250 kS/s;
2. channel spacing of DMR is 12.5 kHz.
The sensing of a single DMR channel would have required decimation by a factor 20 and, most of all, a huge waste of sampling and computational capabilities of the USRP1. Fig. 9.3 shows the general scheme of the whole process.
USRP source + Resampler + DC removal Sample rate = 800 KHz Fast Fourier Transform (FFT) Size: 213 = 8192 samples
Parallel Energy Detector
26=64 channels
213
26 = 27= 128 samples per channel
Compute occupancy percentage for each channel Noise variance estimation and update UDP sink: results are sent to the
external GUI
Figure 9.3: Parallel Energy Detector diagram.
After receiving the I/Q samples through the USRP1, a Fast Fourier Transform (FFT) is performed on every 213 = 8192 samples; the Energy Detector block de-
multiplexes the FFT samples into 26 = 64 DMR channels and computes ED test
statistic on each channel by using 213
26 = 27 = 128 samples per channel; the noise
variance is estimated and updated according to the hybrid approach HED2 (online noise estimation) shown in Sec. 4.1.1; occupation percentages are then computed through consecutive binary decisions and finally the results are sent to the external GUI.
Fig.9.4shows the GNU Radio flowgraph and each operation is described in detail as follows:
• Signal acquisition and resampling: GNU Radio allows to acquire samples from the USRP through the UHD: USRP Source block. The parameters to be set are the central frequency, which is set in the transition band between 2 DMR channels, and the sample rate set to 1 MHz. In order to obtain N parallel DMR channel, with N a power of 2, we resample our signal to 800 kHz with the Rational Resampler block by a decimation factor equal to 5 and interpolation factor to 4, in kHz 1000 · 4
9.3 – GNU Radio flowgraph
Figure 9.4: GNU Radio flowgraph for parallel Energy Detector.
• DC component removal: Any mixed-signal system like a SDR-based receiver has spurs and this translates into a spike at zero frequency of about 10 dB above the noise floor. In order to remove this component, we can compute the moving average of the signal and subtract it from the signal itself. This is accomplished with the Moving Average and Subtract block.
• Fast Fourier Transform: Before converting our signal from time to frequency domain, we need to pack our samples into vectors of 8192 samples, this is accomplished through the Stream to Vector block. Then, the FFT is computed on every 8192 samples in the FFT block.
• Energy Detection: The Energy_Detector_vector custom block computes for each channel the test statistic and compares it against a predefined threshold. Implementation details are described in Sec. 9.4.
• Noise estimation and update: Different blocks have been utilized to imple- ment the hybrid approach 2 mechanism described in Sec. 4.1.2, among which the noise_average_sink custom block. Details are described in Sec. 9.5. • Computation of occupancy percentages: The integrate_vector custom
on the received vectors of binary decisions and sums all 0s or 1s with the same vector index (same channel). The 2 parameters are the vector length and the integration interval, which tells the block how many vectors it will receive before producing one output. The output vector is sent to the Short To Float block and then to the Multiply Const block where the averaging operation and percentage computation are completed by multiplying all the elements of the vector by 100 and dividing them by the integration interval.
• Carrier frequency change and buffer cleaning: The WX GUI Slider block allows to change the carrier frequency. This is done runtime by GNU Radio: the advantage is that the flowgraph is not stopped and there is no time waste for USRP re-calibration, however, with a continuous flow, the initial results on the new central frequency might be affected by the buffers of the previous central frequency. The counter_valve custom block is somehow similar to the existing GNU RadioValve block: when the valve is opened, items are just copied to the output buffer; however, in this case, when the frequency is changed, the valve closes. This can be implemented by a slight modification of the Python code of the flowgraph, in which the public set method set_open of the counter_valve block is set to ’False’ whenever the central frequency of the USRP is changed by the slider:
1 def set_freq0(self,freq0):
2 self.freq0 =freq0
3 self.uhd_usrp_source_0.set_center_freq(self.freq0, 0) 4 self._freq0_slider.set_value(self.freq0)
5 self.spectrum_sensing_counter_valve_0.set_open(False)
Listing 9.1: Carrier frequency setter method in Python.
where set_freq0 is the method of the WX GUI Slider block that changes the central frequency. The Max count parameter of the custom block tells the valve that it will have to wait Max count input items before re-opening it, and thus allowing to clean the buffers of all the other blocks.
• Flowgraph outputs: The spectrum can be visualized in GRC through the WX GUI FFT Sink block, which uses the wxWidgets libraries [115] (as the WX GUI Slider block). The occupancy statistics and the magnitude of the frequency spectrum (computed through the Log Power FFT block) are sent to the external GUI as UDP packets through two UDP Sink blocks.