MATLAB Examples

Repeated Transmission of a QPSK Waveform Using USRP® E310

This example shows how to use the Repeated Waveform Transmitter feature of the USRP® Embedded Series Radio Support Package with USRP® E310 to continuously transmit QPSK data. Transmitted data can be sourced from a provided QPSK signal or generated using the companion usrpe3xxQPSKTransmitRepeatRecordSL model. The transmitted data can then be received and decoded on the existing MATLAB® and Simulink® based QPSK receivers, all while using a single radio.

Refer to the Guided Host-Radio Hardware Setup documentation for details on configuring your host computer to work with the Support Package for USRP® Embedded Series.

Contents

Introduction

The Repeated Waveform Transmitter is a useful feature that allows recorded baseband data to be stored in hardware memory and repeatedly transmitted without gaps. The signal can then be received by the receiver on the same hardware. This example uses the transmitRepeat functionality to store and transmit pre-recorded QPSK data while using one of the MATLAB or Simulink QPSK receivers to capture and decode it on the same radio.

Setup

Before running the example, ensure you have performed the following steps:

1. Configure your host computer to work with the Support Package for USRP® Embedded Series Radio. See Guided Host-Radio Hardware Setup for help.

2. Any of the following examples can be used to receive and decode the data:

Running the Example

You can run this example by executing the usrpe3xxQPSKTransmitRepeatML script.

Example Structure

This simple example shows how to use the transmitRepeat feature with recorded data to exercise a receiver algorithm:

  1. Loads the provided data.
  2. Creates the SDR Transmitter object, which will be used to communicate with the SDR hardware.
  3. Uses the transmitRepeat method to store the QPSK data onto the hardware memory and continue transmitting until the release method is called.

Load Data into the Workspace

A dataset called 'usrpe3xxQPSKTransmitData.mat' has been provided, and can be loaded using the following command.

load('usrpe3xxQPSKTransmitData.mat'); % Comment out if using own data from workspace

Alternatively you can load the companion usrpe3xxQPSKTransmitRepeatRecordSL model and generate your own custom dataset. In this case the load line can be commented out. See Generating Custom Data for Transmission for more information on generating your own data.

Create the SDR Transmitter System Object

This example communicates with the radio hardware using the SDR Transmitter system object. By default the created object is set to communicate with the USRP® E310 radio hardware. The Center Frequency and Baseband Sample Rate should match those used in the receiver.

tx = sdrtx('E310', ...
              'BasebandSampleRate',      245.76e3, ...
              'CenterFrequency',         2.4e9, ...
              'ChannelMapping',          1, ...
              'ShowAdvancedProperties',  true, ...
              'BypassUserLogic',         true);

Begin Transmission

The transmitRepeat method transfers the baseband QPSK transmission to the SDR platform, and stores the signal samples in hardware memory. The example then transmits the waveform continuously over the air without gaps until the release method for the transmit object is called. Messages are displayed in the command window to confirm that transmission has started successfully.

transmitRepeat(tx, usrpe3xxQPSKTransmitData);
## Establishing connection to hardware. This process can take several seconds.
## Waveform transmission has started successfully and will repeat indefinitely.
## Call the release method to stop the transmission.

To end the transmission, call the release method (release(tx)) from the MATLAB command window.

Receiving the Data

You can now run your receiver. QPSK modulated messages will be transmitted continuously from the radio and running a receiver will not affect the transmitted data. For best performance, attach antennas or a loopback cable between transmit and receive antennas.

Execute the usrpe3xxQPSKReceiverML script after transmission has started and you should soon begin to see the decoded 'Hello World ###' messages.

HDL-optimized models, such as usrpe3xxQPSKRxFPGASL can be run with or without targeting, however you should make sure that the targeted bitstream is already loaded before calling the transmitRepeat method.

Generating Custom Data for Transmission

An example of how to generate a custom dataset for transmission is provided in the usrpe3xxQPSKTransmitRepeatRecordSL model. The model is based on the usrpe3xxQPSKTxSL QPSK transmitter model, except now the data gets saved into a workspace variable rather than transmitted directly by the radio.

Note that in order for the recorded data to be successfully stored in the hardware buffer, the data you create cannot result in less than 4096 samples or exceed 16 million samples (8 million if using 2 channels).

Copyright Notice

USRP® is a trademark of National Instruments Corp.