%% Generate Oversampled WUR Waveform
% Create a WUR configuration object, specifying four 20 MHz subchannels.

numSubchannels = 4;
cfgWUR = wlanWURConfig(numSubchannels);

% Configure each 20 MHz subchannel.

psduLength = [4 8 12 16];
dataRate = {'LDR','HDR','LDR','HDR'};
design = {'Example1','Example2','Example1','Example1'};
cfgSubchannel = cell(1,numSubchannels);
psdu = cell(1,cfgWUR.NumUsers);
for i = 1:cfgWUR.NumUsers
    cfgSubchannel{i} = wlanWURSubchannel(PSDULength=psduLength(i), ...
        DataRate=dataRate{i},SymbolDesign=design{i});
    psdu{i} = randi([0 1],8*psduLength(i),1,'int8');
end
cfgWUR.Subchannel = cfgSubchannel;

% Specify an oversampling factor of two, and then generate the waveform.

osf = 2;
waveform = wlanWaveformGenerator(psdu,cfgWUR,NumPackets=4, ...
    IdleTime=1e-5,OversamplingFactor=osf);

% Copyright 2020 The MathWorks, Inc.