bluetoothIdealReceiver
Syntax
Description
[
demodulates and decodes a synchronized time-domain Bluetooth® basic rate/enhanced data rate (BR/EDR) waveform,
bits
,decodedInfo
] = bluetoothIdealReceiver(waveform
,rxConfig
)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
.
[___,
returns a flag, pktValidStatus
,decodedCRC
] = bluetoothIdealReceiver(___)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.
Examples
Demodulate and Decode Time-Domain Bluetooth BR/EDR Waveform
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
waveform
— Synchronized time-domain Bluetooth BR/EDR waveform
complex-valued column vector
Synchronized time-domain Bluetooth BR/EDR waveform, specified as a complex-valued column vector.
Data Types: double
Complex Number Support: Yes
rxConfig
— System configuration object
bluetoothPHYConfig
object
System configuration object, specified as a bluetoothPhyConfig
object.
Output Arguments
bits
— Decoded payload bits
binary-valued column vector
Decoded payload bits, returned as a binary-valued column vector.
Data Types: double
decodedInfo
— Decoded information
structure
Decoded information, returned as a structure containing these fields:
Field | Value | Description |
---|---|---|
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
| Decoded lower address part (LAP) of the Bluetooth device address |
PayloadLength | Scalar of type | Number of payload bytes in the received Bluetooth BR/EDR packet |
LogicalTransportAddress | 3-bit vector of type | Active destination Peripheral for a Bluetooth BR/EDR packet in a Central-to-Peripheral transmission slot |
HeaderControlBits | 3-bit vector of type | 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
| Logical link identifier. This field is applicable only if the value
of |
FlowIndicator | Scalar of type | 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
pktValidStatus
— Flag indicating validity of received Bluetooth BR/EDR packet
1
or true
| 0
or false
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
decodedCRC
— Decoded CRC
16-bit binary-valued column vector
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
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 R2020a
See Also
Functions
Objects
Abrir ejemplo
Tiene una versión modificada de este ejemplo. ¿Desea abrir este ejemplo con sus modificaciones?
Comando de MATLAB
Ha hecho clic en un enlace que corresponde a este comando de MATLAB:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de MATLAB.
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)