0% found this document useful (0 votes)
23 views9 pages

ELM460 Spring24 Lab02

Uploaded by

Hakan Demir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views9 pages

ELM460 Spring24 Lab02

Uploaded by

Hakan Demir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

ELM 460 Software Based Communication Spring 2024

ELM 460 Lab 2: Introduction to USRP


1. Introduction

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

2.1. Transmitter Overview

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)

The diagram has the following main components:


• Open Tx Session: Opens a transmit (Tx) session to the
device you specify in the device names input and returns
session handle as output. You must add a control called
“device names” that you will use to inform LabVIEW of
the IP address or resource name of the USRP.

• Configure Signal: Configures parameters of Tx or Rx. IQ


rate is the sampling rate of the baseband I/Q data in
samples per second (S/s). Carrier frequency is the carrier
frequency of the RF signal in Hz. Gain is the Tx gain
applied to the RF signal in dB. Active antenna is the
antenna port to use for this channel. Coerced IQ
rate/carrier frequency/gain are the actual corresponding values supported by the device.

• Write Tx data: writes complex, 12-bit signed integer


data to the specified channel. The baseband samples to
transmit as an array of complex, 12-bit signed integer
data. The real and imaginary components of the data
correspond to the in-phase (I) and quadrature-phase (Q)
data, respectively. I and Q are interleaved [I, Q, I, Q, ...]
in the array.

• Close Session: Closes the session handle to the device.

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.2. Construct the USRP Transmitter

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.

4. Open a blank VI and rename as “Tx_template.vi”.

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

3.1. Receiver Overview

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.

• Open Rx Session: Opens a receiver (Rx) session to the


device you specify in the device names input and returns
session handle out. You must add a control called “device
names” that you will use to inform LabVIEW of the IP
address or resource name of the USRP.

• Initiate: Starts the Rx acquisition.

• Fetch Rx Data: Fetches complex, 12-bit signed integer


data from the specified channel. Number of samples
defined the samples to fetch from the acquisition channel.
Data is the received baseband samples as an array of
complex, 12-bit signed integer data. The real and imaginary
components of the data correspond to the in-phase (I) and
quadrature-phase (Q) data, respectively. I and Q are interleaved [I, Q, I, Q, ...] in the array. The total number
of elements returned in the array equals the value of the number of samples parameter x 2.

• Abort: Stops an acquisition previously started.

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.2. Construct the USRP Receiver

We will start by building the above receiver diagram.

1. Open a blank VI and rename as “Rx_template.vi”.

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

3.3. Transmitting and Receiving Sinusoidal Signal

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.

3.3.1. Transmitter Side

1. Duplicate the “TX_template.vi” and rename as “upper_side_IQ.vi”.

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.

8. Set the parameters as follows:


o IQ rate = 1M
o Carrier frequency = 2G
o Gain = 0
o Active antenna = TX1
o Waveform size = 1000
o Tone frequency = 1k
o Tone amplitude = 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

3.3.2. Receiver Side

1. Duplicate the “RX_template.vi” and rename as “RX_sinusoidal.vi”.

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)

4. Set the parameters as follows:


a. IQ rate = 1M
b. Carrier frequency = 2G
c. Gain = 0
d. Active antenna = RX2
e. Number of samples = 1000

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.8. What is LNA, PA, PLL, VCO? Please comment in summary.

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.

You might also like