main content

create, impair, visualize, and export modulated waveforms -凯发k8网页登录

create, impair, visualize, and export modulated waveforms

since r2018b

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 toolbox) app reference page.

  • generate wlan (802.11™) modulated waveforms. this feature requires the wlan toolbox. for more information, see the (wlan toolbox) app reference page.

  • generate bluetooth le modulated waveforms. this feature requires the bluetooth toolbox. for more information, see the (bluetooth toolbox) app reference page.

  • generate radar waveforms. this feature requires phased array system toolbox.

  • generate zigbee® and uwb (ieee® 802.15.4z) modulated waveforms. this feature requires the 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 .

  • 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.

    • to transmit a waveform by using an sdr, connect one of the supported sdrs (adalm-pluto, usrp™, usrp embedded series, and xilinx® zynq-based radios) to your computer and have the associated add-on installed. for more information, see .

    • to transmit a waveform by using a lab test instrument, the connected lab test instrument must:

      • support the tcp/ip interface

      • use one of these drivers — agrfsiggen, rsrfsiggen, agrfsiggen_scpi, or rsrfsiggen_scpi

      • be supported by the (instrument control toolbox) function

      for more information, see (instrument control toolbox). this feature requires instrument control toolbox.

    • to transmit your waveforms over the air at full radio device rates, use the wireless testbench™ software and connect a supported radio to your computer. for a list of radios that support full device rates, see supported radio devices (wireless testbench). this feature requires wireless testbench. for an example, see transmit app-generated wireless waveform using radio transmitters.

for more information, see create waveforms using wireless waveform generator app.

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

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 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 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 (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 . 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);

use the ni™ usrp™ n310, usrp n320, usrp n321, usrp x310, and usrp x410 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 a radio transmitter 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. configure these radio transmitters 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 must install the wireless testbench support package for ni usrp radios add-on, and set up your radio outside the app. for more information, see (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 waveform pane of the app, specify the parameters of ofdm waveform configuration, qam waveform configuration, and filtering configuration 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 a radio transmitter.

in the waveform pane of the app, select the name of a radio setup configuration that you saved using the radio setup wizard. for more information, see (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

  • usrp x410: 241,890 hz to 125 mhz, or one of: 245.76 mhz or 250 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.

limitations

    • in matlab online™, the wireless waveform generator app does not support these features:

      • signal transmission with sdr devices or test instruments

      • zigbee (ieee 802.15.4 — oqpsk) waveform generation

      • uwb (ieee 802.15.4z) waveform generation

version history

introduced in r2018b

see also

apps

functions

  • (instrument control toolbox)

blocks

网站地图