www.gusucode.com > wlan 源码程序 matlab案例代码 > wlan/WaveformGeneratorConfigurationObjectCreationExample.m

    %% Waveform Generator Parameterization
% Waveform generation using the waveform generator configuration object as
% shown in Method 1 is not recommended. Instead, use |Name,Value| pairs
% when creating the waveform as shown in Method 2.

%% Create VHT Format Configuration Object
% Create a format configuration object for an 802.11ac VHT transmission.
% Specify generation of a waveform with 10 packets and a 20 microsecond
% idle period between packets. Use a random scrambler initial value for
% each packet.

cfgVHT = wlanVHTConfig;
numPackets = 10;
idleTime = 20e-6;
scramblerInit = randi([1 127],numPackets, 1);

%% Method 1: (Not Recommended) Use wlanGeneratorConfig object in wlanWaveformGenerator
cfgWaveGen = wlanGeneratorConfig('NumPackets',numPackets,...
    'IdleTime',idleTime,'ScramblerInitialization', scramblerInit);
txWaveform1 = wlanWaveformGenerator([1;0;0;1],cfgVHT,cfgWaveGen);
%%
% To supress the warning associated with use of |wlanGeneratorConfig|,
% execute |"warning('off','wlan:wlanGeneratorConfig:Deprecation');"| in
% your MATLAB(R) command window prior to the running code.
%% Method 2: Use Name-Value pair syntax in wlanWaveformGenerator
txWaveform2 = wlanWaveformGenerator([1;0;0;1],cfgVHT,'NumPackets',...
    numPackets,'IdleTime',idleTime,'ScramblerInitialization',scramblerInit);