Main Content

QPSK Transmitter with USRP Hardware in Simulink

This example shows the implementation of a QPSK transmitter using a Universal Software Radio Peripheral™ (USRP) radio with Simulink®. The QPSK transmitter model continuously transmits indexed 'Hello world' messages at specified center frequency and at bit rate of 1Mbps. You can demodulate the transmitted message using the QPSK Receiver with USRP Hardware in Simulink example with an additional USRP radio.

In order to run this model, you need to ensure that the specified center frequency of the SDRu Transmitter block is within the acceptable range of your USRP daughterboard.

Required Hardware and Software

To run this example, you will need one of the following hardware and the corresponding software support package

Structure of the Example

The top-level structure of the model is shown in the following figure:

The transmitter includes the Bit Generation subsystem, the QPSK Modulator block, and the Raised Cosine Transmit Filter block. The Bit Generation subsystem uses a MATLAB workspace variable as the payload of a frame, as shown in the figure below. Each frame contains 100 'Hello world ###' messages and a header. The first 26 bits are header bits, a 13-bit Barker code that has been oversampled by two. The Barker code is oversampled by two in order to generate precisely 13 QPSK symbols for later use in the Data Decoding subsystem of the receiver model. The remaining bits are the payload. The payload corresponds to the ASCII representation of 'Hello world ###', where '###' is a repeating sequence of '000', '001', '002', ..., '099'. The payload is scrambled to guarantee a balanced distribution of zeros and ones for the timing recovery operation in the receiver model. The scrambled bits are modulated by the QPSK Modulator (with Gray mapping). The modulated symbols are upsampled by two by the Raised Cosine Transmit Filter with a roll-off factor 0.5. The output rate of the Raised Cosine Filter is set to be 400k samples/second with a symbol rate of 200k symbols per second. Ensure that the QPSK transmitter and receiver models have matching symbol rates.

Running the Example

Before running the model, first turn on the USRP and connect it to the computer. Set the Center frequency parameter of the SDRu Transmitter block and run the model. You can run the QPSK Receiver with USRP Hardware model with an additional USRP device to receive the transmitted signal.

Exploring the Example

Due to hardware variations among the USRP boards, a frequency offset will likely exist between the USRP transmitter hardware and the USRP receiver hardware. In that case, perform a manual frequency calibration using the companion frequency offset calibration transmitter and receiver models and examine the resulting behavior.

Since the gain behavior of different USRP daughter boards also varies considerably, the default gain setting in the transmitter and receiver models may not be well-suited for your daughter boards. If the message is not properly decoded by the receiver model, you can vary the gain of the source signals in the SDRu Transmitter block of this model, and that of the SDRu Receiver block in the receiver model.