Main Content

bluetoothPhyConfig

Bluetooth BR/EDR PHY configuration parameters

Since R2020a

    Description

    The bluetoothPhyConfig object sets properties to configure the Bluetooth® physical layer (PHY).

    Creation

    Description

    example

    cfgPHY = bluetoothPhyConfig creates a default Bluetooth PHY configuration object, cfg.

    example

    cfgPHY = bluetoothPhyConfig(Name,Value) sets properties by using one or more name-value pairs. Enclose each property name in quotes. For example, ('Mode','EDR3M') sets the PHY transmission mode to 3 Mbps.

    Properties

    expand all

    Note

    For more information about Bluetooth BR/EDR waveform generator properties and their respective values, see Volume 2, Part B, Sections 6 and 7 of the Bluetooth Core Specification [2].

    PHY transmission mode, specified as 'BR', 'EDR2M', or 'EDR3M'. This value indicates the type of Bluetooth BR/EDR waveform.

    Data Types: char | string

    Bluetooth BR/EDR device address, specified as a 12-element character vector or a string scalar denoting a 6-octet hexadecimal value.

    Data Types: char | string

    Modulation index, specified as a scalar in the range [0.28, 0.35]. This property is the modulation index that the object uses when performing Gaussian frequency shift keying (GFSK) modulation or demodulation.

    Data Types: double

    Samples per symbol, specified as a positive integer. The object uses this value for GFSK modulation and demodulation.

    Data Types: double

    Data whiten status, specified as 'On' or 'Off'. To perform whitening on header and payload bits, set this value to 'On'.

    Data Types: char | string

    Whiten initialization, specified as a 7-bit binary column vector.

    Dependencies

    To enable this property, set the WhitenStatus property to 'On'.

    Data Types: double

    Flag to indicate the presence of an extended synchronous connection-oriented (eSCO) link, specified as a logical 0 (false) or 1 (true). A value of 1 or true indicates that the eSCO link is present.

    Data Types: logical

    Payload length of the eSCO packet, specified as an integer in the range [1, X], where X depends on the type of the specified eSCO packet. For more information about eSCO packets and the supported payload lengths, see Packet Types. To specify the eSCO packet type, configure the PacketType property of the bluetoothWaveformConfig object. Specify the number of bytes to be processed in an eSCO packet by configuring this property.

    Dependencies

    To enable this property, set the HasExtendedSCO property to 1 or true.

    Data Types: double

    Flag to indicate the reception of the ID packet, specified as a logical 0 (false) or 1 (true). A value of 1 or true indicates that the ID packet is received.

    Data Types: logical

    Examples

    collapse all

    Create two unique Bluetooth BR/EDR PHY configuration objects: one for synchronous connection oriented (SCO) logical transport and the other for connectionless peripheral broadcast (CPB) logical transport.

    Create a default Bluetooth BR/EDR PHY configuration object for an SCO logical transport.

    cfgPHY = bluetoothPhyConfig
    cfgPHY = 
      bluetoothPhyConfig with properties:
    
                        Mode: 'BR'
               DeviceAddress: '0123456789AB'
             ModulationIndex: 0.3200
            SamplesPerSymbol: 8
                WhitenStatus: 'On'
        WhitenInitialization: [7x1 double]
              HasExtendedSCO: 0
                  IsIDPacket: 0
    
    

    Create another Bluetooth BR/EDR PHY configuration object for a CSB logical transport by disabling the whiten status.

    cfgPHY = bluetoothPhyConfig('WhitenStatus','Off')
    cfgPHY = 
      bluetoothPhyConfig with properties:
    
                    Mode: 'BR'
           DeviceAddress: '0123456789AB'
         ModulationIndex: 0.3200
        SamplesPerSymbol: 8
            WhitenStatus: 'Off'
          HasExtendedSCO: 0
              IsIDPacket: 0
    
    

    Create a Bluetooth BR/EDR waveform configuration object, specifying the packet type as 'EV5'. The 'EV5' packet supports eSCO logical transport. For more information about Bluetooth BR/EDR packets and the corresponding payload lengths supported on the eSCO logical transport, see Bluetooth BR/EDR Packet Structure.

    cfgWaveform = bluetoothWaveformConfig('PacketType','EV5')
    cfgWaveform = 
      bluetoothWaveformConfig with properties:
    
                           Mode: 'BR'
                     PacketType: 'EV5'
                  PayloadLength: 18
                  DeviceAddress: '0123456789AB'
        LogicalTransportAddress: [3x1 double]
              HeaderControlBits: [3x1 double]
                ModulationIndex: 0.3200
               SamplesPerSymbol: 8
                   WhitenStatus: 'On'
           WhitenInitialization: [7x1 double]
    
    

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

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

    Create a Bluetooth BR/EDR PHY configuration object, specifying the presence of eSCO link and the ID packet. This object sends the PHY information to the Bluetooth ideal receiver.

    cfgPHY = bluetoothPhyConfig('HasExtendedSCO',1,'IsIDPacket',1)
    cfgPHY = 
      bluetoothPhyConfig with properties:
    
                            Mode: 'BR'
                   DeviceAddress: '0123456789AB'
                 ModulationIndex: 0.3200
                SamplesPerSymbol: 8
                    WhitenStatus: 'On'
            WhitenInitialization: [7x1 double]
        ExtendedSCOPayloadLength: 18
    
    

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

    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