This example shows how to use the Repeated Waveform Transmitter feature of the Xilinx® Zynq-Based Radio Support Package with Analog Devices AD9361/AD9364 to continuously transmit QPSK data. Transmitted data can be sourced from a provided QPSK signal or generated using the companion zynqRadioQPSKTransmitRepeatRecordSL 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 Getting Started documentation for details on configuring your host computer to work with the Support Package for Xilinx Zynq-Based Radio.
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.
Before running the example, ensure you have performed the following steps:
1. Configure your host computer to work with the Support Package for Xilinx Zynq-Based Radio. See Getting Started for help.
2. Any of the following examples can be used to receive and decode the data:
The QPSK Receiver Using Analog Devices AD9361/AD9364 Simulink example.
The Targeting HDL Optimized QPSK Receiver Using Analog Devices AD9361/AD9364 Simulink example.
You can run this example by executing the zynqRadioQPSKTransmitRepeatAD9361AD9364ML script.
This simple example shows how to use the transmitRepeat feature with recorded data to exercise a receiver algorithm:
Loads the provided data.
Creates the SDR Transmitter object, which will be used to communicate with the SDR hardware.
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 'zynqRadioQPSKTransmitData.mat' has been provided, and can be loaded using the following command.
load('zynqRadioQPSKTransmitData.mat'); % Comment out if using own data from workspace
Alternatively you can load the companion zynqRadioQPSKTransmitRepeatRecordSL 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. The Center Frequency and Baseband Sample Rate should match those used in the receiver.
tx = sdrtx('AD936x', ... 'BasebandSampleRate', 520.841e3, ... 'CenterFrequency', 2.4e9, ... 'ChannelMapping', 1, ... 'ShowAdvancedProperties', true);
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.
## 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.
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 QPSK Receiver Using Analog Devices AD9361/AD9364 Simulink example after transmission has started and you should soon begin to see the decoded 'Hello World ###' messages.
HDL-optimized models, such as zynqRadioQPSKRxFPGAAD9361AD9364SL can be run with or without targeting, however you should make sure that the targeted bitstream is already loaded before calling the transmitRepeat method.
An example of how to generate a custom dataset for transmission is provided in the zynqRadioQPSKTransmitRepeatRecordSL model. The model is based on the zynqRadioQPSKTxAD9361AD9364SL 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 8 million samples (4 million if using 2 channels).