Main Content

Wireless Waveform Generator

Create, impair, visualize, and export modulated waveforms

Description

The Wireless Waveform Generator app enables you to create, impair, visualize, and export modulated waveforms.

Using the app, you can:

  • Generate custom OFDM, QAM, and PSK modulated waveforms.

  • Generate sine wave test waveforms.

  • Generate 5G NR uplink and downlink carrier waveforms. This feature requires 5G Toolbox. For more information, see the 5G Waveform Generator (5G Toolbox) app reference page.

  • Generate LTE modulated waveforms. This feature requires the LTE Toolbox. For more information, see the LTE Waveform Generator (LTE Toolbox) app reference page.

  • Generate WLAN (802.11™) modulated waveforms. This feature requires the WLAN Toolbox. For more information, see the WLAN Waveform Generator (WLAN Toolbox) app reference page.

  • Generate Bluetooth modulated waveforms. This feature requires the Bluetooth Toolbox.

  • Generate radar waveforms. This feature requires Phased Array System Toolbox.

  • Generate ZigBee® and UWB (IEEE® 802.15.4z) modulated waveforms. This feature requires the Communications Toolbox Library for ZigBee and UWB add-on.

  • Export the waveform to your workspace or to a .mat or a .bb file.

  • Export waveform generation parameters to a runnable MATLAB® script or a Simulink® block.

    • Use the exported script to generate your waveform without the app from the command line.

    • Use the exported block as a waveform source in a Simulink model. For more information, see Waveform From Wireless Waveform Generator App.

  • Visualize the waveform in constellation diagram, spectrum analyzer, OFDM grid, and time scope plots.

  • Distort the waveform by adding RF impairments, such as AWGN, phase offset, frequency offset, DC offset, IQ imbalance, and memoryless cubic nonlinearity.

  • Generate a waveform that you can transmit using a connected radio or lab test instrument.

For more information, see Create Waveforms Using Wireless Waveform Generator App.

Wireless Waveform Generator app display of 16QAM waveform with IQ imbalance and RRC filtering.

Open the Wireless Waveform Generator App

MATLAB Toolstrip: On the Apps tab, under Signal Processing and Communications, click the app icon.

MATLAB Command Prompt: Enter wirelessWaveformGenerator.

Examples

expand all

Open the Wireless Waveform Generator app and select the OFDM button from the Waveform Type tab to configure an OFDM waveform. Click Generate to generate the default waveform. The displayed waveform is an OFDM waveform with QPSK-modulated symbols.

Wireless Waveform Generator app display of OFDM waveform for default configuration.

Click Insert DC null and increase the Guard band subcarriers to [20;19]. Click Generate again. The plotted waveform changes to reflect the updated configuration.

Wireless Waveform Generator app display of OFDM waveform with DC null and guard band subcarriers set to [20;19].

Open the Wireless Waveform Generator app and select Icon to configure wireless waveform generator for QAM waveform generation. from the Waveform Type tab to generate a QAM waveform. Update the default waveform settings to specify a phase imbalance of 11.25 degrees (pi/16 radians) and an amplitude imbalance of 1.5 dB. Click Generate to generate the waveform.

Wireless Waveform Generator app display of 16QAM waveform with IQ imbalance.

Select the Filtering parameter and apply root raised cosine filtering. Click Generate again to generate a waveform using the current configuration. The plotted waveform changes to reflect the updated configuration.

Wireless Waveform Generator app display of 16QAM waveform with IQ imbalance and RRC filtering.

This example shows how you can generate 5G NR waveforms. For more information, see the 5G Waveform Generator (5G Toolbox) app reference page.

Open 5G Waveform Generator App

On the Apps tab of the MATLAB toolstrip, under Signal Processing and Communications, click the 5G Waveform Generator app icon. This app opens the Wireless Waveform Generator app configured for 5G waveform generation. This feature requires 5G Toolbox.

Generate 5G NR Waveform

This image shows the visualization results for 5G downlink waveform generation using default parameters.

5G Wireless Waveform Generator app default configuration.

This example shows how you can generate LTE waveforms. For more information, see the LTE Waveform Generator (LTE Toolbox) app reference page.

Open LTE Waveform Generator App

On the Apps tab of the MATLAB toolstrip, under Signal Processing and Communications, click the LTE Waveform Generator app icon. This app opens the Wireless Waveform Generator app configured for LTE waveform generation. This feature requires the LTE Toolbox.

Generate LTE Waveform

This image shows the visualization results for LTE downlink waveform generation using default parameters.

LTE Wireless Waveform Generator app default configuration.

This example shows how you can generate Bluetooth® waveforms. This app opens the Wireless Waveform Generator app configured for Bluetooth waveform generation. This feature requires the Bluetooth Toolbox.

On the Apps tab of the MATLAB toolstrip, under Signal Processing and Communications, click the Wireless Waveform Generator app icon. This app opens the Wireless Waveform Generator app. In the Waveform Type section, click Bluetooth Low Energy. Click Generate to generate the Bluetooth low energy (LE) waveform.

This image shows the visualization results for Bluetooth LE downlink waveform generation using default parameters.

Bluetooth LE Wireless Waveform Generator app default configuration.

This example shows how you can generate WLAN waveforms. For more information, see the WLAN Waveform Generator (WLAN Toolbox) app reference page.

Open WLAN Waveform Generator App

On the Apps tab of the MATLAB toolstrip, under Signal Processing and Communications, click the WLAN Waveform Generator app icon. This app opens the Wireless Waveform Generator app configured for WLAN waveform generation. This feature requires the WLAN Toolbox.

Generate WLAN Waveform

This image shows the visualization results for WLAN downlink waveform generation using default parameters.

WLAN Wireless Waveform Generator app default configuration.

This example shows how you can generate radar waveforms found in the Phased Array System Toolbox™. For descriptions of radar waveforms, see the Pulse Waveform Analyzer (Phased Array System Toolbox) app reference page.

To start, open the Wireless Waveform Generator app and select Icon to configure wireless waveform generator for Linear FM waveform generation. from the Waveform Type tab. Use the default waveform settings and click Generate to generate a single waveform.Wireless Waveform Generator app display of Linear FM waveform with default settings. The app shows one linear FM pulse and the spectrum of the pulse.

Next change the number of pulses in the waveform by setting the Number of pulses to 5 and then select Generate again. There are now five pulses displayed but the spectrum stays the nearly same. Wireless Waveform Generator app display of Linear FM waveform with default settings.

Open the Wireless Waveform Generator app and select Icon to configure wireless waveform generator for UWB waveform generation. from the Waveform Type tab to generate a UWB waveform. Use the default waveform settings. Click Generate to generate the waveform.

Wireless Waveform Generator app display of UWB waveform with default settings.

Select Icon to configure wireless waveform generator for UWB waveform generation. from the Waveform Type tab to generate an 802.15.4 OQPSK waveform, as used for ZigBee. Use the default waveform settings. Click Generate to generate the waveform.

Wireless Waveform Generator app display of 802.15.4 OQPSK waveform with default settings.

This example shows how to configure and use the block that is generated using the Export to Simulink capability that is available in the Wireless Waveform Generator app.

Introduction

The Wireless Waveform Generator app is an interactive tool for creating, impairing, visualizing, and exporting waveforms. You can export the waveform to your workspace or to a .mat or .bb file. You can also export the waveform generation parameters to a runnable MATLAB® script or a Simulink® block. You can use the exported Simulink block to reproduce your waveform in Simulink. This example shows how to use the Export to Simulink capability of the app and how to configure the exported block to generate waveforms in Simulink.

Although this example focuses on exporting an OFDM waveform, the same process applies for all of the supported waveform types.

Export Wireless Waveform Configuration to Simulink

Open the Wireless Waveform Generator app by clicking the app icon on the Apps tab, under Signal Processing and Communications. Alternatively, enter wirelessWaveformGenerator at the MATLAB command prompt.

In the Waveform Type section, select an OFDM waveform by clicking OFDM. In the left-most pane of the app, adjust any configuration parameters for the selected waveform. Then export the configuration by clicking Export in the app toolstrip and selecting Export to Simulink.

The Export to Simulink option creates a Simulink block, which outputs the selected waveform when you run the Simulink model. The block is exported to a new model if no open models exist.

modelName = 'WWGExport2SimulinkBlock';
open_system(modelName);

The Form output after final data value by block parameter specifies the output after all of the specified signal samples are generated. The value options for this parameter are Cyclic repetition and Setting to zero. The Cyclic repetition option repeats the signal from the beginning after it reaches the last sample in the signal. The Setting to zero option generates zero-valued outputs for the duration of the simulation after generating the last frame of the signal. The Waveform sample rate (Fs) and Waveform length block parameters are derived from the waveform configuration that is available in the Code tab of the Mask Editor dialog box. For further information about the block parameters, see Waveform From Wireless Waveform Generator App. This figure shows the parameters of the exported block.

close_system(modelName);

Connect a Spectrum Analyzer block to the exported block.

modelName = 'WWGExport2SimulinkModel';
open_system(modelName);

Simulate the model to visualize the waveform using the current configuration.

sim(modelName);

The Spectrum Analyzer block inherits the Waveform sample rate (Fs) parameter, which is 64 MHz.

close_system(modelName);

Modify Wireless Waveform Configuration

When you run the Simulink model, the exported block outputs the waveform generated in the Code tab of the Mask Editor dialog box for the block. The MATLAB code that initializes the waveform in this tab corresponds to the configuration that you selected in the Wireless Waveform Generator app before exporting the block. To modify the configuration of the waveform, choose one of these options:

  • Open the Wireless Waveform Generator app, select the configuration of your choice, and export a new block. This option provides interaction with an app interface instead of MATLAB code, parameter range validation during the parameterization process, and visualization of the waveform before running the Simulink model.

  • Update the configuration parameters that are available in the Code tab of the Mask Editor dialog box of the exported block. This option requires modifying the MATLAB code available in this tab so that the parameter range validation occurs only when you apply the changes. This option does not provide visualization of the waveform before running the Simulink model. Modifying the waveform parameters using this option is not recommended if you are not familiar with the MATLAB code that generates the selected waveform.

You can update the configuration in the Code tab of the Mask Editor. To open the Mask Editor, click the exported block and press Ctrl+M.

Use the MATLAB code that is available in the Code tab to update the parameters of your choice. For example, set the subcarrier spacing, scs, to 1,500,000 Hz.

Click OK to apply the changes and close the Mask Editor dialog box. Simulate the model to visualize the updated waveform.

modelName = 'WWGExport2SimulinkModelSCSModified';
sim(modelName);

The Spectrum Analyzer block now shows a sample rate of 96 MHz, which is 1.5 times the previous sample rate, as expected.

Share Wireless Waveform Configuration with Other Blocks in the Model

To access read-only block parameters and waveform configuration parameters, use the UserData common block property, which is a structure with these fields.

  • WaveformConfig: Waveform configuration

  • WaveformLength: Waveform length

  • Fs: Waveform sample rate

You can access the user data of the exported block by using the get_param function.

get_param([gcs '/OFDM Waveform Generator'],'UserData')
ans = 

  struct with fields:

    WaveformConfig: [1x1 comm.OFDMModulator]
    WaveformLength: 8000
                Fs: 96000000

Store the structure available in the user data in a base workspace variable by using the InitFcn in the callback. The InitFcn callback is executed during a model update and simulation. To use this callback, click the MODELING tab, then click the Model Settings dropdown, and click the Model Properties option. In the Callbacks pane, select the InitFcn callback. Assign the user data to a new base workspace variable (for example, cfg).

The parameters that are available in the user data of the exported block are updated every time you apply configuration changes in the Code tab.

To demodulate the OFDM waveform, add an OFDM Demodulator block to the model. Connect an AWGN Channel block between the OFDM Waveform Generator and OFDM Demodulator blocks to add white Gaussian noise to the input signal. Also add a Constellation Diagram block to plot the demodulated symbols.

modelName = 'WWGExport2SimulinkModelWithDemod';
open_system(modelName);

The parameters that are required to configure the OFDM Demodulator block must match the parameters that are used to configure the exported block, (otherwise, demodulation fails). To access the configuration parameters of the exported block, use the variable cfg. This figure shows the parameters of the OFDM Demodulator block.

Because the OFDM Demodulator block requires the entire OFDM waveform for demodulation, set the Samples per frame parameter in the exported block to cfg.WaveformLength. Simulate the model.

sim(modelName);

After demodulating the OFDM waveform by using the OFDM Demodulator block, the Constellation Diagram block displays the resulting QAM symbols.

Generate Multicarrier Waveforms

For multicarrier generation, the sampling rates for all of the waveforms must be the same. To shift the waveforms to a carrier offset and aggregate them, you can use the Multiband Combiner block.

modelName = 'WWGExport2SimulinkMulticarrier';
open_system(modelName);

To shift the waveforms in frequency, you might have to increase the sampling rates. The Multiband Combiner block provides the option to oversample the input waveforms before shifting and combining them. This figure shows the parameters of the Multiband Combiner block.

Simulate the model to visualize the waveforms that are centered at -80, 20, and 100 MHz.

sim(modelName);

This example shows how to use the NI™ USRP™ N310, USRP N320, USRP N321, and USRP X310 radio transmitters available in the Wireless Waveform Generator app to transmit an app-generated waveform over the air (requires Wireless Testbench™). These radio transmitters enable you to transmit up to 2 GB of contiguous data over the air at full radio device rate.

Introduction

The Wireless Waveform Generator app is an interactive tool for creating, impairing, visualizing, and transmitting waveforms. Using the USRP N310, USRP N320, USRP N321, and USRP X310 radio transmitters available in the app, you can transmit your generated waveform repeatedly over the air. You can also export the waveform generation and transmission parameters to a runnable MATLAB® script. This example shows how to configure these radio transmitters.

Although this example shows how to transmit an OFDM waveform, the same process applies for all waveform types that you can generate with the app.

Set Up for Radio Transmission

To use the radio transmitters in the app, you need to install the Wireless Testbench Support Package for NI USRP Radios add-on and set up your radio outside the app. For more information, see Connect and Set Up NI USRP Radios (Wireless Testbench).

Generate Waveform for Transmission

Open the Wireless Waveform Generator app by clicking the app icon on the Apps tab, under Signal Processing and Communications. Alternatively, enter wirelessWaveformGenerator at the MATLAB command prompt.

In the Waveform Type section, select an OFDM waveform by clicking OFDM. In the leftmost pane of the app, adjust any configuration parameters for the selected waveform. Then generate the configuration by clicking Generate in the app toolstrip.

Configure Radio Transmitter

Select the Transmitter tab from the app toolstrip. In the transmitter gallery, select the USRP N310, USRP N320, USRP N321, or USRP X310 radio transmitter.

In the leftmost pane of the app, select the name of a radio setup configuration that you saved using the Radio Setup wizard. For more information, see Connect and Set Up NI USRP Radios (Wireless Testbench).

Set the center frequency, gain, and antennas configuration parameters. The app automatically sets the waveform sample rate based on the waveform that you generated earlier. The radio transmitter uses onboard data buffering to ensure contiguous data transmission at up to the full hardware sample rate. If necessary, to achieve the specified sample rate, the radio uses a Farrow rate converter. Use this list as a reference when setting the sample rate:

  • USRP N310 — 120,945 Hz to 76.8 MHz, or one of: 122.88 MHz, 125 MHz, or 153.6 MHz

  • USRP N320 — 196,851 Hz to 125 MHz, or one of: 200 MHz, 245.76 MHz or 250 MHz

  • USRP N321 — 196,851 Hz to 125 MHz, or one of: 200 MHz, 245.76 MHz or 250 MHz

  • USRP X310 — 181,418 Hz to 100 MHz, or one of: 184.32 MHz or 200 MHz

Transmit Waveform

To transmit the waveform continuously, click Transmit. To end the continuous transmission, click Stop transmission. To export the waveform generation and transmission parameters to a runnable MATLAB script, click Export MATLAB script.

Version History

Introduced in R2018b