bleCSConfig
Description
The bleCSConfig
object parameterizes the bleCSWaveform
function to generate a Bluetooth® low energy (LE) channel sounding (CS) physical layer (PHY)
waveform.
Creation
Description
creates a
default Bluetooth LE CS PHY waveform configuration object,
cfgChannelSounding
= bleCSConfigcfgChannelSounding
.
sets properties of the Bluetooth LE
CS PHY waveform configuration object by using one or more optional name-value arguments.
For example, cfgChannelSounding
= bleCSConfig(Name=Value
)bleCSConfig(DeviceRole="Reflector")
sets the role of the
Bluetooth LE device to "Reflector"
.
Properties
DeviceRole
— Role of Bluetooth LE device
"Initiator"
(default) | "Reflector"
Role of the Bluetooth LE device, specified as "Initiator"
or
"Reflector"
.
Data Types: char
| string
StepMode
— Operating step mode for CS waveform generation
1
(default) | 0
| 2
| 3
Operating step mode for CS waveform generation, specified as one of these values.
Value of StepMode
| Description |
---|---|
0 | Measure frequency offset and timing synchronization between the Initiator and Reflector.
|
1 | Measure round-trip time (RTT) between the Initiator and Reflector. For information about how you can compute the distance between two Bluetooth LE devices using RTT, see the Estimate Distance Between Bluetooth LE Devices by Using Channel Sounding and Round-Trip Timing example.
|
2 | Measure phase rotations of the radio frequency (RF) signal between the Initiator and Reflector.
|
3 | Measure phase rotations of the RF signal and RTT between the Initiator and Reflector.
|
For more information about the step mode, see [2].
Data Types: double
SequenceLength
— Length of sequence in optional field
96
(default) | 32
| 64
| 128
Length of the sequence in the optional field, specified as 32
,
64
, 96
, or 128
. Units are in
bits.
This table shows how the value of this property depends on the value of the
SequenceType
property.
Value of SequenceType
| Value of SequenceLength
|
---|---|
"Sounding Sequence" |
|
"Random Sequence" |
|
Dependencies
To enable this property, set the StepMode
property to 1
or
3
.
Data Types: double
SequenceType
— Type of sequence in optional field
"Sounding Sequence"
(default) | "Random Sequence"
Type of sequence in the optional field, specified as one of these values.
Value of SequenceType
| Description |
---|---|
"Sounding Sequence" | Sequence of modulated bits alternating between 0 and 1 |
"Random Sequence" | Randomly generated bit sequence of 0 and 1 generated from the CS deterministic random bit generator (DRBG) function |
Dependencies
To enable this property, set the StepMode
property to 1
or
3
.
Data Types: char
| string
ToneDuration
— Duration of CS tone
40
(default) | 10
| 20
| 80
Duration of CS tone, specified as 10
, 20
,
40
, or 80. Units are in microseconds.
Dependencies
To enable this property, set the StepMode
property to 0
, 2
,
3
. If you specify the StepMode
property as
2
or 3
, the valid values of this property are
10
, 20
, or 40
. If you
specify the StepMode
property as 0
, the object
internally sets this property to 80
.
Data Types: double
Mode
— PHY transmission mode
"LE1M"
(default) | "LE2M"
PHY transmission mode, specified as "LE1M"
or
"LE2M"
.
Data Types: char
| string
SamplesPerSymbol
— Samples per symbol
8
(default) | integer greater than or equal to 2
Samples per symbol, specified as an integer greater than or equal to 2.
Data Types: double
Examples
Generate and Visualize Bluetooth LE Channel Sounding PHY Waveform
Generate and visualize a Bluetooth LE CS PHY waveform by using this CS procedure.
Using this example, you can:
Generate a CS PHY waveform at the Initiator.
Add propagation delay and additive white Gaussian noise (AWGN) to the generated CS PHY waveform.
Receive the noisy waveform at the Reflector, and generate a response waveform.
Add propagation delay and AWGN to the generated response waveform.
Receive the noisy response waveform at the Initiator.
Visualize the time-domain CS PHY waveforms at the Initiator and Reflector.
Configure CS PHY and Simulation Parameters
Specify the noise power spectral density (Eb/No), samples per symbol, and the speed of light.
EbNo = 30; % In dB sps = 8; lightSpeedConst = physconst("LightSpeed"); % In m/s
Specify the PHY transmission mode.
phyMode = "LE1M";
Specify the operating mode for CS PHY waveform generation.
stepMode = 0;
Specify the type of optional sequence in the CS SYNC packet format.
sequenceType = "Sounding Sequence";
Specify the optional sounding sequence length.
sequenceLength = 32; % In bits
Specify the duration of the CS tone.
toneDuration = 20; % In microseconds
Specify the distance between the Initiator and the Reflector devices.
distance = randi([2 80],1,1); % In meters
Compute the waveform propagation time between the Initiator and Reflector devices.
propagationTime = distance/lightSpeedConst; % In seconds
Calculate the sampling frequency (in Hz) of the generated waveform.
sampleRate = sps*1e6*(1 + 1*(phyMode=="LE2M")); % In Hz
Set the signal-to-noise ratio (SNR).
snr = EbNo - 10*log10(sps);
Create and configure a Bluetooth LE CS configuration object for the Initiator.
cfgObjectI = bleCSConfig(Mode=phyMode, ... SamplesPerSymbol=sps, ... DeviceRole="Initiator", ... SequenceLength=sequenceLength, ... SequenceType=sequenceType, ... StepMode=stepMode, ... ToneDuration=toneDuration);
Create and configure a Bluetooth LE CS configuration object for the Reflector.
cfgObjectR = bleCSConfig(Mode=phyMode, ... SamplesPerSymbol=sps, ... DeviceRole="Reflector", ... SequenceLength=sequenceLength, ... SequenceType=sequenceType, ... StepMode=stepMode, ... ToneDuration=toneDuration);
Create a variable fractional delay object by using the dsp.VariableFractionalDelay
(DSP System Toolbox) System object™.
timeDelay = dsp.VariableFractionalDelay;
Specify the number of samples to delay, based on the distance between the Initiator and Reflector devices.
samplesToDelay = propagationTime*sampleRate;
Set the configuration to display the time-domain CS PHY waveform.
timeDomainScope = timescope(SampleRate=sampleRate, ... ChannelNames={'Initiator','Reflector'}, ... LayoutDimensions=[2 1]); timeDomainScope.YLimits=[-1.25 1.25]; timeDomainScope.Title = "Initiator View"; timeDomainScope.ActiveDisplay = 2; timeDomainScope.YLimits=[-1.25 1.25]; timeDomainScope.Title = "Reflector View";
Set the configuration to display the frequency spectrum of the generated CS PHY waveform.
frequencyScope = spectrumAnalyzer(SampleRate=sampleRate);
Simulate and Visualize CS PHY Waveforms
Generate the Bluetooth LE CS PHY waveform at the Initiator.
waveformInitI = bleCSWaveform(cfgObjectI);
Compute the length of the generated Bluetooth LE CS waveform.
packetLength = length(waveformInitI)
packetLength = 352
Plot the Bluetooth LE CS waveform at the Initiator.
frequencyScope(waveformInitI) release(frequencyScope)
Add propagation delay to the generated waveform.
delayWaveformI = timeDelay([waveformInitI; zeros(ceil(samplesToDelay),1)],samplesToDelay);
Specify the time-domain waveform at the Initiator.
initiatorView = [waveformInitI; zeros(ceil(samplesToDelay),1)];
Add AWGN to the delayed waveform.
noisyWaveformI = awgn(delayWaveformI,snr,"measured");
Specify the time-domain waveform at the Reflector.
reflectorView = noisyWaveformI;
Display the time-domain view of the CS PHY waveform at the Initiator and the Reflector.
timeDomainScope(initiatorView,reflectorView) release(timeDomainScope)
The Reflector, upon receiving the CS waveform, completes the current task and then begins transmitting a response waveform (which might involve calculating processing delay).
Specify the idle wait time the Reflector must observe before initiating its response. Set the idle wait time of the Reflector by determining the number of frames it should wait.
idleFrames = randsrc(1,1,1:4);
Specify the number of idle samples of the Reflector in integer multiples of the received waveform.
idleSamples = idleFrames*packetLength;
Generate and plot the Bluetooth LE CS response waveform at the Reflector.
waveformInitR = bleCSWaveform(cfgObjectR); frequencyScope(waveformInitR) release(frequencyScope)
Specify the time-domain waveform at the Reflector.
reflectorView = [reflectorView; zeros(idleSamples,1); waveformInitR; zeros(ceil(samplesToDelay),1)];
Add propagation delay to the generated response waveform.
delayWaveformR = timeDelay([waveformInitR; zeros(ceil(samplesToDelay),1)],samplesToDelay);
Add AWGN to the delayed waveform.
noisyWaveformR = awgn(delayWaveformR,snr,"measured");
Specify the time-domain waveform at the Initiator.
initiatorView = [initiatorView; zeros(idleSamples,1); noisyWaveformR];
Display the time-domain view of the CS PHY waveform at the Initiator and the Reflector.
timeDomainScope(initiatorView,reflectorView) release(timeDomainScope)
Compute Length of Bluetooth LE CS PHY Waveform
Specify the operating step mode for CS waveform generation.
stepMode = 0;
Specify the duration of the CS tone.
toneDuration = 40; % In microseconds
Specify the sequence type and sequence length of the optional field.
sequenceType = "Random Sequence"; sequenceLength = 128; % In bits
Specify the samples per symbol and PHY transmission mode.
sps = 8;
phyMode = "LE1M";
Specify the role of the Bluetooth LE device as "Reflector"
or "Initiator"
.
deviceRole = "Reflector";
Calculate the length of the Bluetooth LE CS PHY waveform from the specified configuration.
multiFactor = 1 + 1*(phyMode=="LE2M"); lengthPreamble = 8*multiFactor; lengthAccessAddress = 32; lengthTrailer = 4; lengthGaurdDuration = 10*multiFactor; lengthTone = toneDuration*2*multiFactor; % One duration each for CS tone and extension slot switch stepMode case 0 lengthOfWaveform = sps*(lengthPreamble + lengthAccessAddress + lengthTrailer) + sps*(lengthGaurdDuration + 80)*(deviceRole=="Reflector"); case 1 lengthOfWaveform = sps*(lengthPreamble + lengthAccessAddress + lengthTrailer + sequenceLength*multiFactor); case 2 lengthOfWaveform = sps*lengthTone; case 3 lengthOfWaveform = sps*(lengthPreamble + lengthAccessAddress + lengthTrailer + sequenceLength*multiFactor + lengthGaurdDuration + lengthTone); end
Create and configure a Bluetooth LE CS configuration object for the Reflector.
cfgChannelSounding = bleCSConfig(DeviceRole=deviceRole, ... Mode=phyMode, ... SamplesPerSymbol=sps, ... SequenceLength=sequenceLength, ... SequenceType=sequenceType, ... StepMode=stepMode, ... ToneDuration=toneDuration);
Generate the Bluetooth LE CS PHY waveform at the Reflector.
csPHYWaveform = bleCSWaveform(cfgChannelSounding);
Display the size and length of the generated waveform and note that both values are same.
numel(csPHYWaveform)
ans = 1072
lengthOfWaveform
lengthOfWaveform = 1072
References
[1] Bluetooth Technology Website. “Bluetooth Technology Website | The Official Website of Bluetooth Technology.” Accessed June 29, 2024. https://www.bluetooth.com/.
[2] Bluetooth Core Specifications Working Group. "Bluetooth Core Specification" v6.0. https://www.bluetooth.com/specifications/specs/core-specification-6-0/.
Version History
Introduced in R2024b
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 (한국어)