ELM460 Spring24 Lab02
ELM460 Spring24 Lab02
Following a common software-defined radio architecture, NI USRP 2901 hardware has digital front end
with high-speed analog-to-digital converters (ADCs) and digital-to-analog converters (DACs) featuring for the
digital down-conversion (DDC) and digital up-conversion (DUC). The receiver chain begins with a highly
sensitive analog (RF) front end capable of receiving very small signals and digitizing them using direct down-
conversion to in-phase (I) and quadrature (Q) baseband signals. Down-conversion is followed by high-speed
analog-to-digital conversion and a DDC that reduces the sampling rate and packetizes I and Q for transmission to
a host computer for further processing. The transmitter chain starts with the host computer where I and Q are
generated and transferred over the Ethernet cable to the NI USRP 2901 hardware. A DUC prepares the signals for
the DAC after which I-Q mixing occurs to directly upconvert the signals to produce an RF frequency signal,
which is then amplified and transmitted.
1.1. Contents
1. Introduction
2. USRP Transmitter
3. USRP Receiver
1.2. Report
Submit the answers, figures and the discussions on all the questions. The report is due as a hard copy at the
beginning of the next lab.
1
In this laboratory study, the document of the ECE463: IoT and Software Defined Radio Lab course at the University of
Illinois Urbana-Champaign was used.
ELM 460 Software Based Communication Spring 2024
2. USRP Transmitter
LabVIEW can interact with the USRP transmitter by the blocks under Hardware Instruments I/O Instruments
Drivers NI-USRP Tx. The following diagram shows the basic setup for the USRP transmitter. We will start
by building the below diagram and add/modify more functions/algorithms in the rest lab sessions. (You need USRP
and RF Communication Toolkit)
In this laboratory study, the document of the ECE463: IoT and Software Defined Radio Lab course at the University of
Illinois Urbana-Champaign was used.
ELM 460 Software Based Communication Spring 2024
Start by building the above diagram. In this section, we will simply transmit the carrier frequency without any IQ
signal modulation.
1. Make sure the USRP is connected to the machine and turned on.
2. Run the NI-USRP Configuration Utility software by clicking Windows Start National Instruments
Folder NI-USRP Configuration Utility.
3. Find the device ID and the connection type. The USRP SHOULD be power-on prior to your
computer.
5. Place Open Tx Session, Configure Signal, Write Tx Data, and Close Session.
6. Click Open Tx Session and find “Create Constant or Create Control” button in the item panel in the right
side. Input your USRP device ID in the constant box.
7. Create a “cluster properties (property node)” block. In Behavior tab, set all to write.
3
In this laboratory study, the document of the ECE463: IoT and Software Defined Radio Lab course at the University of
Illinois Urbana-Champaign was used.
ELM 460 Software Based Communication Spring 2024
8. Wire the session handle ports through all four USRP blocks (Open Tx Session Cluster Properties
Configure Signal Write Tx Data Close Session).
9. Click the cluster properties block and select Configuration Enabled Channels. Left-click the port and
create a constant. Input “0” for the enabled channel. This will enable “RF0” channel in the front panel of
the USRP.
10. Create three DBL-type controls: IQ rate, Carrier Frequency, and Gain. Create a string-type control,
Active Antenna. Create three DBL-type indicators: Coerced IQ rate, Coerced Carrier Frequency, and
Coerced Gain. Connect the controls and the indicators to the corresponding ports of the Configure Signal.
11. Create a while loop and place the Write Tx Data block inside.
12. Wire the Error out ports through all four USRP blocks. Create an Error indicator and wire the Error out
port of Close Session.
13. Create a Stop button and place it inside the loop. Use OR block to take the stop signal and the error out
from the Write Tx Data block. Feed the output of OR block to the terminal condition.
14. As described in the introduction, the USRP Tx/Rx is a quadrature modulation system. It mixes the in-
phase (I) signal with the cosine wave (whose frequency is the “carrier frequency”) and the quadrature-
phase (Q) signal with the sine wave. The Write Tx Data block takes the IQ baseband-samples and
modulates them with the two sinusoids. Note that the input data of the Write Tx Data block can have
various different types. We’ll use the complex double (CDB) array. Click the block and change the function
configuration to Write Tx Data (CDB). The real and imaginary parts of this complex data array
correspond to the in-phase (I) and quadrature-phase (Q) data, respectively.
In this laboratory study, the document of the ECE463: IoT and Software Defined Radio Lab course at the University of
Illinois Urbana-Champaign was used.
ELM 460 Software Based Communication Spring 2024
3. USRP Receiver
LabVIEW can interact with the USRP receiver by the blocks under Hardware Interfaces NI-USRP Rx. The
following diagram shows the basic setup for the USRP receiver. We will start from this diagram and add/modify
more functions/algorithms in the rest lab sessions.
In this laboratory study, the document of the ECE463: IoT and Software Defined Radio Lab course at the University of
Illinois Urbana-Champaign was used.
ELM 460 Software Based Communication Spring 2024
2. Place Open Rx Session, Configure Signal, Initiate, Fetch Rx Data, Abort and Close Session. Similar
to Tx, create the controls and indicators for IQ rate, carrier frequency, gain, and active antenna. Input “0”
for the enabled channel. This will enable “RF0” channel in the front panel of the USRP. Create a while
loop for Fetch Rx Data. Click the Fetch Rx Data. Change its Function Configuration to Fetch Rx Data
(CDB WDT). The diagram will look like as the following figure.
In this laboratory study, the document of the ECE463: IoT and Software Defined Radio Lab course at the University of
Illinois Urbana-Champaign was used.
ELM 460 Software Based Communication Spring 2024
We will now generate a sinusoidal signal with a frequency offset to the carrier frequency and transmit it. We will
feed a cosine waveform to in-phase data and a sine waveform to quadrature-phase data.
2. Create two more double-type controls: Tone frequency and Tone amplitude.
3. Place two “Wave Generator” blocks from Waveform Waveform Generation Analog Waveform. By
default, the block is “Sine” wave and “Waveform” data type.
4. Wire the Tone frequency control to the Frequency port of the two Wave Generator blocks and the Tone
amplitude control to the Amplitude port. Wire the Waveform size control to the Samples port. Wire the
Sample rate port to the Coerced IQ rate indicator.
5. Create a numeric constant of “90” and wire it to the “Phase in” port of one of the Wave Generator blocks.
6. Use “Waveform Properties” to get the cosine and sine samples from the Wave Generator blocks.
7. Use “Real and Imaginary to Complex” to receive the cosine and sine samples and convert them to complex
numbers. You should get the below diagram.
In this laboratory study, the document of the ECE463: IoT and Software Defined Radio Lab course at the University of
Illinois Urbana-Champaign was used.
ELM 460 Software Based Communication Spring 2024
2. In Rx, we want to display the spectrum of the received signal just like the spectrum analyzer. We also want
to display the in-phase signal and the quadrature-phase signal in the time domain.
3. Create Waveform Properties for the data port of Fetch Rx Data. Use “Complex to Real and Imaginary”
to extract I and Q samples from the complex array. Use Build Waveform blocks and Waveform indicators
to display the IQ time domain samples. (Use FFT Power Spectrum)
5. Connect the TX1 antenna port of RF0 to the RX2 antenna port of RF0 using an SMA cable and
(optional: a 30 dB attenuator) and run the code. Verify that a right signal is generated.
6. Change the tone frequency to 5k, 20k and verify that the correct tone appears on the RX Waveform
Graph.
In this laboratory study, the document of the ECE463: IoT and Software Defined Radio Lab course at the University of
Illinois Urbana-Champaign was used.
ELM 460 Software Based Communication Spring 2024
3.4. Questions
3.4.1. While running “upper_side_IQ.vi”, run “RX_sinusoidal.vi” and obtain the baseband power
spectrum.
3.4.2. Change the TX gain to 10, 15, show the I/Q graphs and measure the power spectrum using block
below.
3.4.3. Change the tone frequency to 50k, 100k, 200k, show the I/Q graphs and measure the power
spectrum.
3.4.4. Change the waveform size to 1005. What is it changed on the I/Q graph?
3.4.5. Change the sine wave signal in above example to a square wave. How does the spectrum
differ in each case?
3.4.6. Create “lower_side_IQ.vi” which implements a similar code to “upper_side_IQ.vi” but the main
tone is located lower than the carrier frequency tone. While running “lower_side_IQ.vi”, run
“RX_sinusoidal.vi” and obtain the baseband power spectrum.
3.4.7. Create “double_side_IQ.vi” which implements a similar code to “upper_side_IQ.vi” but with
two tones that are located on both the upper and lower side of the carrier frequency tone. How
does the amplitude of the tone differ in each case? While running “double_side_IQ.vi”, run
“RX_sinusoidal.vi” and obtain the baseband power spectrum.
3.4.9. Save all the VIs and the Project since they will be used in subsequent labs.
In this laboratory study, the document of the ECE463: IoT and Software Defined Radio Lab course at the University of
Illinois Urbana-Champaign was used.