# A Software-Defined Radio Platform for Teaching Beamforming Principles
## 2 System Architecture
### Software Interface  
A customized user interface was designed in GNU Radio for setting the individual phases and amplitudes of the four USRP RF channels used for transmission (TX). The GNU Radio flowchart used for transmission is depicted in Figure 3.  
Figure 3: GNU Radio transmission flowchart.  
Figure 2: Beamforming platform architecture.  
For the TX system, we have set up a single sinusoidal signal source block that generates a signal \(\mathrm{s[n]}\) according to Equation (1).  
\[\mathrm{s[n]}=\mathrm{A}\ \times\ [\mathrm{cos}(2\pi\frac{\mathrm{f}}{ \mathrm{f}\mathrm{s}}\mathrm{n})+\mathrm{j}\ \times\mathrm{sin}\ (2\pi\frac{\mathrm{f}}{ \mathrm{f}\mathrm{s}}\mathrm{n})] \tag{1}\]  
where A is the signal amplitude set in the block's parameters, f is frequency of the baseband sine wave (set to 10 kHz), and fs is the sampling rate (set to 120 kHz). The output of the signal source block was split in four (each for one TX channel) and passed to a multiplication block. The multiplication block multiplies the signal with a complex constant, resulting in signals \(\mathrm{s_{i}[n]}\), with i ranging from one to four, corresponding to each of the TX channels. The expression of the signal \(\mathrm{s_{i}[n]}\) is calculated according to Equation (2).  
\[\mathrm{s_{i}[n]}=(\mathrm{Real_{i}+j\mathrm{imag_{i}}})\ \times\mathrm{A}\ \times[\mathrm{cos}(2\pi\frac{\mathrm{f}}{ \mathrm{f}\mathrm{s}}\mathrm{n})+\mathrm{j}\ \times\mathrm{sin}\ (2\pi\frac{\mathrm{f}}{ \mathrm{f}\mathrm{s}}\mathrm{n})] \tag{2}\]  
The values of the real (\(\mathrm{Real_{i}}\)) and imaginary (\(\mathrm{Imag_{j}}\)) parts of the multiplication constants can be modified for TX channels 2-4 using QT GUI Range type variables. According to Equation (2), the phase of the signals on each of the TX channels is thus modified by setting the complex value of the constant source block. By modifying the phase of the signal on each of the TX channels, the beam can be steered in real time towards the desired azimuthal location, observing the principle of beamforming.  
Three QT GUI Time Sink blocks were configured to view the waveforms of signals \(\mathrm{s_{i}[n]}\), i \(\in\) [2,4], versus \(\mathrm{s_{i}[n]}\), with the phase difference between the channels referenced to the phase of the signal corresponding to TX channel 1. The digital-to-analog converter converts the \(\mathrm{s_{i}[n]}\) IQ digital signal to the analog signal \(\mathrm{s_{i}(t)}\), where it mixes it with the LO frequency (\(\mathrm{f_{LO}}\)) to obtain the RF signal \(\mathrm{s_{TX}(t)}\). In the USRP Sink block, we have configured four TX channels. The center frequency parameter of the USRP Sink block sets the RF frequency of the TX channel and is set in this example to 3.53 GHz.  
The amplitude of each individual channel can be modified by setting the value of the gain parameter in the USRP Sink block, also configured by a QT GUI type variable. The user interface obtained after running the GNU Radio flowchart is presented in Figure 4, enabling real-time setting of amplitude and phase for USRP TX channels 1-4.  
The RX channel is also configured within GNU Radio, according to the flowchart presented in Figure 5 (top), by setting a USRP source on the center frequency of 3.53 GHz and using a QT GUI Frequency Sink type block. The lower part of Figure 5 presents  
Figure 4: GNU Radio interface for setting TX channel phase/amplitude.  
the corresponding frequency spectrum, with the measured 3.53 GHz continuous signal. With the E field probe connected to the USRP RX channel and the flowchart running, the variation in the amplitude received can be observed in real - time.