bluetoothPhyConfig
Description
The bluetoothPhyConfig
object sets properties to configure the
Bluetooth® physical layer (PHY).
Creation
Description
creates a
default Bluetooth PHY configuration object, cfgPHY
= bluetoothPhyConfigcfg
.
sets properties by
using one or more name-value pairs. Enclose each property name in quotes. For example,
cfgPHY
= bluetoothPhyConfig(Name,Value
)('Mode','EDR3M')
sets the PHY transmission mode to 3 Mbps.
Properties
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].
Mode
— PHY transmission mode
'BR'
(default) | 'EDR2M'
| 'EDR3M'
PHY transmission mode, specified as 'BR'
,
'EDR2M'
, or 'EDR3M'
. This value indicates the
type of Bluetooth BR/EDR waveform.
Data Types: char
| string
DeviceAddress
— Bluetooth BR/EDR device address
'0123456789AB'
(default) | 12-element character vector | string scalar denoting 6-octet hexadecimal value
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
ModulationIndex
— Modulation Index
0.32
(default) | scalar in the range [0.28, 0.35]
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
SamplesPerSymbol
— Samples per symbol
8 (default) | positive integer
Samples per symbol, specified as a positive integer. The object uses this value for GFSK modulation and demodulation.
Data Types: double
WhitenStatus
— Data whiten status
'On'
(default) | 'Off'
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
WhitenInitialization
— Whiten initialization
[1; 1; 1; 1; 1; 1; 1]
(default) | 7-bit binary column vector
Whiten initialization, specified as a 7-bit binary column vector.
Dependencies
To enable this property, set the
WhitenStatus property to
'On'
.
Data Types: double
HasExtendedSCO
— Flag to indicate presence of eSCO link
0
or false
(default) | 1
or true
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
ExtendedSCOPayloadLength
— Payload length of eSCO packet
18
(default) | integer in range [1, X]
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
IsIDPacket
— Flag to indicate reception of ID packet
0
or false
(default) | 1
or true
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
Create Bluetooth BR/EDR PHY Configuration Objects
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
Generate and Decode Bluetooth BR/EDR PHY Waveform with eSCO Packets
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
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Usage notes and limitations:
Properties must be specified as coder.Constant()
.
Version History
Introduced in R2020aR2023a: Includes support for configuring payload length of eSCO packets
The bluetoothPhyConfig object now supports configuring the payload length of eSCO logical
transport packets through the new, HasExtendedSCO
and ExtendedSCOPayloadLength
properties. You can also detect the
presence of the ID packet at the receiver by configuring the new IsIDPacket
property.
See Also
Functions
Objects
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)