%% Generate Bluetooth BR/EDR Waveform for Single Enhanced Data Rate Packet
% Create a Bluetooth BR/EDR waveform configuration object.

cfg = bluetoothWaveformConfig;

% To generate enhanced data rate packet 2-EV3, specify the packet type as EV3 and the transmission mode as EDRM2.

cfg.PacketType = 'EV3';
cfg.Mode = 'EDR2M';

% Create a random input bit vector to generate the payload for a single packet.

numBits = getPayloadLength(cfg)*8; % Byte to bit conversion
dataBits = randi([0 1],numBits,1);

% Generate the Bluetooth BR/EDR waveform.

txWaveform = bluetoothWaveformGenerator(dataBits,cfg);

% Copyright 2019 The MathWorks, Inc.