bluetoothIdealReceiver

Ideal receiver for Bluetooth BR/EDR PHY waveform

Download Required: To use bluetoothIdealReceiver, 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.

Description

example

[bits,decodedInfo] = bluetoothIdealReceiver(waveform,rxConfig) demodulates and decodes a synchronized time-domain Bluetooth waveform, waveform, generated by the bluetoothWaveformGenerator function for a given system configuration object, rxConfig. The function returns the decoded payload bits, bits, and decoded information, decodedInfo.

example

[___,pktValidStatus,decodedCRC] = bluetoothIdealReceiver(___) returns a flag, pktValidStatus, to indicate the validity of the received Bluetooth BR/EDR packet. The function also returns the decoded cyclic redundancy check (CRC), decodedCRC, of the received Bluetooth packet.

Examples

collapse all

Demodulate and decode time-domain Bluetooth BR/EDR waveform using two different ways to get physical layer (PHY) information. The bluetoothIdealReceiver function uses bluetoothPhyConfig object or bluetoothWaveformConfig object to extract PHY information and decode the Bluetooth BR/EDR waveform.

Use the bluetoothPhyConfig object to get PHY information

Create a Bluetooth BR/EDR waveform configuration object with default settings.

txconfig = bluetoothWaveformConfig;

Create a random input bit vector to generate the payload. Generate the time-domain Bluetooth BR/EDR waveform using the payload.

dataBits = randi([0 1],getPayloadLength(txconfig)*8,1);
waveform = bluetoothWaveformGenerator(dataBits,txconfig);

Create a configuration object for Bluetooth BR/EDR PHY with default settings. This object sends the PHY information to the ideal receiver.

rxConfig = bluetoothPhyConfig;

Demodulate and decode the Bluetooth BR/EDR waveform. The generated output displays the decoded bits and a structure containing the decoded information.

[bits,decodedInfo] = bluetoothIdealReceiver(waveform,rxConfig)
bits = 144×1

     1
     1
     0
     1
     1
     0
     0
     1
     1
     1
      ⋮

decodedInfo = struct with fields:
                        LAP: [24x1 double]
                 PacketType: 'FHS'
    LogicalTransportAddress: [3x1 double]
          HeaderControlBits: [3x1 double]
              PayloadLength: 18
                       LLID: [2x1 double]
              FlowIndicator: 0

Use the bluetoothWaveformConfig object to get PHY information

Create a Bluetooth BR/EDR waveform configuration object with default settings. Set the packet type to 'DM1'and payload length to 10.

cfg = bluetoothWaveformConfig;
cfg.PacketType = 'DM1';
cfg.PayloadLength = 10;

Create a random input bit vector to generate the payload.

numBits = getPayloadLength(cfg)*8;
dataBits = randi([0 1],numBits,1);

Generate the time-domain Bluetooth BR/EDR waveform using the payload.

waveform = bluetoothWaveformGenerator(dataBits,cfg);

Get PHY information from the bluetoothWaveformConfig object function, getPhyConfigProperties.

rxConfig = getPhyConfigProperties(cfg);

Demodulate and decode the Bluetooth BR/EDR waveform. The generated output displays the decoded bits, a structure containing the decoded information, the packet status, and the decoded CRC.

[bits,decodedInfo,pktStatus,crc] = bluetoothIdealReceiver(waveform,rxConfig)
bits = 80×1

     0
     0
     0
     0
     0
     0
     0
     0
     1
     1
      ⋮

decodedInfo = struct with fields:
                        LAP: [24x1 double]
                 PacketType: 'DM1'
    LogicalTransportAddress: [3x1 double]
          HeaderControlBits: [3x1 double]
              PayloadLength: 10
                       LLID: [2x1 double]
              FlowIndicator: 1

pktStatus = logical
   1

crc = 16×1

     1
     1
     1
     1
     1
     1
     0
     0
     0
     0
      ⋮

Input Arguments

collapse all

Synchronized time-domain Bluetooth waveform, specified as a complex-valued column vector.

Data Types: double
Complex Number Support: Yes

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

Output Arguments

collapse all

Decoded payload bits, returned as a binary-valued column vector.

Data Types: double

Decoded information, returned as a structure containing these fields:

FieldValueDescription
PacketType'ID', 'NULL', 'POLL', 'FHS', 'HV1', 'HV2', 'HV3', 'DV', 'EV3', 'EV4', 'EV5', 'AUX1', 'DM3', 'DM1', 'DH1', 'DM5', 'DH3', 'DH5', '2-DH1', '2-DH3', '2-DH5', '2-DH1', '2-DH3', '2-DH5', '2-EV3', '2-EV5', '3-EV3', or '3-EV5'

Type of received Bluetooth BR/EDR packet

LAP

24-bit column vector of type double.

Decoded lower address part (LAP) of the Bluetooth device address

PayloadLength

Scalar of type double

Number of payload bytes in the received Bluetooth BR/EDR packet

LogicalTransportAddress

3-bit vector of type double

Active destination slave for a Bluetooth BR/EDR packet in a master-to-slave transmission slot

HeaderControlBits

3-bit vector of type double

Link control information containing flow control information (FLOW), acknowledgement for successfully receiving a Bluetooth BR/EDR packet payload (ARQN), and sequencing scheme for received packets (SEQN) bits

LLID

2-bit binary vector of type double

Logical link identifier. This field is applicable only if the value of PacketType field is one of these: 'DM1', 'DH1', 'DM3', 'DH3', 'DM5', 'DH5', 'AUX1', 'DV', '2-DH1', '2-DH3', '2-DH5', '3-DH1', '3-DH3', or '3-DH5'.

FlowIndicator

Scalar of type double

Control data flow indicator over logical channels. This field is applicable only if the value of PacketType field is one of these: 'DM1', 'DH1', 'DM3', 'DH3', 'DM5', 'DH5', 'AUX1', 'DV', '2-DH1', '2-DH3', '2-DH5', '3-DH1', '3-DH3', or '3-DH5'

Data Types: struct

Flag indicating validity of received Bluetooth BR/EDR packet, returned as 1 or 0 of data type logical. Validity is based on the Bluetooth BR/EDR packet header error check (HEC) and cyclic redundancy check (CRC). The value of this argument is true only when both, HEC and CRC are true.

Dependencies

To enable this output argument, set the PacketType field value of the decodedInfo output argument to any one of these: 'NULL', 'POLL', 'FHS', 'HV1', 'HV2', 'HV3', 'DV', 'EV3', 'EV4', 'EV5', 'AUX1', 'DM3', 'DM1', 'DH1', 'DM5', 'DH3', 'DH5', '2-DH1', '2-DH3', '2-DH5', '2-DH1', '2-DH3', '2-DH5', '2-EV3', '2-EV5', '3-EV3', or '3-EV5'.

Data Types: logical

Decoded CRC, specified as the CRC of the received Bluetooth BR/EDR packet.

Dependencies

To enable this output argument, set the packet type field value of the decoded information output argument to any one of these: 'FHS', 'DV', 'EV3', 'EV4', 'EV5', 'DM3', 'DM1', 'DH1', 'DM5', 'DH3', 'DH5', '2-DH1', '2-DH3', '2-DH5', '2-DH1', '2-DH3', '2-DH5', '2-EV3', '2-EV5', '3-EV3', or '3-EV5'.

Data Types: double

References

[1] Bluetooth Technology Website. “Bluetooth Technology Website | The Official Website of Bluetooth Technology.” Accessed November 22, 2019. https://www.bluetooth.com/.

[2] Bluetooth Special Interest Group (SIG). "Bluetooth Core Specification." Version 5.1. https://www.bluetooth.com/.

Extended Capabilities

Introduced in R2020a