In the first post on this blog series, I explained how to use the probe blocks in a basic project. In this post, I will show you how to integrate them to an existing hardware-in-the-loop project.
The project I choose for this demonstration is the GSM channelizer developed on top of Nutaq Wideband Digitizer (PicoDigitizer 250 + Wideband Receiver). See this blog and this video to understand the design flow and how the channelizer works. Since the host application has been developed using GNU Radio Companion (GRC) and there is configurable real-time signal processing performed in the FPGA, this project is well suited to demonstrate the utility of the GRC probe blocks.
Briefly, what the channelizer project does is separate the 102.4 MHz input signal bandwidth in 512 individual 200-kHz wide channels. Their average power of each channel is calculated inside the FPGA and is sent to the host computer for displaying the waterfall plot of every channel. Furthermore, two 200-kHz channels can be continuously monitored by specifying their channel index in the Custom Register 2 and 3.
I will introduce the probe blocks into my project to automatically select the most powerful GSM 850 uplink channels. This will allow the GUI to always display the channel with the highest energy without any human interaction. The Figure 1 shows the blocks I added to the default example in order to achieve this new behavior.
The upper left Real-Time Data Exchange (RTDEx) blocks retrieve from the FPGA the averaged magnitude of each channel and their corresponding index. Using the “Stream to Vector”, “Streams to Vector” and “Probe Signal Vector”, it is now possible to get a snapshot of the energy of the 512 channels. The index and magnitude streams has been converted first into two 512-element vectors and secondly to a single 1024-element vector to make sure to get a contiguous snapshot of all channels and to make sure the index and the magnitude of the channels are matched together. By calling the level function the “Probe Signal Vector” block, a 1024-element array is accessible: 512 index and 512 magnitude values corresponding to the index.
The “Function Probe” block will call the “Probe Signal Vector” level function 10 times every second as indicated by the Figure 2. The 1024-element array is now accessible when using the probe_variable string in GRC.
The GSM 850 uplinks frequency boundaries1 and their corresponding channel index have been defined using “Variable” blocks.
Now using proble_variable array, the index of the most powerful channel between index 81 and 206 must be retrieved. First, the magnitude array and index array for channels 81 to 206 are extracted using Python script instructions (Figure 4 and Figure 5).
Using max and index instructions, the index of the most powerful uplink channel is retrieved (Figure 6 and Figure 7).
Then, the chan_index_max_mag value is used to update the GUI Slider value that select the Channel 1 by setting the Custom Register 2 value. Now, everything is in place in order to display the highest magnitude channel and update the selected channel 10 times each second.
In the first half of the following video, a signal generator output a sinusoidal wave and its frequency is tuned manually. The selected channel is updated automatically and the application is able to track the sinusoidal wave even if its frequency changes. In the second half of the video, a GSM cellular transmit data to a base station. The transaction occupies more than 1 GSM channel and it is possible to see the selected channel index switching from the highest magnitude channel to another.
In this blog I showed how to include the probe blocks to the GSM channelizer demonstration in order to make a more dynamic project. All the host application was developed in the GNU Radio Companion environment; no change to the generated Python code was needed.
Using the probe blocks, some processing can be done in other to provide feedbacks to the GNU Radio application itself or to the FPGA algorithm parameters. I hope that this blog showed you the utility of the probe blocks and that you will be able to develop your interactive application directly from GNU Radio Companion.