%% Generate BLE Waveform With Constant Tone Extension For Connection-Oriented Scenario
% Specify a connection data channel protocol data unit (PDU) for angle of departure (AoD) constant tone extension (CTE).

pduHex = '1B820127'; % Valid PDU in hexadecimal
pdu = de2bi(hex2dec(pduHex), 32)';

% Generate and append cyclic redundancy check (CRC) to the PDU.

crcGen = comm.CRCGenerator('z^24+z^10+z^9+z^6+z^4+z^3+z+1',...
    'InitialConditions',de2bi(hex2dec('555551'),'left-msb',24),...
    'DirectMethod',true);
pduCRC = crcGen(pdu);

% Generate the BLE waveform using specified name-value pair arguments.

waveform = bleWaveformGenerator(pduCRC,'ChannelIndex',36,...
    'DFPacketType','ConnectionCTE')

% Copyright 2020 The MathWorks, Inc.