Waveform Generation Using MATLAB and SDR

This video shows you how to generate and transmit standards-compliant and custom waveforms using MathWorks toolboxes and SDR connectivity. First, I will show you how to use WLAN Toolbox to generate and transmit an 802.11 beacon signal. Then I will show you how to use the Waveform Generator app to generate and transmit a fully custom OFDM waveform.

Let’s start by opening a simple Simulink model that we will use to display the real-time received spectrum. Note that this spectrum display can also easily be achieved in MATLAB. Looking at the receiver block parameters, I will configure the SDR device to sample at a sampling rate of 40MHz at a center frequency of 5.3GHz. Simply clicking play on this model will start the reception of samples from my attached hardware and display the spectrum analyzer. You can see some form of signal being transmitted 15MHz below my center frequency.

Returning to the MATLAB prompt, I will now generate my WLAN waveform with a prewritten script which is built on WLAN Toolbox functionality. The script returns a waveform sampled at 20MHz and configured to transmit at 5.3GHz. Next, I create the transmitter object I will use to configure the SDR device and transmit my waveform. I simply set the minimum set of parameters; namely, sampling rate, center frequency, and gain. Next, I resample my waveform to match my receiver sampling rate of 40MHz and call a single method on my transmitter object, which will download the waveform to my SDR device and transmit it repeatedly onto the air. You can see the sporadic beacon signals being transmitted, and, zooming in on the access point list on my laptop, you can see the TEST BEACON that has been transmitted. In a matter of a couple of minutes, I have generated and transmitted a fully standard-compliant WLAN waveform onto the air.

Next, I will generate and transmit a custom OFDM waveform. To do this, I will use the Waveform Generator app, which lets you generate, impair, visualize, and export modulated waveforms, including OFDM, QAM, PSK, and WLAN. To open the app, browse the available apps on the MATLAB toolstrip and select Wireless Waveform Generator. In the Waveform app, you can see that I have prepopulated an OFDM signal with some zero value pilots, giving a notch in the spectrum. I can generate the waveform and export it to the MATLAB workspace. Looking at the waveform, I can see that it has been sampled at 16MHz. Again, I resample the generated waveform to the sample rate the hardware is configured to use and transmit it onto the air using a single line of code. Again, we see in the received spectrum the clear notch that we generated with the Waveform Generator app. 

The functionality I have shown here is available in two different support packages for Xilinx Zynq-Based Radio hardware and Analog Devices Pluto Radio hardware. The support packages are free downloads based on Communications Toolbox. To find these support packages, you can search for “matlab sdr” in your favorite search engine. The MATLAB and Simulink SDR page should be at or near the top. On the page you can find out more details on the support packages shown in this video, or some of our other SDR support.

Product Focus