Main Content


Waveform generator for Bluetooth BR/EDR PHY

Download Required: To use bluetoothWaveformGenerator, first download Communications Toolbox™ Library for the Bluetooth® Protocol. For more information, see Get and Manage Add-Ons. Alternatively, see Communications Toolbox Library for the Bluetooth Protocol File Exchange.



waveform = bluetoothWaveformGenerator(data,cfgFormat) generates waveform, a multipacket time-domain Bluetooth BR/EDR waveform, for input information bits data and a given format configuration cfgFormat.


collapse all

Specify the number of HV1 packets.

numPackets = 10;

Create a Bluetooth BR/EDR waveform configuration object. Specify the packet type as HV1.

cfg = bluetoothWaveformConfig;
cfg.PacketType = 'HV1';

Create a random input bit vector containing concatenated payloads.

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

Set the symbol rate.

symbolRate = 1e6; % In MHz

Generate the Bluetooth waveform.

waveform = bluetoothWaveformGenerator(dataBits,cfg);

Create a dsp.SpectrumAnalyzer System object to display the frequency spectrum of the generated Bluetooth BR/EDR waveform. Set the sample rate of the frequency spectrum.

scope = dsp.SpectrumAnalyzer;
scope.SampleRate = cfg.SamplesPerSymbol*symbolRate;

Plot the Bluetooth BR/EDR waveform.


Figure Spectrum Analyzer contains an axes object and other objects of type uiflowcontainer, uimenu, uitoolbar. The axes object contains an object of type line. This object represents Channel 1.

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

Input Arguments

collapse all

Input information bits, specified as a binary-valued column vector with data type double. This value represents multiple concatenated payloads. The length of data must be an exact multiple of the payload length derived from the getPayloadLength object function for the bluetoothWaveformConfig object.

Data Types: double

Format configuration object, specified as a bluetoothWaveformConfig object. The function uses this value to set its configuration parameters.

Output Arguments

collapse all

Generated time-domain Bluetooth BR/EDR waveform, returned as a complex-valued column vector containing the generated Bluetooth BR/EDR waveform. The function appends this value with zero samples to accommodate a packet-specific slot duration.

Data Types: double


[1] Bluetooth Technology Website. “Bluetooth Technology Website | The Official Website of Bluetooth Technology.” Accessed November 22, 2019.

[2] Bluetooth Special Interest Group (SIG). "Bluetooth Core Specification." Version 5.1.

Extended Capabilities

Introduced in R2020a