Main Content

bluetoothRange

Estimate range between two Bluetooth BR/EDR or LE devices

Since R2022a

    Description

    [range,pathloss,rxPower] = bluetoothRange(cfgRange) estimates the range between two Bluetooth® basic rate/enhanced data rate (BR/EDR) or low energy (LE) devices. The function also returns the estimated path loss, pathloss, and received signal power, rxPower, between two devices.

    example

    Examples

    collapse all

    Create a default Bluetooth BR/EDR or LE range estimation configuration object.

    cfgRange = bluetoothRangeConfig
    cfgRange = 
      bluetoothRangeConfig with properties:
    
                     Environment: 'Outdoor'
                 SignalPowerType: 'ReceiverSensitivity'
                            Mode: 'LE1M'
             ReceiverSensitivity: -94
                      LinkMargin: 15
                TransmitterPower: 0
          TransmitterAntennaGain: 0
             ReceiverAntennaGain: 0
            TransmitterCableLoss: 1.2500
               ReceiverCableLoss: 1.2500
        TransmitterAntennaHeight: 1
           ReceiverAntennaHeight: 1
    
       Read-only properties:
                    FSPLDistance: 65.3645
                   PathLossModel: 'TwoRayGroundReflection'
    
    

    Set the physical layer (PHY) transmission mode and signal propagation environment to "BR" and "Office", respectively.

    cfgRange.Mode = "BR";
    cfgRange.Environment = "Office";

    Specify the transmitter output power, transmitter cable loss, and receiver cable loss.

    cfgRange.TransmitterPower = 20;        % In dBm
    cfgRange.TransmitterCableLoss = 2.5;   % In dB
    cfgRange.ReceiverCableLoss = 2;        % In dB

    Estimate the range between two Bluetooth BR devices.

    rangeBR = bluetoothRange(cfgRange)     % In meters
    rangeBR = 1×2
    
       17.0455   22.8663
    
    

    Create a default Bluetooth BR/EDR or LE range estimation configuration object.

    cfgRange = bluetoothRangeConfig
    cfgRange = 
      bluetoothRangeConfig with properties:
    
                     Environment: 'Outdoor'
                 SignalPowerType: 'ReceiverSensitivity'
                            Mode: 'LE1M'
             ReceiverSensitivity: -94
                      LinkMargin: 15
                TransmitterPower: 0
          TransmitterAntennaGain: 0
             ReceiverAntennaGain: 0
            TransmitterCableLoss: 1.2500
               ReceiverCableLoss: 1.2500
        TransmitterAntennaHeight: 1
           ReceiverAntennaHeight: 1
    
       Read-only properties:
                    FSPLDistance: 65.3645
                   PathLossModel: 'TwoRayGroundReflection'
    
    

    Set the signal propagation environment to "Home" and the type of received signal power to "ReceivedSignalPower".

    cfgRange.Environment = "Home";
    cfgRange.SignalPowerType = "ReceivedSignalPower"
    cfgRange = 
      bluetoothRangeConfig with properties:
    
                   Environment: 'Home'
               SignalPowerType: 'ReceivedSignalPower'
           ReceivedSignalPower: -79
              TransmitterPower: 0
        TransmitterAntennaGain: 0
           ReceiverAntennaGain: 0
          TransmitterCableLoss: 1.2500
             ReceiverCableLoss: 1.2500
    
       Read-only properties:
                  FSPLDistance: 65.3645
                 PathLossModel: 'NISTPAP02Task6'
    
    

    Specify the received signal power and transmitter output power.

    cfgRange.ReceivedSignalPower = -80;       % In dBm
    cfgRange.TransmitterPower = 10            % In dBm
    cfgRange = 
      bluetoothRangeConfig with properties:
    
                   Environment: 'Home'
               SignalPowerType: 'ReceivedSignalPower'
           ReceivedSignalPower: -80
              TransmitterPower: 10
        TransmitterAntennaGain: 0
           ReceiverAntennaGain: 0
          TransmitterCableLoss: 1.2500
             ReceiverCableLoss: 1.2500
    
       Read-only properties:
                  FSPLDistance: 231.9220
                 PathLossModel: 'NISTPAP02Task6'
    
    

    Estimate the range between two Bluetooth devices.

    range = bluetoothRange(cfgRange)
    range = 1×2
    
       24.7467   32.5042
    
    

    Estimate the distance between two Bluetooth devices by considering a random value from the estimated range.

    distanceValues = min(range):max(range);
    index = randi(length(distanceValues),1);
    distance = distanceValues(index)          % In meters
    distance = 
    30.7467
    

    Input Arguments

    collapse all

    Bluetooth BR/EDR or LE range estimation configuration parameters, specified as a bluetoothRangeConfig object.

    Output Arguments

    collapse all

    Range between two Bluetooth BR/EDR or LE devices, returned as a 1-by-2 vector. Units are in meters.

    Data Types: double

    Estimated path loss between two Bluetooth BR/EDR or LE devices, returned as a scalar. Units are in dB.

    Data Types: double

    Received signal power between two Bluetooth BR/EDR or LE devices, returned as a scalar. Units are in dBm.

    Data Types: double

    References

    [1] Bluetooth Technology Website. “Bluetooth Technology Website | The Official Website of Bluetooth Technology.” Accessed November 12, 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™.

    Version History

    Introduced in R2022a