Main Content

Create and Visualize Bluetooth LE Broadcast Audio Residential Scenario

This example shows you how to visualize a Bluetooth® low energy (LE) isochronous broadcast audio network in a residential scenario by using Bluetooth Toolbox and Communications Toolbox™ Wireless Network Simulation Library.

Using this example, you can:

  1. Create and configure a Bluetooth LE broadcast audio residential scenario consisting of an isochronous broadcaster, synchronized receivers, and a WLAN node.

  2. Create and configure the WLAN node without modeling the physical layer (PHY) and MAC behavior of the WLAN node.

  3. Create the building triangulation from the scenario.

  4. Visualize the 3-D residential scenario of the Bluetooth LE broadcast audio network.

Check if the Communications Toolbox™ Wireless Network Simulation Library support package is installed. If the support package is not installed, MATLAB® returns an error with a link to download and install the support package.

wirelessnetworkSupportPackageCheck;

Specify the size and layout of the residential building by using the BuildingLayout and RoomSize parameters. The BuildingLayout parameter specifies the number of rooms along the length, width, and height of the building. The RoomSize parameter specifies the size of each room in meters.

scenario = struct;
scenario.BuildingLayout = [3 3 2];
scenario.RoomSize = [10 8 6];        % In meters

Create a Bluetooth LE node, specifying the role as isochronous-broadcaster. Specify the position of the broadcaster.

broadcasterNode = bluetoothLENode("isochronous-broadcaster");
broadcasterNode.Position = [2 2 3];                           % x-, y-, and z-coordinates, in meters

Specify the number of receivers and their respective positions.

numReceivers = 6;
receiverPositions = [7 6 9; ...
    6 4 4; ...
    25 18 6; ...
    18 12 10; ...
    5 20 6; ...
    12 15 3];                         % x-, y-, and z-coordinates, in meters

Create Bluetooth LE nodes with the role set as synchronized-receiver. Assign the receiver positions to the nodes.

receiverNodes = cell(1,numReceivers);
for rxIdx = 1:numReceivers
    rxNode = bluetoothLENode("synchronized-receiver");
    rxNode.Name = ['Receiver ' num2str(rxIdx)];
    rxNode.Position = receiverPositions(rxIdx,:);
    receiverNodes{rxIdx} = rxNode;
end

Create a WLAN node by using the helperInterferingWLANNode helper object. Specify the position of the WLAN node. This WLAN node does not model the PHY and MAC behavior of WLAN.

wlanNode = helperInterferingWLANNode;
wlanNode.Name = "WLAN node";
wlanNode.Position = [11 15 4];         % x-, y- and z- coordinates in meters

Create the building triangulation from the scenario parameters by using the hTGaxResidentialTriangulation helper function.

buildingTriangulation = hTGaxResidentialTriangulation(scenario);

Visualize the residential scenario in 3-D by using the helperVisualizeResidentialScenario helper function.

helperVisualizeResidentialScenario(buildingTriangulation,{broadcasterNode;receiverNodes;wlanNode},...
    ["Bluetooth LE Broadcaster","Bluetooth LE Receiver","Interfering WLAN node"],...
    "LE Broadcast Audio Network in Residential scenario");

Figure contains an axes object. The axes object with title LE Broadcast Audio Network in Residential scenario, xlabel x (meters), ylabel y (meters) contains 5 objects of type patch, line, scatter. These objects represent Bluetooth LE Broadcaster, Bluetooth LE Receiver, Interfering WLAN node.

Copyright 2021-2022 The MathWorks, Inc.s

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/.

See Also

Objects

Related Topics