Main Content

bluetoothIdealReceiver

Decode Bluetooth BR/EDR PHY waveform

Since R2020a

    Description

    [bits,decodedInfo] = bluetoothIdealReceiver(waveform,rxConfig) demodulates and decodes a synchronized time-domain Bluetooth® basic rate/enhanced data rate (BR/EDR) physical layer (PHY) waveform, waveform, generated by the bluetoothWaveformGenerator function for a given 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 BR/EDR packet.

    example

    Examples

    collapse all

    Demodulate and decode time-domain Bluetooth BR/EDR waveform by using the bluetoothPhyConfig object or bluetoothWaveformConfig object to extract the PHY information.

    Use the bluetoothPhyConfig object to get PHY information

    Create a default Bluetooth BR/EDR waveform configuration object.

    txconfig = bluetoothWaveformConfig;

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

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

    Create a default configuration object for the Bluetooth BR/EDR PHY with default settings. This object sends the PHY information to the Bluetooth 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 default Bluetooth BR/EDR waveform configuration object. 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 by using the payload.

    waveform = bluetoothWaveformGenerator(dataBits,cfg);

    Get the 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 BR/EDR waveform, specified as a complex-valued column vector.

    Data Types: double | single
    Complex Number Support: Yes

    PHY configuration object, specified as a bluetoothPhyConfig object.

    Output Arguments

    collapse all

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

    Data Types: double | int8

    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

    If the function does not detect any of the Bluetooth BR/EDR packets, this field returns an empty character vector.

    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 Peripheral for a Bluetooth BR/EDR packet in a Central-to-Peripheral 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 (true) or 0 (false). The validity is based on the Bluetooth BR/EDR packet header error check (HEC) and cyclic redundancy check (CRC). The value of this output is 1 or true only when HEC and CRC are enabled.

    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 PacketType field value of the decodedInfo 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, 2021. https://www.bluetooth.com/.

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

    Extended Capabilities

    Version History

    Introduced in R2020a

    expand all