Algorithms and Simulation Set-Up For Realizing Bluetooth Low Energy Based Ranging
Algorithms and Simulation Set-Up For Realizing Bluetooth Low Energy Based Ranging
MASTER
Algorithms and simulation set-up for realizing Bluetooth Low Energy based ranging
Ramachandran, S.J.
Award date:
2016
Link to publication
Disclaimer
This document contains a student thesis (bachelor's or master's), as authored by a student at Eindhoven University of Technology. Student
theses are made available in the TU/e repository upon obtaining the required degree. The grade received is not published on the document
as presented in the repository. The required complexity or quality of research of student theses may vary by program, and the required
minimum study period may vary in duration.
General rights
Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners
and it is a condition of accessing publications that users recognise and abide by the legal requirements associated with these rights.
• Users may download and print one copy of any publication from the public portal for the purpose of private study or research.
• You may not further distribute the material or use it for any profit-making activity or commercial gain
Department of Mathematics and Computer Science
EIT ICT Masters Embedded Systems
University Supervisor:
Dr. Majid Nabi Najafabadi (Electronic Systems, TU/e)
External Supervisor:
Dr. Joek de Haas (Advanced Technology, Dialog Semiconductor)
With the advent of the Internet of Things (IoT) era and the adoption of gigantic architectural
structures, indoor ranging techniques have gained a new-found importance in consumer electronics
field. These ranging techniques need to be developed on a platform that is suitable for constrained
embedded devices. Bluetooth Low Energy (BLE), also known as Bluetooth Smart is an ultra-
low power, short range wireless standard that is supported by most of smart phones, simple
consumer electronics and IoT vendors. Because of its suitability to the constrained devices and its
ubiquitous availability, ranging techniques developed on the BLE platform can readily integrate
several devices and lead to numerous creative consumer applications. The traditional ranging
systems developed over BLE rely on the signal strength to estimate the distance, which is proved
to be very inaccurate and unreliable under changing environmental conditions. Hence, this master
project aims at finding more accurate and reliable ranging techniques using Time of Flight (ToF)
over BLE platform.
In this project, three different algorithms for estimating the range using ToF were developed
based on Dialog’s BLE chip DA14681. The algorithms were initially checked for its compliance to
the BLE protocol. They were developed on the MATLAB simulation environment and were tested
over the simulated BLE signals. Each of these algorithms are subjected to extensive simulation
runs to observe the accuracy of range estimation they offer and in turn, possible improvements to
the algorithms. When the results from the simulation set-up are satisfactory, a practical set-up
to collect real time data is constructed. The practical data are collected and tested on algorithms
in MATLAB. Each of these algorithms were tested with numerous practical data taken both in
indoor and outdoor environment.
Based on the simulation and practical results, the algorithms are classified whether they are
suitable for the implementation in the future Dialog’s BLE chips. Based on the inferences drawn
from one algorithm, suggestions were made for the hardware improvement in next generation
Dialog’s BLE chips. The best range accuracy we could obtain in simulation environment under
SNR of 30dB is 1m and with practical measurement data we obtain a range accuracy of around
2m.
ii Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging
Acknowledgement
The last 6 months in Dialog was truly an amazing experience. The project was really challenging
and intriguing at the same time. I would like to take this opportunity to thank few people
(to keep it short) who helped me during this project period. My supervisor at Dialog, Joek de
Haas, was the "Captain of our ship" who helped me stay motivated and right-on-track all the
time with his enthusiasm and dynamic decisions. My supervisor at the university, Majid Nabi
Najafabadi, with his guidance, periodic instructions and advice helped me fulfill all the academic
requirements to complete this project successfully. The RF experts in Dialog, Jan Prummel and
Wessel Lubberhuizen were always there to support me with the MATLAB simulations. My project
mate, Yongchang He was a great company to work with and extended fullest co-operation during
the whole duration of this project. Thank you all for that. I would also like to thank my colleagues
in Dialog, Peter de Vreede, Mohammed Aissi and Catalin Tugui who made my everyday stay at
Dialog, a happy one.
I would like to thank three of my friends, Anand Bhaskaran, Josep Stalin Maria Jebamalai and
Abhishek Sujan who are my constant pillars of support at all times and helped me stay positive
and inspired. I would like to thank my mother and my younger brother for supporting me and
encouraging me to pursue my Masters studies in Europe.
I would also like to thank EIT ICT Labs for providing me with this great opportunity to be
a part of two top-notch European Universities (KTH Royal Institute of Technology, Sweden and
Technical University of Eindhoven, Netherlands). Their continuous support and guidance during
the past two years was invaluable.
Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging iii
Contents
Contents v
List of Tables ix
Listings xi
Acronyms xiii
1 Introduction 1
1.1 Context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Novelty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 Problem Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.5 Research Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.6 Track Partition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.7 Thesis Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging v
CONTENTS
Bibliography 57
vi Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging
List of Figures
Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging vii
LIST OF FIGURES
viii Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging
List of Tables
Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging ix
Listings
Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging xi
Acronyms
Abbreviations
ADV Advertisement
AGC Automatic Gain Control
AoA Angle of Arrival
BLE Bluetooth Low Energy
BT Bandwidth-Time
CRC Cyclic Redundancy Code
CRT Chinese Remainder Theorem
DSP Digital Signal Processing
FOM Figures of Merit
GFSK Gaussian Frequency Shift Keying
GPS Global Positioning System
IF Intermediate Frequency
IoT Internet of Things
IPT Indoor Positioning Techniques
IRT Indoor Ranging Techniques
LCM Least Common Multiple
LFSR Linear Feedback Shift Register
LIDAR Light Detection And Ranging
LMS Least Mesn Square Fitting
LNA Low Noise Amplifier
LoS Line of Sight
NLOS Non Line-of-Sight
PDU Packet Data Unit
PLL Phase Locked Loop
Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging xiii
LISTINGS
xiv Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging
Chapter 1
Introduction
1.1 Context
The concept of ranging, or in other words, the estimation of distance between two objects has been
a crucial information ever since humans discovered for the first time that empty tubes submerged
in water was able to detect the approaching vessels. During World War I, techniques like Sound
Navigation and Ranging (SONAR) were used to detect the distance location of the enemy sub-
marines. Following the trend, more technologies like Radio Transmission and Ranging (RADAR),
Light Detection And Ranging (LIDAR), Radio Frequency IDentification (RFID) today’s Global
Positioning System (GPS) were developed, all targeted at estimating the location information of
the person/object at interest.
Over the years, the techniques, technologies and applications of range estimation have changed,
but still the distance/ location information of an object remains a crucial data for variety of
purposes. Today, GPS is the most widely used navigation systems that provides a very good
accuracy of <5m in outdoor open sky conditions [7]. They are being integrated into almost every
smart phone and are being used for navigation and location based services. It is stated by [8]
that out of ≈ 1 billion smart phone users([9]), around 82% use GPS from their smart phone
for variety of purposes. Apart from the traditional navigation services provided by GPS, several
creative applications have been developed to provide customized meaningful information based
on user location obtained from GPS. Few applications include, suggestions of sightseeing places,
restaurants, etc., (for tourist), public transport schedule (for a person who commutes regularly to
work),health apps that tells how much steps the user has walked/biked, the calorie count burnt,
etc. Also, observing the growth of the GPS usage by common people over the years, it can be
seen evidently that huge surge in the number of users occurred after GPS units were readily
available with the smart phones. This behaviour also suggests that services/applications readily
available for use from the smart phones reach a mass market than services that come with special
proprietary hardware.
Similar to the outdoor navigation techniques that have gained so much of popularity after-
math the launch of smart phones, recent days witness developments in the field of indoor local-
ization/ranging. One of the main motivations for this is today’s giant architecture adoption for
shopping malls, workplaces, universities, etc., that strongly demands indoor navigation services.
Further, the approaching Internet of Things (IoT) era with an estimated amount of 20 billion
connected devices by 2020 [10] provides an opportunity for indoor localization to have several
new-found applications. Indoor ranging provides the hardware (within buildings), the answer to
"WHERE" question which currently is largely missing. And with this location awareness, mean-
ingful interactions can be established between humans and hardware. An interesting survey states
Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging 1
CHAPTER 1. INTRODUCTION
that around 80% of the people stay indoors 80% of time [11]. Indoor ranging techniques opens up
a realm of business opportunities and enables retailers to reach targeted customer groups. One
of the attractive business applications using indoor localization is proximity messages in museums
and shopping malls. Few other applications based on Indoor ranging are asset/people tracking,
indoor navigation (in shopping malls/museums), security application, wearables, people behaviour
analysis in supermarkets, etc. Though GPS provides a very good accuracy in outdoor environ-
ment, its accuracy in indoor environment is strongly limited by a number of factors like Non
Line-of-Sight (NLOS) link with satellite, several Ultra High Freqency (UHF) interference sources,
severe attenuation and scattering by the building materials. Hence, several other standards like
Wi-Fi, Bluetooth, Zigbee, etc., are used for the indoor ranging applications.
In this thesis, Bluetooth Low Energy (BLE) is used as the primary standard for which several
ranging algorithms are developed.
1.2 Motivation
Bluetooth Low Energy (BLE) is an upgraded version of the classic Bluetooth technology [12] that
mainly focuses on low energy consumption. BLE also addresses the challenges faced by the classic
bluetooth like fast battery draining and intermittent connection loss. BLE technology is designed
for ultra low power consumption. The power consumption of ≈ 100µAh per day means a typical
BLE device can be operated for 4 years from a coin cell [13]. This feature make BLE ideal for use
in constrained embedded devices. Optimizing for lower power consumption means turning radio
off for as much of the time as possible. This in turn enables BLE to achieve lower standby time,
faster connection and lower peak power [13]. The cost of making BLE chips is only 60%-80%
of the cost of classic Bluetooth chips [13]. This makes BLE chips one of the cheapest available
wireless solution. The characteristics of BLE also satisfies two important criteria of IoT namely,
easy deployment and cost-efficient low power wireless solution [14]. These features along with
the ubiquitous availability of BLE in smart phones makes BLE ideal for IoT applications and in
turn for indoor ranging. It is also estimated that the total number of BLE devices sold by 2020
will reach a whopping number of 8.4 billion units [15], occupying almost 60% of the consumer
electronics [16]. These statistics further denote the potential the BLE chips have in the future.
Furthermore, BLE is a important portfolio of Dialog Semiconductors. Their BLE chip named,
DA14580 launched on May 2013 achieved the feat of becoming the World’s Lowest power consum-
ing Bluetooth chip [17]. They are one of the leading market players in the same field. The ranging
feature, when incorporated into the Dialog’s BLE chips is estimated to contribute largely to their
sales growth and strengthen their hold in the market.
Currently, the applications using BLE chips for ranging rely on the Received Signal Strength
Information (RSSI) for estimating their range. This technique measures the distance between
the transmitter and the receiver, by exploiting the signal fading conditions over distance. Classic
example of this would be one of Dialog’s clients, ’Tile’1 who is dominating the market for BLE
based trackers. But in practice, ranging based on RSSI suffers from a great disadvantage of poor
accuracy. As the strength of the signal varies significantly with varying environmental conditions
and as it also subjected to attenuation by walls, humans and other materials, distance estima-
tion by RSSI becomes unreliable. RSSI can also be used along with fingerprinting to overcome
these disadvantages, but the fingerprinting demands extensive apriori calibration for the building
infrastructure and demands an update every time new changes are made in the environment.
In order to overcome the disadvantages of RSSI, and with an aim to achieve reliable and better
accuracy (<1m), this project uses time of flight of the signal to estimate distance. The time of
flight of the signal is not affected by change in indoor environments. So, the range estimation is still
1 https://www.thetileapp.com
2 Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging
CHAPTER 1. INTRODUCTION
reliable with changing environments. Generally, accuracy of time of flight estimation is affected by
three major issues namely: Time granularity, delay in packet detection and by multipath. These
three problems are efficiently handled in the project which enables time of flight to achieve better
accuracy than traditional techniques.
1.3 Novelty
This projects aims to estimate range by calculating the time of flight of the signal over a certain
number of BLE communications occurring between two devices. This method of using time of flight
in combination with the BLE comes across as a novel approach that has not been implemented
yet. This aspect of novelty signifies the research value of this project.
In this thesis, the main goal is to develop algorithms based on BLE protocol to estimate Time of
Flight (ToF) in phase domain and implement it in the hardware. For such an algorithm, we aim
to achieve the following Figures of Merit (FOM). These FOM are designed by Dialog experts at
the start of this project.
1. Distance measurement accuracy (<5m) for objects moving with a speed of <5km/hr
The general goal of the project can be further broken down into following research questions for
which the thesis aims to answer:
• Research Question RQ_01 How can asymmetric Time of Flight (ToF) measurements be
carried out in the existing BLE chip of Dialog?
• Research Question RQ_02 What are the challenges and how will they limit the accuracy
of estimation?
• Research Question RQ_03 Can this method, along with the existing simple solutions
improve the figures of merit that was achieved?
• Research Question RQ_04 What are the advantages and disadvantages of adopting
symmetric ranging methods compared to the asymmetric solutions?
• Research Question RQ_05 What are possible improvements that can made in Dialog’s
future hardware that can realize the Figures of Merit (FOM) ?
Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging 3
CHAPTER 1. INTRODUCTION
The whole project is split into two individual tracks with equal work and co-operation, bearing in
mind the hefty work demanded in this project. The projects are split into simulation track (track
A) and a practical track (Track B). This thesis work contributes towards the simulation track and
the following summarizes the work done by this track:
Apart from the individual works mentioned above, co-operation was established between the
tracks whenever necessary.
The remaining part of this thesis is organized as follows. Chapter 2 discusses the state of the art.
This chapter discusses the various classification of Localization techniques, and discusses each one
of the Ranging technique individually. Chapter 3 discusses the first algorithm, Asymmetric Single
Channel approach starting with its overview, their simulation set-up, simulation results, practical
results and the infeences drawn from them. Chapter 4 discusses the Symmetric Single Channel
approach, Chapter 5 discusses the Asymmetric Multiple Channel approach extensively and the
chapter 6 summarizes the highlights of conclusions drawn from each one of the algorithms and the
improvements that could be added to this project in the future.
4 Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging
Chapter 2
This chapter provides an overview of indoor and outdoor ranging methods and discusses in detail,
the state-of-the-art techniques available for indoor ranging schemes. The section 2.1 discusses
about classification of the localization schemes. The section 2.2 discusses the start-of-art indoor
ranging techniques along with their advantages and disadvantage. The section 2.3 discusses the
related work, which serves as the basis for the ranging algorithms implemented in this project.
In section 2.4, technological overview of BLE protocol specification is mentioned and this chapter
concludes with section 2.5, where the overview of Simulation Environment is given.
Classification
After realizing the potential business opportunities the indoor ranging solutions could create, a
lot of research and time is invested in creating non-proprietary indoor ranging solutions. Indoor
environments that are widely different from that of the outdoor environment requires special
attention. The outdoor ranging techniques can still be used in the indoor environments but there
is an observable performance degradation due to the following conditions [1] present in the indoor
environment:
These aforementioned conditions mark a clear limitation between the localization techniques
used outdoors and indoors. The Figure 2.1 depicts the general categorization of the localization
methods. The indoor localization techniques can be further broken down into Indoor Positioning
Techniques (IPT) and Indoor Ranging Techniques (IRT). The IPT aims at finding the exact
position of the object in 3D space while IRT focuses on finding the relative distance to the object.
Ranging is the most basic form of measuring a sensor’s output data for measurement from a signal
travelling in space. In order to find the position of the object, the range of the object is estimated
first and then several positioning algorithms like Trilateration [18], Multilateration [19], etc., are
Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging 5
CHAPTER 2. BACKGROUND AND RELATED WORK
applied to arrive at the exact position of the object. This thesis project deals with IRT where the
relative distances between two BLE devices are estimated.
The IRT can be classified based on their domains of operation namely, Time Domain, Phase
Domain and Power Domain. Traditional systems that operate in Power Domain employ RSSI to
measure the distance between transmitter and receiver, by exploiting the signal fading conditions
over distance. Time Domain approaches for ranging rely on the exact time taken by the signals
to travel between the transmitter and the receiver. Phase Domain based approaches rely on the
phase information of the incoming signals to measure the distance. From basics of Electromagnetic
theory, we know that the signal travelling in space accumulates a significant amount of phase and
the rate of accumulation is proportional to the frequency of the carrier. Hence, these phase domain
approaches exploit the relationship between the phase of the signal to the time of flight of the
signal as given below:
φo
∆t = (2.1)
360o × f
where
∆t is the time of flight of the signal and
f is the frequency of the signal.
When the ToF of the signal is known, the range can be estimated by multiplying it with the
speed of the RF (Radio Frequency) signal which is equal to the speed of light 3 × 108 m/s. So, the
range f can be given as,
r = ∆t × (3 × 108 ) (2.2)
Requirements
There are several different techniques that fall under the IRT. In their research paper, [20] identifies
15 indoor localization schemes and classifies them according to their accuracy, precision, scale, costs
and limitations. More recently, [21] published in 2005, discusses the state-of-the-art technologies
based on 20 different parameters. In [22], authors categorize the indoor ranging techniques into
four categories namely, geometry based methods, fingerprinting, cost function minimization and
Bayesian techniques. Similarly, [23] and [24] also present a comparative survey of several indoor
positioning techniques. From all these surveys, it can be clearly seen that surveys are heterogeneous
at arriving at the best suitable IRT. This is because, these survey/classifications are primarily
6 Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging
CHAPTER 2. BACKGROUND AND RELATED WORK
based on certain self-set parameters mostly focused on the application they intend to use. So,
for this thesis, in order to arrive at the best suitable techniques, it is necessary to specify the
requirements that are expected to be satisfied by the technique.
Figure 2.2: Multi-Dimensional User require- Figure 2.3: Multi-Dimensional Technical re-
ments for Ranging Techniques [1] quirement for Ranging Techniques [1]
In the Figure 2.2, [1] presents the 16 different requirements that the user should weigh against,
to arrive at the most suitable technique. Based on user interactions and feedback, the most
relevant User requirements for this project are stated below:
2. Low Cost
3. Availability
4. No. of users
6. Reliability
The author of [1], also presents a list of technical parameters that are unimportant from the
user perspective but are highly important to the developers to deliver a technique that satisfies
the user requirement. The ten most important technical parameters being considered by the
evaluation are shown in the Figure 2.3.
Out of ten important technical parameters for evaluation, the most relevant ones for this thesis
project are listed below:
• Technology used
• Measured quantity
• System Architecture
• Co-ordinate references
Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging 7
CHAPTER 2. BACKGROUND AND RELATED WORK
• Reliability
Hence, in order to choose the best suitable ranging techniques the aforementioned criteria will
also be used for evaluation. From the literature survey and the state-of-the-art, the following are
the best suitable techniques available for the indoor ranging and each of the following will be
discussed individually in the section that follows.
This section discusses the state of the art indoor ranging techniques individually.
This technique is one of the most common techniques which exploits the signal-fading conditions
in space. It is known from the theory that the plot of received signal strength over distance
follows a log-normal distribution. Several models like Friss Free-space model [25], Two-way ground
reflection model [26], Shadowing model [27] describe mathematically, the relationship between the
energy-loss and the distance. Thus, by having a signal power measured at the receiver end and
by applying the suitable signal-decay model, relative distance of the transmitter from the receiver
can be obtained. The Friss free-space model is primarily used in the link budget estimations and
the Two-way ground reflection model derives the mathematical model for the signal at NLOS
conditions [28]. But the most popular signal decay model used to estimate distance is given by
the Shadowing Model [29] as follows:
" # !
Pr (do ) d
= −10βlog (2.3)
Pr (d) do
dB
where
β is the attenuation factor that is calculated empirical to the environment,
d is the distance to be estimated,
do is the reference distance,
Pr (do ) is the power received at the receiver from a known distance do and
P (do ) is the power at the required distance.
This is one of the very practical models, as it does not consider the communication of the
transmitter either as a sphere or circle, but only focuses on the volume of the transmission area
that can change its shape in due course of time [28].
RSSI is a relative indicator of the measured signal strength at the receiver unit. It is usually an
8-bit integer that is used to arrive at the absolute power in dBm. The exact relationship between
the RSSI and the power level cannot be established as it is vendor dependent. Every vendor
calculate their signal strength with different levels of quantization and with different accuracy
from the RSSI range they have defined in their specifications.
8 Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging
CHAPTER 2. BACKGROUND AND RELATED WORK
Though this method is used ubiquitously and also available in commercially successful products
like iBeacon [30] and Tile 1 , it suffers from two main drawbacks, namely the lack of reliability and
poor accuracy. The main reasons being the presence of multi-path and shadowing in the indoor
environments that cause the path-loss models to fail at times. [31] experiments the feasibility to
use iBeacons for indoor localization and observes that the accuracy of the range estimation drop
down from ≈ 1m in Line of Sight (LoS) conditions significantly to ≈ 5m in NLOS conditions. [32]
states that RSSI standalone experiments shows unpredictable high error rate.
Thus, in order to improve accuracy of range estimation, RSSI is used in combination with
several techniques like, fingerprinting, smoothing filters to arrive at a good indoor accuracy. [33]
uses a hybrid approach for their indoor pedestrian tracking where RSSI is combined along with
indoor maps and particle filter algorithm to arrive at accuracy of ≈ 3m. [34] mentions the uses of
sigma-point Kalman filters to arrive at a accuracy much higher than the traditional techniques.
[35] employs the previously known data of RSSI contours centered around the receiver. Further,
other techniques like fuzzy logic algorithms have also been employed to improve the accuracy of the
estimation [36]. One another popular method to improve RSSI accuracy has been the fingerprinting
techniques. The aurhors of [37] have acheived an accuracy of 1.98m with this technique. This
technique creates a mapping of the signal strength all over the considered area. And based on
this pre-known information, the distance is estimated. [38] has employed RSSI fingerprinting in
the playground to track a child. The accuracy acheived was 1.5m. [39] uses RSSI fingerprinting in
the smart phone to track the moving objects. they did not achieve reliable output and consistent
accuracy due to several glitches present in the algorithm and in the environmental conditions.
Though these techniques employed in the distance estimation with RSSI improve the accuracy
(significantly at times), they come with their fair share of disadvantages which prevents employ-
ing those techniques into our approach. The techniques that employ smoothing filtering (Kalman
filter) or complex fuzzy algorithm demands huge computation from the chip and in turn demands
high power consumption. This thesis requires a technique that would offer high accuracy with
minimal computation power. This computational overhead would prevent these techniques from
being employed into IoT devices. The fingerprinting, though seeming like a straightforward ap-
proach requires a change in the fingerprint database even if a small change in the environment
occurs. This fingerprinting approach incurs additional cost of calibration and is not applicable to
spontaneous environments. The use of RSSI also requires the knowledge about transmitting power
of the remote device, which restricts its applications to symmetric approaches where the local end
and the remote end interact. The RSSI techniques violates three main user requirements, namely
accuracy, reliability and stability to dynamic environments. Hence, we could say that RSSI cannot
be directly used a primary technique for range estimation, but could be used in combination with
another simple techniques in this project.
In this method, the same transmitted signal is received by multiple receivers and the distance
is computed based on their time difference of arrival. As it can be clearly seen, this technique
requires multiple receiving points and it is commonly used along with Multilateration techniques.
This technique finds major applications in emergency dialling 911 (in North America) and Loran
C navigation system (circ. 1957).
A simple representation of TDoA working is shown in the Figure 2.4. The TDoA positioning
demands that transmitter lies on a proper hyperboloid with a constant range difference between
the measuring devices [21]. Traditional methods employ correlation to obtain accurate localization
of the object. In this technique, the infrastructure aids in locating the object, rather than the
object being an active participant. This technique is particularly suitable for mesh networks,
1 https://www.thetileapp.com/
Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging 9
CHAPTER 2. BACKGROUND AND RELATED WORK
but not very suitable for devices that are interacting one-to-one. It not only requires complex
antennas but also requires high precision synchronization. This leads to increase in the cost of
the technique. This technique generally requires synchronization of all the modes in the network,
but [40] presents a technique where the TDoA based approaches were without the need for initial
synchronization.
This technique is widely used in RADAR, SONAR and mobile communications. It aims at locating
an object precisely by measuring the angle of the signal received from the target device. The signals
have to be received by at least two antennas in order to locate the objects at a 2D-space. In order
to improve accuracy/ to locate the object in 3D-space, more no.of receivers are needed. The
angle of the received signal is usually calculated by a sensor array where every sensor receives the
signal at a different path difference [41]. This path difference is computed to arrive at the AoA.
Then, the angles arrived at multiple receivers are extended to form an angle direction line and the
intersection of which yields the location of the object. More discussions and details on AoA can
be found in the literature [42], [43]. A simple representation of the AoA working is shown in the
Figure 2.5.
A major advantage of the AoA approach is that it can estimate exact location of an object
in 3D space with just three beacons. The authors of [44] are able to achieve decimetre accuracy
with AoA using novel algorithms on Wi-Fi infrastructure. But, this approach comes with a huge
disadvantage that the device should either have a directional antenna pointed towards the target
or have a large antenna array. Also this method demands that the angles are to be estimated with
very high precision which is limited by the shadowing effect present in the indoor environments.
This technique is very costly to implement. So, this approach is not very suitable for constrained
devices or simple consumer electronics.
10 Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging
CHAPTER 2. BACKGROUND AND RELATED WORK
The ToF based approaches estimates range by measuring the actual time taken by the signal to
travel from the transmitter to the receiver. As the RF signals travels with the speed of light in free
space, the distance is obtained by simply multiplying the ToF with the speed of light. This method
demands highly accurate ToF because measurement error of 1ns can cause an estimation error
of 30cm. In practice, the ToF measured at the receiver will usually be the sum of transmitting
time, ToF and the receiver detection delay. The following are the main bottlenecks in achieving a
precise ToF estimation [3].
1. Clock Synchronization If the clocks between the Transmitter and the receiver are not
synchronized, the difference between their clocks itself will cause an additional time overhead
in the measurement which is much larger than the ToF, in many cases (time domain).
Hence, in order to have very precise measurement of ToF, highly synchronized clocks between
the transmitter and receiver are needed. When operating in the phase domain for ToF
measurements, the clock offset between the devices causes huge phase accumulation as the
frequency offset between the devices will linearly grow over time. This will again lead to
some time overhead added to the ToF measurements. So, regardless of which domain is
used for ToF measurements, the clocks have to be synchronized or techniques have to be
developed for compensation of clock offset between the devices.
2. Limited time granularity In order to have a clock accuracy in nanpsecond (ns), the
oscillators should have frequency in the range of GHz. These kind of crystals are generally
very expensive to be used for constrained embedded solutions. Low cost solutions generally
have their crystal operating frequency in range of MHz. For example, a typical BLE core
operates at 8MHz that offers a time resolution of 125ns, which is much higher than the
resolution expected from this approach.
3. Packet detection delay There is generally a delay present between the receiving of the
packet and its detection by the receiver. This is hardware and/or infrastructure dependent.
4. Multipath There is severe multipath in the indoor environments caused by the reflection
from the objects in the building. This causes the receiver to receive many copies of the same
signal.
Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging 11
CHAPTER 2. BACKGROUND AND RELATED WORK
5. Range vs. wavelength This limitation primarily occurs when the ToF is measured in the
frequency or phase domain. The phase of the travelling signal wraps around its wavelength.
Hence when phase of the signal is used to estimate the ToF, the ToF estimate also gets
wrapped. The maximum range that can be obtained with this method is directly proportional
to the wavelength of the signal (0.125m in case of 2.4GHz band). The distances larger than
the wavelength of the RF signals will get wrapped. The literature [45] and [46] discusses
exclusively about combating this issue.
The aforementioned limitations cause a huge problem in realizing this ToF technique. But from the
literature, we can observe that several simple techniques and methodologies have been proposed
to either compensate for the bottlenecks or circumvent them (discussed in detail in the following
sections). When these limitations are solved by adopting techniques from the literature, the ToF
technique proves to be comparatively more efficient than the other three state-of-art techniques
discussed earlier in this chapter as follows:
• Unlike RSSI technique, range estimations using ToF would provide better accuracy and do
not change with the changing environmental conditions (more reliable).
• Unlike TDoA approach and AoA approach, this technique does not require a mesh net-
work/multiple access points in the environment to operate. It also obviates the need to have
complex receiver design.
Thus, on circumventing these limitations, ToF is expected to provide a simple, promising and a
reliable ranging estimation that can be applied to the constrained devices. A simple comparison
between the state-of-the-art techniques based on their accuracy, complexity and their need for
clock synchronization is presented in the Table 2.1.
Complexity
Techniques Accuracy Time Sync
Low
RSSI Low No
High
AoA Low No
High
TDoA High Yes
ToA Low
High Yes
(Phase Domain)
The ToF technique satisfies most of the user requirements namely, good accuracy, low cost
(compared to TDoA and AoA) and reliability. This technique is stable to dynamic environments
and provides good reliable output. From the above discussions, we can conclude that ToF based
approach is better suitable to this master project compared to the other three techniques. So, in
the rest of this chapter, we analyse several techniques and solutions adopted in literature in order
to overcome the limitations of ToF.
12 Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging
CHAPTER 2. BACKGROUND AND RELATED WORK
The ToF ranging approaches mentioned in the literature can be classified as one-way ranging
techniques and two-way ranging techniques based on whether or not both the interacting devices
are involved in measurements.
One- Way Ranging The authors of [3], have achieved a sub-nano second level accuracy in
estimating the ToF. The paper describes an algorithm that provides sub-nanosecond accuracy of
ToF with a limiting condition that the operating frequency band must be few GHz wide. The phase
information of the wireless channel is exploited to achieve the ToF information. By switching to
measure ToF in the phase domain, the authors overcome the difficulty of limited time granularity
of the hardware. Their design has been implemented in their self-made software solution called
Chronos, which is later implemented in the drones. This proprietary software is made to be
time synchronous with the measuring device. Multi-path has been eliminated by use a filtering
technique to take the signal with shortest ToF out. This method suffers from a The maximum
range problem is tackled by employing the Chinese Remainder Theorem (CRT) [47]. This theorem
states that [48],
"Let n1 , ..., nk be integers greater than 1, which are called moduli or divisors. If the ni are
pairwise co-prime, and if a1 , ..., ak are integers such that 0 ≤ ai < ni for every i, then there is
one and only one integer x, such that 0 ≤ x < N and the remainder of the Euclidean division of
x by ni is ai for every i."
So, when the measurements are made at multiple frequencies and when the frequencies of
operation are pairwise co-prime, the CRT can be used to obtain the exact unwrapped distance
estimation from the wrapped distance measurement. The distance is solved by converting the
whole phase ambiguity problem as a set of linear diophantine equations which can later be solved
using the CRT provided that the LCM of the moduli (of frequencies) should be large enough
to solve the ambiguity.Tthe maximum range will be a Least Common Multiple (LCM) of the
wavelength. This concept can be pictorially represented by Figure 2.6 [3]. The above discussed
concepts from the literature [3] serves as very good example to prove that all the limitations faced
by the ToF approach can indeed be solved and that range accuracy in range of cm can be obtained.
Many literature studies have focused exclusively on solving the range ambiguity issue. As
the received signal is corrupted with noise, many existing algorithms use computational hungry
Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging 13
CHAPTER 2. BACKGROUND AND RELATED WORK
statistical methods with Least Mean Square, in order to obtain the distance very accurately
[49].Some recent literature also shows the usage of maximum likelihood estimations [50], data
association techniques [51] for resolving the unknown distance.But all these above methods are not
suitable to be performed in the BLE core with constrained resources. [45] proposes a comparatively
less computational hungry solution using the Lattice theoretic concepts where the error distribution
of the distance estimation is obtained using lattice theoretic concepts and then the actual distance
computation is done by maximum likelihood estimator. This paper does not involve any exhaustive
search and hence, claims use lower computational power. Their simulations in MATLAB and the
results obtained are robust to noise. But this technique suffers from a drawback of having very less
frequency channels in the given spectrum that are co-prime to one another. In order to solve this
issue, [46] presents a CRT based ranging technique that use the number of adjacent frequencies.
Since, adjacent frequencies are always co-prime to each other, a lot of measurements values could
be obtained for statistical analysis. Simulations of this method show good spectral efficiency and
robustness against noise.
Another interesting literature [52] partly similar to the previous literature, also relies on the
phase domain for the estimation of ToF. This algorithm serves as the main inspiration for the
realization of Asymmetric Multiple Channel Approach. In this paper, phase information from
multiple frequencies is used for distance estimation. The infrastructure used in this paper is
802.15.4. By operating in the multiple frequencies and in phase domain, the authors of this paper
obviate one of the limitations in estimating ToF which is limited time granularity. The signal of
interest (the received signal), after being down-converted by the mixer takes the form of the:
r
Em (r, t) = cos(2πt(fc − fl ) + 2πfc + φo − φr ) (2.4)
c
where
fc and fl demote the carrier frequency and the intermediate frequency respectively,
φo and φl denotes the phase at the local and the phase of the received signal respectively,
r denotes the range and
c denotes the speed of light.
In the above equation, the term 2πfc rc contains information about the distance travelled
by the signal from the transmitter until receiver. Here, the term fc − fl = fif , which is the
intermediate frequency. This is the frequency of the signal at the receiver end after the signal is
down converted by mixer. And this intermediate frequency is always constant for the operating
hardware. When multiple carrier frequencies are used, the term fc can be denoted as fbase +k ×fh ,
where fbase is the base frequency (2.4 GHz, in our case) and is used to control the frequency offset
between the multiple carriers. For two carrier frequencies, i and i+k, their phase difference to a
fixed carrier frequency obtained, when subtracted with each other results in the following equation:
r
∆φ(r, k) = 2πk × fh × (2.5)
c
When the difference in phase between the two carrier frequencies of received signals is well
known, the range can be extracted from the above equation. But in this, the clocks of the
transmitter and the receiver are not synchronised and hence the phase difference between the
carriers have an offset from the clock offsets. The frequency difference between the two carriers
grows over time and this factor has a very huge impact in the phase change of the signal. In
order to compensate for the clock offset, role change is done between the transmitter and the
receiver and then linear fit is performed over both the signals. The authors of this paper achieve
an accuracy in range of centimetres by averaging out ≈ 1000 estimations.
This technique can be readily incorporated into the BLE protocol such that for multiple fre-
quency carriers, three different ADV channels of the BLE (channel no: 24, 54 and 78) can be used.
14 Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging
CHAPTER 2. BACKGROUND AND RELATED WORK
But one major drawback of this approach is its limitation on the maximum range. Similar to the
previous approach, this method also suffers due to the phase wrapping issue. Mathematically, as
stated in 2.5, the maximum range is limited by (fh × k). This means that the frequency separation
between the two frequencies must be as small as possible to achieve larger range measurements.
This is challenging to achieve in the BLE technology as the shortest distance separation between
two advertising channels is 24M Hz which corresponds to a maximum range of 12.5m. For the
expected range of 50m, the expected distance separation must be 6MHz, which means this can
any achieved if one of the interactions between the two ends happen in the data channel. The data
channels in the BLE are separated by 2M Hz. So, if the data channels are used for measurements,
the maximum range of 150m can be obtained.
There are also few other literature that have achieved very good accuracy by employing ToF.
[53] have achieved sub-metre accuracy under severe multi-path conditions with Ultra Wide Band
(UWB) infrastructure. In [54], the distance between two zigbee devices was estimated using the
phase differential method spanning over an entire 2.4GHz ISM bandwidth of 80 MHz. The range
accuracy error they incurred is as low as 16 cm. In [55], the authors assess the advantages and
disadvantages of employing ToF approach.The authors were able to achieve a ranging accuracy less
than 1.33 metres, by using a band-pass filter and taking the average of a series of measurements
and employing special proprietary standard with self-defined packet structure. A lower bound for
the variation in ToF estimation is given by Crammer-Rao bounds [56] which is shown below:
1
σ 2 T oF ≥ (2.6)
8π 2 × βf 2 × SN R × n
where
βf is the bandwidth of the signal and
n is the No. of measurements.
It can be seen from the above equation that the accuracy of estimation can be improved by larger
bandwidth, better signal conditions and by having a large no. of iterations. Most of the literature
discussed in this section on Asymmetric Time of Flight, contrary to what the name suggests is
not completely asymmetric, as they either need to synchronize both the clocks or have to switch
roles to cancel the clock offset. So, the focus has also been shifted to Two-way Ranging (TWR)
where both the parties are involved in measurement.
Two-way Raging In order to arrive at a more simpler way to cancel the clock offset, several
literature have adopted to the TWR of the ToF. When the transmitter and the receiver are not
synchronized, there is an offset created by this on the phase of the signal and hence, also on
the ToF. This clock offset is directional. When measuring the transmitted signal and the received
signal, it can very well be observed that the effect of clock would be −∆clk and +∆clk respectively.
When this transmission (can be referred as ’ping’) and the reception (can be referred as ’pong’)
are done in a very short interval, where the clocks would not drift, by averaging the ToF at both
the sides, the effect of clock drift can be nullified.
In [57], the authors present an approach that aims at minimising the ranging error caused by
the following: clock drifts and finite clock resolution. The paper bases upon their observation
that the ranging error in TWR depends on the time taken for the other end to process and send
the reply. They derive a mathematical equation in which the effect caused by clock offset (due to
larger time interval between ping and pong) is reduced to one-fourth. With this technique, even
when the clock offset between the devices is 80ppm, response time by the other end is 100 us, the
error in ToF is 2ns and the distance error is 0.6 m (< 1m). A similar mathematical model has
also been derived by [58]. The authors of [59] also perform TWR but for multiple set of messages.
The ranging errors in order of centimeters is observed for clock drift of 40ppm and a operating
clock of 32MHz. In [60], despite having measurements taken over both sides and having apriori
clock information, the accuracy is not so good. They could achieve a minimum ranging error of
Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging 15
CHAPTER 2. BACKGROUND AND RELATED WORK
Fusion with RSSI As RSSI is a readily available parameter from the hardware, it will be
efficient to solve the limitations of ToF using RSSI and aid to the accuracy improvement. Several
literature were reviewed to obtain an idea of how exactly RSSI can be used with phase for the
Ranging estimation. [61] describes a ranging estimation that uses both RSSI and the Phase
measurements. Initially, RSSI is used to estimate the approximate distance between the nodes.
With the help of distance value, the approximate slope of the frequency vs. phase angle line can
be drawn. From this approximate value and with few more measurements made, the actual slope
of the line extracted. Though the results seems to be better in case of moving objects, it is not
better than either standalone phase or standalone frequency method.
Another technique is employed in [62] that combines the use of RSSI. This paper employs RSSI
along with TWR to achieve better stability and improve accuracy of the estimation. They use
moving-window average, heuristics and kalman filtering to achieve better results than standalone
ToF approach. A similar fusion technique is also employed in [63] and they use on-line channel
estimation.
From all the above discussions, it can be concluded that the limitations of ToF stated at the
beginning of this section can indeed be overcome by several different techniques and that ToF
based techniques provide promising range estimation. Taking into account the advantages and
disadvantages of every approach and bearing the requirements in mind, Asymmetric and Sym-
metric ToF based ranging algorithms are designed and discussed further in this project. All these
algorithms estimate the ToF in the phase domain. Dialog’s BLE chips capture the I and Q data
of the received signal, from which phase of the signal can be obtained by performing arctan Q I .
This phase data of the received signal is subjected to several algorithms to estimate the ToF of
the received signal, that in turn gives the range.
This section gives a brief overview about the BLE standards that is necessary to design algorithms
compatible to the BLE protocol. This BLE standard, also known as the Bluetooth Smart is
targeted at ultra-low power operations. Its target application area are health care and fitness,
smart homes, infotainment, etc. Their design is targeted to take over the IoT market. The
following Figure 2.7 gives an overview of BLE protocol operation.
The BLE occupies 2.4GHz of the ISM band co-existing with Wi-Fi. It has 40 communication
channels spanning from 2400MHz to 2480MHz with 2MHz bandwidth per channel. Out of these
40 communication channels, there are three Advertisement (ADV) channels. They are channel 37
16 Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging
CHAPTER 2. BACKGROUND AND RELATED WORK
(2402MHz), 38 (2426MHz), 39 (2480 MHz). These ADV channels aids the connection establish-
ment, known as ’Pairing’ between the BLE devices. These channels were chosen purposefully to
avoid interference from Wi-Fi main access point. The remaining 37 channels are used for data
exchange between the devices, after the pairing has been established. The BLE protocol follows
the Master-Slave architecture. For every ADV request sent by the peripheral/slave device,an ac-
knowledgement packet is sent back by the master, called the SCAN_RESPONSE. In order for
the connection to be established successfully, the acknowledgement must arrive at the slave device
in less than 150µs. The signals in BLE are modulated using Gaussian Frequency Shift Keying
(GFSK) modulation technique and the modulation index can range anywhere between 0.45 and
0.55. The data rate is 1Mbps. The Bandwidth-Time (BT) product is maintained to be 0.5, in
general. The packets in typical BLE transmission has the following Packet structure as shown in
the Figure 2.8:
A technique called Whitening is applied to the Packet Data Unit (PDU) and Cyclic Redundancy
Code (CRC) part of the packet. This technique is employed to avoid continuous streams of ones
or zeroes. A Linear Feedback Shift Register (LFSR) is used for scrambling. The whitening word
is generated with the polynomial g(D) = D7 + D4 + 1 or 221 in octal representation. The seed
for the LFSR will be the channel number.
The Simulation environment used here is MATLAB. It is interactive system primarily used for
technical computing that combines computation, Visualization and programming into simple easy-
to-understand interface. The programming language used here is the MATLAB scripting language.
In this project, all the ranging algorithms were first developed and tested in the Simulation Envir-
onment before testing it in practice. MATLAB offers specialized toolbox for various domains, to
perform domain-related complex tasks. This project uses Digital Signal Processing (DSP) toolbox
primarily for performing GFSK modulation schemes on the generated signals. All the developed
algorithms estimate ToF in the phase domain. So, phase of the signals are extracted and are fed
into the algorithms. The following are the primary tasks that are carried out in MATLAB.
Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging 17
CHAPTER 2. BACKGROUND AND RELATED WORK
1. Signal Generation As a first step in the simulation process, the BLE transmitted and
received signals are modelled using MATLAB. With reference to the measuring end, the
transmitted signal will appear as an ideal signal devoid of any impairments like noise, effects
of crystal offset, etc., On the other hand, received signals is affected by several factors
present in the environment that cause a change in phase of the signal. An ideal signal is
generated and later impairments are added to make it a noisy signal. Both the signals are
the GFSK signals that have their parameters like modulation index, oversampling factor,
bandwidth-time product specified by BLE protocol specifications.
2. Addition of impairments The transmitted and received signal (observed from local end)
are different from each other. The received signal has travelled in space and has the following
impairments namely, frequency offset, noise, time of flight etc, added to it that will cause a
phase change in the signal. The received signal is made more closer the practical signal by
adding the aforementioned impairments into the signal. In addition to this, the hardware
chain in the receiver causes phase change and amplitude changes in the signal which are also
modelled in the simulation environment.
3. Developing Algorithms Once the signals are generated, they represent the BLE commu-
nication medium. The phase data for every sample (for both the signals) act as an input
to the algorithm. The algorithms are also developed in MATLAB and are tested over this
signals’ phase data. The accuracy of the range estimation along with its variance for several
packets is used as a main criteria to measure the effectiveness of an algorithm.
4. Practical Results When the result for a particular chosen algorithm is promising, a prac-
tical set-up is generated by the track A to capture BLE signals and import them into MAT-
LAB. These signal data are tested on the algorithm developed on the simulation platform.
In order to accept the practical data into the simulation environment, the existing set-up
is modified to hold a processing script that will process the raw signal capture from the
hardware into the useful measurable data.
18 Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging
Chapter 3
This section discusses the Asymmetric Single Channel Algorithm in detail starting with the work-
ing of the algorithm, implementation in Simulation environment, Simulation results, Practical
results and finally concludes with the inferences that we could draw from them.
3.1 Overview
This algorithm aims to estimate the ToF of the received signal in the phase domain. A Least Mesn
Square Fitting (LMS) fitting [64] is done on the received phase to resolve the ToF. The following
figure 3.1 represents the working of the algorithm.
As the name says, this algorithm is asymmetric. It means that the algorithm is implemented
on the local side and it influences only the local side. There is no control exercised or information
obtained from the remote side. By ’single channel’ we mean, the data obtained from only one of
the three ADV channels is captured, stored and processed to estimate the range. This algorithm
Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging 19
CHAPTER 3. ASYMMETRIC SINGLE CHANNEL APPROACH
presents a very attractive use-case, where the Dialog’s BLE chips can be made to interact with any
BLE device and can estimate the distance from them. This technique satisfies the user requirement
of vendor interoperability. If this asymmetric range estimation can be achieved with a promising
accuracy, it will open up a realm of business opportunities.
In this Algorithm, the local end is the Dialog’s BLE chip and the remote end is assumed to be
any BLE device. The local end with the Dialog’s BLE chip acts as the slave which sends a connec-
tion request to the remote end that acts as a master. The local end sends connection request in
three allocated BLE ADV channels namely, channel 37, 38 and 39. The remote end after receiving
one of the three ADV packets establishes the connection by sending back an acknowledgement
called SCAN_REQUEST, usually within 150µs. According to the BLE protocol, as soon as the
master device receives the first ADV packet request, it establishes a connection while ignoring the
ADV packets from the other two channels.
In ADV packet structure, a 48-bit address of the local end (Dialog’s BLE chip) is added in
the payload which is also reflected back in the SCAN_REQUEST packet along with the remote
end’s address, as shown in the Figure 3.1. A copy of the transmitted ADV signal is stored by
the local end for later use. These 48-bits undergo GFSK modulation resulting in a phase curve.
The shape of the phase curve is purely dependent on the input bits. So, when the same 48-bits
are observed in ADV and the SCAN_REQUEST packet, the phase change in bits resulting in
the phase curve will also be the same. But, due to ToF, noise etc., that occurs during the signal
travel, the phase of the signal gets altered. Hence, by performing a LMS fit of the noisy signal
(SCAN_REQUEST) over the ideal signal (ADV) signal, we resolve the ToF. The phase of the
SCAN_REQUEST packet is captured as shown in the Figure 3.2. The phase is of the signal is
obtained from the hardware as In-Phase (I-component) and Quadrature (Q-component). This IQ
information is tapped out of the hardware just before the demodulator block in the Figure 3.2.
At this stage of the receiver chain, the received RF signal is devoid of its 2.4GHz carrier and only
contains the Intermediate Frequency (IF) component. From this IQ information, the phase of the
signal is obtained as follows:
Q
ϕR = arctan (3.1)
I
When the signal travels in space from the transmitter to the receiver, there will be few impair-
ments that will induce a phase change in the travelling signal. The main impairments would be as
follows: the effect of clock offset between the transmitter and receiver, noise in the channel, random
phase offset induced at the transmitter side in addition to the phase change that is caused by the
GFSK modulation of the bits. Considering the effects of the above-mentioned impairments, the
phase of the received signal (SCAN_REQUEST) after the removal of the intermediate frequency
is observed to have a mathematical relationship as shown below:
!
r ∆f r
ϕR = ∆f × t + 2π(∆f + fc ) × + k.ϕT 1+ ×t− +ϕ (3.2)
c fc c
20 Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging
CHAPTER 3. ASYMMETRIC SINGLE CHANNEL APPROACH
• ∆f × t This term is induced by the clock offset between the transmitter and receiver. Due
to this, the phase of the signal will get ramped up linearly as the phase here is a product of
frequency offset at carrier frequency (∆f ) and the time t.
• 2π(∆f + fc ) × rc This is the amount of phase change caused due to the ToF of the signal.
It causes a delay in the signal which when viewed in the phase signal will appear as a shift
in the time axis. This term is a constant for a fixed channel, fixed frequency offset at a
particular distance.
!
∆f r
• k.ϕT 1 + fc × t − c This is the phase change induced by the GFSK modulation of the
remote end’s bits. This term also includes modulation index of the remote side (∆h). As
the BLE specification allows for the modulation index to be between the range 0.45 to 0.55,
there is a possibility for the transmitter and the receiver to have different modulation index.
The sub-term ∆f fc × t is caused due to the unsynchronized clocks at the transmitter and the
receiver. As the ∆f is maximum of 20ppm in Dialog chips and the measurement time is
48µs (corresponding to 48 symbols and sampling frequency of 8MHz), the maximum error
due to clock offset within one SCAN_REQUEST packet received is 0.96ns, corresponding
to a range error of 0.29m. As we do not aim at sub-metre accuracy in our approach, this
term can be approximated as, ϕT (t − T oF ).
• ϕ This is a constant additional phase change induced at the transmitter or receiver mixing
process.
The transmitted signal/ADV packet is considered to be the ideal signal devoid of the impair-
ments. There will be no frequency offset in transmitted signal, as the reference clock is the local
clock. There is no phase change induced by the range, or there is no additional phase offset. Thus,
the phase of the ideal signal is only modelled by the GFSK shaping of the 48-bit address.
For this Asymmetric ! Single Channel approach, the last two terms of 3.2,
k.ϕT 1+ ∆f
fc ×t− rc +ϕ are sufficient to resolve the ToF of the signal along with the additional
impairments by performing the LMS fitting of the two signals. The first term ∆f ×t is compensated
r
by LMS fitting and hence removed from the equation and the second term, 2π(∆f + fc ) × c is
a constant and will have less meaning when included in the fitting
LMS Fitiing The idea to use LMS fitting for estimation of impairments came from the com-
pany’s side as the starting point for this project. LMS fitting technique aims at finding the best
Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging 21
CHAPTER 3. ASYMMETRIC SINGLE CHANNEL APPROACH
fit curve by trying to minimize the error between the ideal curve and the curve to be fitted. This
technique is a form of linear regression and hence, the parameters under fitting are expected to
have a linear relationship with each other. But 3.2 is not entirely linear. The term ϕT (t) is non-
linear in t. As, this term, ϕT (t) varies at the rate of 1µs and the ToF measured is in range of
ns only, a first order approximation using Taylor’s series is performed over this term. Thus, after
performing a linear approximation, this term becomes,
dϕT (t)
ϕT (t − T oF ) ≈ ϕT (t) + ∆t. (3.3)
dt
Now, the phase of the received signal after linear approximation looks as follows:
r dϕT (t)
ϕR = ∆f × t + 2π(∆f + fc ) × + (1 + ∆h)ϕT (t) + ∆t. +ϕ (3.4)
c dt
By performing LMS Fitting between the Transmitted Phase and Received Phase, we hope to
resolve four impairment. They are ∆f (Frequency Offset), ∆h (Modulation Index Offset), T oF
(Time of Flight) and ∆ϕ (Phase offset). The linear equations for LMS fitting can be given as,
y = Xβ (3.5)
where
d
ϕT 1 t1 1
ϕR1 ϕ
ϕT 1
d
(1 + ∆h)
ϕR2 T2 ϕT 2 t2 1
∆t
y=
. . . , X = ..
.. β = ∆f
.. ..
. . . .
ϕRn ϕT n d
t3 1 ∆ϕ
ϕT n
where the numbers 1 to n represent the sample numbers. For the fitting, totally 48 bits/sym-
bols are taken into consideration. The oversampling rate of the hardware is 8, which results in
384 samples. For the fitting of one SCAN_REQUEST packet, all 384 samples are considered
individually for the phase and the sampling time. The matrix y is obtained from the received
signal. The matrix X denotes the ideal signal (transmitted) whose data is also available. t1totn in
the matrix X denotes the sampling time of the signals.In 3.5, we are interested in matrix β that
contains the output parameters. In order to find beta, we make use of the optimized closed-form
expression,
−1
β = (X T X) X T y (3.6)
Thus, the LMS fitting performed over the two signals will result in the ToF estimation. To
summarize, the Asymmetric Single Channel algorithm can be explained in the following three
steps:
• Capture the IQ data of the SCAN_REQUEST packet. Obtain the phase of the received
signal.
• Perform LMS fitting of the received signal over the ideal signal
• Obtain ToF and thus, the range
3.2.1 Set-up
The basic simulation set-up for this algorithm in MATLAB was given by Dialog as a starter kit.
The simulation contained the basic BLE signal generator and the code for LMS algorithm. Though
22 Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging
CHAPTER 3. ASYMMETRIC SINGLE CHANNEL APPROACH
the simulation set-up was present already, a lot of improvements has been made to obtain clean
simulation results. The flowchart in the Figure 3.3 will explains the different sequential operations
carried out in Simulation to realize this algorithm.
As a first step, GFSK modulated signal is obtained from the 48-bit device address. The GFSK
modulation is cumulative. That is, the phase of the nth sample is affected by all the 1 to n-1
samples before. For example, the phase of fourth sample in 1001, is different from that of 1010,
even though the number of 1’s and 0’s are the same in both the cases. The parameters for the
GFSK modulation are specified in a separate function, called gfsk_param.m. This function con-
tains information necessary to perform GFSK modulation such as modulation index, oversampling
factor, BT product, symbol rate, the width of the pulse shaping filter, carrier frequency, and the
frequency offset. For, the ideal signal, the frequency offset will be 0 and the modulation index is
0.5. These bits are first input into a GFSK pulse shaping filter. The output of the pulse shaping
specified in the function gfsk_param.m generates a GFSK shaped output pulse. This output of
the pulse shaping filter is oversampled by a factor of 8 and is a complex representation of the
phase curve. Phase curve is then obtained from the complex curve as follows:
where ’x’ is the complex signal resulting from the GFSK shaping. The angle function in
MATLAB gives the output in radians. The phase in a simulation environment is considered in
cycles, hence has a division of 2π. In order to overcome the signal wrapping problem which will
result in range wrapping, a special function in MATLAB called the unwrap function is used. This
function unwraps the signal at the end of every cycle. Hence, the GFSK modulated phase curve (in
cycles) is obtained. This will be the transmitted phase curve of the ADV packet. In the simulation,
the phase of the samples is directly found via the above said procedure without needing IQ- data.
A similar procedure is done for the noisy signal generation too. In order to inject the frequency
offset and the modulation index offset, the respective values in the gfsk_param.m function are
given a value different from the values for Ideal signal. Then all the similar procedures done for
the ideal signal generation are followed to arrive at the GFSK phase curve. Though the input bits
for both the ideal and noisy signal are the same, the phase curve of the noisy signal is ramped
up because of the frequency offset injected. There are changes induced because of the modulation
index too, but it is not observable to visualization. To the resulting complex signal from the pulse
shaping filter, the ToF and the phase offset are added as follows:
Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging 23
CHAPTER 3. ASYMMETRIC SINGLE CHANNEL APPROACH
The phase offset is added as a constant offset in degree directly to the complex signal. The ToF
causes a delay in the signal which is added to the differentiation of the received (noisy) signal as
derived in the mathematical equation 3.5. The phase curve of the ideal and noisy signal are shown
in Figure 3.4. These signals represent the ADV and the SCAN_REQUEST packet respectively.
The noisy signal in the Figure 3.4 has the following impairments added to it:
frequency offset - 2500 Hz
Modulation index offset - 0.01
Phase offset - 80o
Time of Flight - 83.33ns corresponding to a distance of 25m
The horizontal axis of the graph represents the time axis represented in terms of samples. The
time here is the sampling time. So, one unit of X-axis (or one sample) amounts 8MHz of the
oversampling rate which is 125ns in absolute time. The vertical axis represents the phase in term
of cycles. One cycle corresponds to 2π radians or 360o in absolute value. It is visible from the
Figure 3.4 that the ideal and the noisy signals look visibly different though they have the same
input bits. The noisy signal is shifted up the vertical axis by an amount equal to the phase offset.
This signal is also delayed in the horizontal axis by an amount equal to the time of flight. The
frequency offset has caused a linear ramp in the noisy signal. In order to understand the effects of
24 Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging
CHAPTER 3. ASYMMETRIC SINGLE CHANNEL APPROACH
every impairment on the signal phase individually, the particular parameter to which the output
needs to be observed is alone fed into the simulation has been and the results have been observed
individually. The Figures 3.5, 3.6, 3.7 and 3.8 show the ideal phase curve and then move on to
represent the change in phase curve induced by every impairment.
Figure 3.5: Ideal Phase Curve for 96 symbols Figure 3.6: Phase Curve with SNR =5dB
Figure 3.7: Phase curve with Phase offset of Figure 3.8: Phase Curve with Frequency
90 degree Offset of 100kHz
The Figure 3.5, shows the simple GFSK modulated single, without any impairments. It is also
to be noted that this ideal curve looks different from that of Figure 3.4, because they both have
different input bit patterns and the shape of the curve is dependent on the bit pattern.
The Figure 3.6 represents the phase signal in the presence of heavy noise. The SNR=5dB is
the worst possible signal condition. This kind of extreme values are given in order to observe
distinctly, the change in phase curve.
The Figure 3.7 represents the phase signal in the presence of a constant phase offset from the
receiver. One can observe that the noisy signal, represented by the green curve, is just shifted
vertically up, in the phase axis.
The Figure 3.8 represents the ramp in the signal induced by the large frequency offset. And
finally, Figure 3.9 shows the shift in time axis caused by the ToF of the signal. For this entire
simulation set-up, the whitening in the typical BLE packet is assumed to be turned off.
Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging 25
CHAPTER 3. ASYMMETRIC SINGLE CHANNEL APPROACH
3.2.2 Results
The above simulation set-up was tested to verify the accuracy of its estimation. Now, instead of
one BLE transmission, 5000 BLE transmissions are simulated. More the number of iterations,
more the Gaussian nature in the histogram. The Mean of the 5000 estimations and their standard
deviation was used to test the accuracy. A nominal Signal to Noise Ratio (SNR) of 30dB is used
in the simulation environment, close to the practicality. In the simulations, it can be observed
that bad SNR can cause very bad accuracy in estimations. The value of the impairments that
were given as an input to the simulation are as follows:
The histogram of the fitting results over 5000 iterations (or BLE transmissions) is shown in
the Figures 3.10, 3.11, 3.12 and 3.13.
It can clearly be observed from the Figures 3.10, 3.11, 3.12 and 3.13 that the histogram follows
a Gaussian shape with accurate mean and a very small standard deviation. From the fitting
experiments, it can be observes that when the number of iterations is huge, the Gaussian shape
of the signal is more visible
Bit Pattern Issue Though we get very good results as shown in the histograms, it was not
always we got the results with such accuracy. On analyzing the effects, we found that when a bit
pattern with an unequal number of 0s and 1s are given, the mishap occurs. One of the very first
assumptions for this error was the linear approximation of the signal. As the LMS fitting performs
linear regression, it was assumed if the linear approximation of the non-linear parameter would
cause any error.
26 Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging
CHAPTER 3. ASYMMETRIC SINGLE CHANNEL APPROACH
Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging 27
CHAPTER 3. ASYMMETRIC SINGLE CHANNEL APPROACH
follows:
dϕT (t) ∆t2 d2 ϕT (t)
ϕT (t − T oF ) ≈ ϕT (t) + ∆t. + (∆t) . (3.7)
dt 4 dt2
After this, the improvement in accuracy after inclusion of each higher term in the Taylor
expansion series is simulated and the results are tabulated below in Table 3.1:
28 Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging
CHAPTER 3. ASYMMETRIC SINGLE CHANNEL APPROACH
Taylor Series Expansion Mean (in ns) Std. Deviation (in ns)
∆t. dϕdt
T (t)
-1.7682e-05 0.0074
2 2
(∆t) ∆t4 . d ϕT (t)
dt2
1.2015e−15 1.6428e−13
Table 3.1: Addition of Taylor’s terms and its corresponding accuracy improvement
This fitting (when the higher order term is included) results in ToF whose accuracy improve-
ment is seen as a change in the third decimal digit (at maximum), which is too refined of an
accuracy improvement considering the specification requirement of our project. Further, this ad-
ditional term also increases the computational power multi-fold because of the complexity involved
in solving the non-linear equation. Hence, from this mathematical derivation, we can conclude
that the problem was not with the non-linear approximation.
Later the main source of error was found to be in the way the ToF was added to the differ-
entiation of phase. In MATLAB, the command used for differentiation is diff, which returns one
sample less of the input array. So, in the set-up after performing the differentiation and in order
to make the array to the same size, a 0 was appended to the differentiated phase. As the GFSK
modulation is cumulative, when the number of 1s and 0s are the same the phase curve starts and
ends back at 0. But when there are unequal number of 1s and 0s, the phase curve originally ends
in a value other than zero, but appending a zero force the phase curve to at the end, that caused
all the mishaps. This was found and fixed in [6].
A simple MATLAB profiling has also been done to check the time taken and computational
abilities in MATLAB. It can be seen that fitting for one BLE packet only takes 0.04ms to execute
and only 6.31% of the computation needed for total processes namely, capturing raw IQ, processing
it, etc., [6]. Hence, from the experiments done in the simulation environment and on observing
the accuracy of the simulation, it can be said that this algorithm has good possibilities to work in
the practical hardware.
The practical set-up for realizing this algorithm is done in [6]. A MATLAB script was given by
the company as a starter kit to collect the IQ-data from the hardware, that is used to capture the
IQ-data. Meanwhile, the simulation test bench is also modified to collect the practical data from
the hardware to use in the MATLAB. The hardware gives the raw IQ- data which cannot directly
be used in the simulation and into the algorithm, hence it undergoes a series of different processing
stages. The processing stages involve removal of IF frequency, performing a correlation to find
the start of the sample, etc., The details of the processing can be found in [6]. After successful
practical set-up, the collected IQ data are run in the simulation environment and the following
result was observed for the ToF as shown in Figure 3.14. As one can observe from the Figure,
the spreads in histogram are huge compared to the maximum of 6ns spread in the simulation
environment.
Continuing the experiments for several different ranges, the following two problems were no-
Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging 29
CHAPTER 3. ASYMMETRIC SINGLE CHANNEL APPROACH
ticed.
• The end to end spread are as large as 200ns for the ToF estimation, though the frequency
offset is always a good estimation with 300-600 Hz spread.
As a very first step, in order to check if these erroneous values are caused because of the multi-
path in the indoor environments, we perform the experiments in the fields, in the Line-of-Sight.
Also from those measurements, we can see that the spreads of the estimation are too large and
that they do not change with the changing distance. This confirms that problem in our case was
not multi-path.
One main reason behind the huge spread was analyzed to be the large time interval of 600ms
between one ADV transmission to the next. Whereas, one typical ADV packet length in time
units was approximately 20-30ms. During this interval between one ADV packet to the other, the
frequency offset and time product would be growing much faster. This huge value gets added to
the ToF estimation and the modulation part of the 3.2 becomes as follows
!
∆f r
k.ϕT 1+ ∗ t − + ∆clk (3.8)
fc c
An experiment has been done to check how well the fitting can estimate the results if the signal
is wrongly correlated by few samples before or after. The results show that the fitting is sensitive
to the variation in sample start [6]. So, we came up with a solution for clock compensation in
between the packets. As, we can the measure with MATLAB exactly the time interval between
ADV packets and from the fitting result of every ADV packet we know frequency offset down to
an accuracy of ≈0.2ppm, we hope to perform a compensation for clock in between the packets as
in:
30 Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging
CHAPTER 3. ASYMMETRIC SINGLE CHANNEL APPROACH
∆f
Tcompensation = (mod125ns) (3.9)
fc
Meanwhile, with improvements in BLE stack protocol, the time interval between the packets
is now reduced to 250ms. After the time interval between the packets have been reduced and the
compensation has been made, we observe the histogram of ToF look like the Figure 3.15. The
figure still has a spread/std.deviation of about 50-60 ns and the distance still do not change and
the reason is evident from the equation. In order to perform clock compensation more accurately
down to, say 10ns, from the equation we can observe that the average packet interval between
the ADV packets must be closer to that of 40ms which are not permissible with the current BLE
set-up. But, according to the BLE protocol specification, a minimum ADV interval is only 20ms.
If this time interval is achieved between the packets, the accuracy can be brought to < 1.5m in
this approach.
Furthermore, on analysing the clock compensation we make for the every BLE ADV packet
and also the frequency offset that is estimated by fitting for every packet, we see that clock
compensation and the frequency offset do not align with each other as shown in Figure 3.16 [6].
We can also see a clear breathing of the crystal, as the rate at which ToF wrapping occurs for
every 125ns, varies significantly from the first few packets to the last packet.
Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging 31
CHAPTER 3. ASYMMETRIC SINGLE CHANNEL APPROACH
3.4 Inferences
Though this approach presents a very attractive use case, there are two major bottlenecks in
realizing this approach practically. They are as follows:
1. The minimum achievable Time interval between the successive ADV packets
From, modifications to the BLE stack, the minimum time interval between the packets was
reduced to 100ms. Even this did not significantly contribute to the reduction in the spread and
achieving different results for measurements at different distances. The breathing of the clock
that is visible from the Figure 3.16, is currently unexplainable and hence the clock compensation
becomes ineffective.
From the above discussions and inferences drawn from so many experiments we made, it is
evident that the aforementioned bottlenecks cause major challenges in realizing this Asymmetric
Single Channel Algorithm in practical hardware.
32 Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging
Chapter 4
In order to overcome the limitations caused by the clock offset between the devices in the previous
Asymmetric Single Channel approach, the Symmetric Single Channel Approach was designed.
This chapter discusses the Symmetric Single Channel Algorithm in detail starting with the working
of algorithm, its implementation in simulation environment, simulation results obtained, practical
results and finally concludes with the inferences that we could draw from them.
4.1 Overview
In the previous case of Asymmetric Single Channel Approach, the main problem was the inability
to cancel the clock offset efficiently between the two devices. In order to solve this issue, we design
this method called Symmetric Single channel Approach. The Figure 4.1 presents a schematic
representation of this approach.
This approach as the name suggests is symmetric, meaning that the Dialog devices are used
at both the ends. And as the words single channel implies, the data from only one out of three
ADV packets is used for estimating the ToF. The peripheral/slave device transmits the ADV
packets in all three channels, namely channel 37, 38 and 39. The scanner receives one of the three
Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging 33
CHAPTER 4. SYMMETRIC SINGLE CHANNEL APPROACH
ADV packets first. Instead of merely replying for this ADV packet, the scanner stores the ADV
packet before replying with the SCAN_REQUEST. The time interval between the ADV packet
and the SCAN_REQUEST packet is 150µs, which is very small interval for the clock offset to
grow, compared to the minimum interval of 100ms in between packet transmissions in the previous
algorithm. Now, both the devices perform the acquiring of IQ-data out of the received BLE packet,
processing of raw I-Q data, perform fitting and finally estimate the ToF.
The activities done by the local end on one side in the previous approach is now replicated and
carried out on both devices. After estimating the ToF individually, both the results are averaged
out to calculate the ToF. The scanner used in the approach has its BLE stack modified and it also
needs to perform the LMS fitting. Hence, this solution would be a proprietary solution that would
require Dialog devices on both the ends. A schematic representation of this algorithm is shown in
Figure 4.2. Considering the practical implementation concerns in mind, instead of processing the
ADV and the SCAN_REQUEST packet, the SCAN_REQUEST and the SCAN_RESPONSE
are processed to estimate the ToF.
As shown in 3.8, the clock offset between the devices gives rise to an additional term along
with ToF. But, in this approach, the time window is just 150µs where the clock offset is nearly
constant. So, the effect of clock in one direction will be opposite to that of the other as shown
below. When the final results are averaged out, the ToF becomes devoid of the effects of these
clock offsets.
The realization of this algorithm in Simulation environment is merely running the MATLAB
code of the previous algorithm twice and then averaging it out, which does not give much inform-
ation. So, the simulation part of realizing this algorithm is omitted.
The practical test bench set-up to capture the SCAN_REQUEST and SCAN_RESPONSE packet
was developed by [6]. The Figures presented in this section are generated from the practical track
[6]. In order to process the acquired data and perform fitting, the same simulation environment
was re-used. One important thing to note in this current step is the sequence numbers. As
we have three interactions per packet and we perform nearly 1000 interactions for arriving at fit
results, it is crucial to pair the correct SCAN_RESPONSE and SCAN_REQ packets. The results
obtained from this new set-up looks as shown in Figure 4.3. Contrary to the previous case, where
we observed only one peak histogram with a huge spread, this algorithm results in two peaks,
clearly separated by 62.5ns. This is half of the BLE system clock. In the processing step, there
is step called cross-correlation being performed. Here, the whole of the received BLE packet is
34 Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging
CHAPTER 4. SYMMETRIC SINGLE CHANNEL APPROACH
correlated against the ideal signal (containing 48 symbols) to find the start of the address bits.
This procedure can cause an error of few samples, which is mod 125ns. In our procedure we
perform averaging, so the mod 125ns gets divided by 2 to yield 62.5ns peak apart. This indicates
correlation has produced two different sample starts. In such cases where there are two peaks,
one peak is folded over the other peak which is more closer to correctness. With the single folded
peak, the mean and the standard deviation are calculated.
Clock Offset From the Figure, 4.3 one more important thing to notice is that spread in the
fitting result. As, the time interval for one transmission is the smallest of all three algorithms, we
hope to see a very small spread in the ToF results. The spreads in the results are as expected and
are as low as approximately 5-6 ns which translates to roughly 2m for the different measurements
ranging from 0-15m.
Range estimation Another problem faced by the previous algorithm was that we always arrived
at the same estimated range for different measurements taken at different distances. In order to
verify this, the actual distance vs. estimated distance graph was plotted as shown in Figure 4.4.
In these measurements, we do not directly look at the absolute value of the estimated range as this
can vary because of some random constant offsets that are induced in the hardware. So, we only
observe if the estimated ranges fall in increasing straight line with a slope of 1. In this Figure, you
can see that there is a change in estimated range for different actual distances, but the change is
not linear to the actual distance.
The possible observations for this root cause were as follows:
Channel Filter’s Gain setting The 1Mhz channel filter is used in the hardware. It induces
a goup delay of around 500ns into the signal. The receiver’s total gain is determined by the
channel filter along with Low Noise Amplifier (LNA). The channel filter has ten different AGC
setting. It chooses one of these 10 settings based upon the strength of the received signal. From
Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging 35
CHAPTER 4. SYMMETRIC SINGLE CHANNEL APPROACH
observations made by [6] it can be seen that the channel filter induces an error variance of 30ns
in estimation range of 0 to 20m. The solution to this was AGC controlled calibration table, with
which correction was later made to the obtained ToF estimation.
Reset In between every packet transmissions, a hardware reset in performed to enable the re-
ception of the second packet transmission. It was found that the reset would cause and inject
random time delay into the signal. So, in order to avoid this, the hardware reset was made to re-
move. More detailed practical information on the experiments performed and their corresponding
experimental set-up is available in [6].
4.3.1 Set-up
From the observation made from the practical track, it was obvious that in addition to the ToF, the
hardware injects some random delay. Initial simulation set-up was made assuming that hardware
was perfect. In simulation the individual hardware blocks in receiver chain were not included.
They were considered as a blackbox that in the end would give a GFSK modulated signal. So,
the final effect of the hardware was only simulated. But, in order to understand the hardware in
more detail and in order to verify if there are more factors than discovered that contributes to this
additional random delay, the simulation set-up was extended to have the effects of entire receiver
chain of the hardware. The new models added into the simulation are shown in the Figure 4.5.
The simulation flow for adding new models into the existing simulation can be broken down
as follows:
• To the complex signal containing the four impairments (from the old set-up), an IF frequency
of 1MHz is added.
• This complex signal is broken down into its real and imaginary parts, as to replicate the
36 Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging
CHAPTER 4. SYMMETRIC SINGLE CHANNEL APPROACH
• To these I and Q signals, individually amplitude mismatch and the DC offset were added.
• These signals are then fed into the channel filter with the ten different AGC settings that
will induce an additional delay of 500ns.
In the real hardware, demodulator block follows the quantization. The I and Q data are tapped
out before the demodulator stage. So, the simulation set-up has so far included every block of the
receiver hardware. In practical scenario, after this stage the data are extracted out if the hardware
and subjected to processing procedure in MATLAB before performing the actual fitting. As the
simulation data at this stage looks similar to the practical data, the data processing script is also
included into the MATLAB environment.
The remaining part of this section discusses how every model was designed in the simulation
environment:
Addition of IF After the received signal is down-converted by the local mixer circuit, the carrier
is removed.The signal proceeds to the other blocks in the receiver chain with a the IF frequency
of 1MHz. In the simulation environment the IF frequency is added to the complex signal by using
the following code-line in MATLAB.
1 x = x .\ times exp (2\ timespi \ times1i .\ timest / p . ovs_fac ) ;
Listing 4.1: Addition of Intermediate Frequency
Phase Noise Phase noise causes random variations in the phase of the received signal. This
is usually caused due to the jitters in the local oscillators in chips. In order to replicate the
phase noise caused by the local oscillator of the Dialog’s currently used chip 680, the symmetric
power spectral density representation of the chip is imported. A noise signal with variance of
1dB is created with a random number generator function in MATLAB and is multiplied with
the Power Spectral Density (PSD) representation. This noisy spectrum generated in frequency
domain is converted back to time domain by performing an inverse Fourier transform. By using the
exponentiation function, the signal in time domain is converted into a complex phase modulated
Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging 37
CHAPTER 4. SYMMETRIC SINGLE CHANNEL APPROACH
signal. This signal is a representation of the phase noise behaviour of the chip. This complex
signal is directly multiplied with the complex signal arrived from the previous step to add phase
noise in to the signal.
Amplitude Mismatch and DC offset The signal is broken down into the real and imaginary
components in the hardware. These real and imaginary components are supposed to have the
same amplitude and be devoid of the DC component. But the incorrectness in the real hardware
makes the I and Q component to have different amplitudes. Due to leakage capacitance, there is
also a small DC offset added to the signals. The min-max values for amplitude mismatch and the
DC offset is hardware dependent and is collected from RF designers of the team. The amplitude
mismatch can vary between -2dB to +2dB. The DC offset is normalized to 1. The following
MATLAB command is used.
1 y (: ,1) = y (: ,1) ; % Real
2 y (: ,2) = y (: ,2) \ times dB2lin (0.1) ; % Imaginary dB2lin ( -2 -- 2)
3 % DC offset
4 y (: ,1) = y (: ,1) +(5/127) ;
5 y (: ,2) = y (: ,2) +(2/127) ; % - ve /+ ve
Listing 4.2: Addition of Amplitude mismatch and DC offset
where 0 y 0 is an array containing two columns. The I-component in first column and the Q-
component in the second column.
Channel filter The channel filter is defined first and the AGC settings are later added to it.
The filter is designed to be a third order filter containing two complex poles. It represents the
butter worth characteristics in the pass band with 600kHz bandwidth. The input to this filter
are the real and imaginary parts of the complex signal. It outputs the signal in same format but
delayed by 500ns, as shown in the Figure 4.6.
Figure 4.6: Output of the channel filter showing input I-Q signals and delayed I-Q signals
The impulse response of the filter for individual AGC settings are simulated in a different
38 Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging
CHAPTER 4. SYMMETRIC SINGLE CHANNEL APPROACH
simulation environment called Cadence1 and are imported into MATLAB. The channel filter has
two branches, the real and imaginary as shown in the Figure 4.7. In order to model the filter’s
impulse response, four observations has to be made. They are hii (the input for the filter is I
and the output observed is also I), hiq (input is I, and the putput observed is Q), hqi (the input
is Q and the output observed is also Q) and hqq where the input and the observed output are
Q component. This observation is made for all the ten different settings of AGC. This output
response is sampled at 128MHz (at every 8ns, approx) to give data points in excel sheets that can
be imported into the simulation environment in MATLAB. The modelling of the transfer function
and incorporating it into the filter was done by the experts in the team. A band pass filter is used
to filter the delayed I and Q signals with the above formulated filter response for the particular
gain setting.
The signal at this stage represents closely the signal obtained from the hardware. Hence. the
signal is subjected to a processing script is used to remove the IF component, perform correlation
to find the starting sample of the signal. After this stage, the complex phase signal is subjected
to a LMS fitting with the Ideal Signal.
4.3.2 Results
One of primary aims for setting this environment up was to observe the change in ToF of the
signal for different AGC settings. In this new simulation environment the iteration is performed
for 1000 times, simulating 1000 BLE transmissions. For, every 100 iteration, the AGC setting is
altered and the ToF is noted down for each case. A plot of ToF over different AGC setting is
shown in the Figure 4.8
From the Figure 4.8, it can be observed that time delay of the signal is indeed affected by
different AGC settings. This experiment was repeated for different simulated ranges and different
bit patterns and it can be seen that there is fixed offset added by AGC setting in all the cases.
This means that a AGC compensation table can be created to compensate for the additional time
delay added. The plot in the Figure 4.8 from the simulation environment closely aligns to that
of the similar observations made in the practical, but not completely. The primary reason for
the difference could be the limited number of parameters modelled in the situation compared to
the practical case. Due to limited time period and complexity of work, this will be carried out
as a future work to include and more practical parameters into the simulation. Also, there were
rounding errors in the excel files that occur for the high AGC settings (low gain settings). This is
because the input signal level was always at the same and limited level such that the output signal
1 https://www.cadence.com/
Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging 39
CHAPTER 4. SYMMETRIC SINGLE CHANNEL APPROACH
did not clip on the supply for the highest gain setting. Since the lowest gain setting is around
60 dB lower (a million times), the limited number of decimal places in the text files showed some
round-off errors for these settings. Due to the above mentioned factors, the simulation results did
not align with practical results but the main purpose of visualizing the change in ToF for different
AGC settings is fulfilled.
After performing AGC compensation, the output results look as shown in the Figure 4.9[6]
below. It can be observed from the figure that the estimated distances lie on a straight line with
a slope of 1. While analysing the results, we don not look into absolute value because there are
several factors that might induce a More details on the practical set-up to obtain this result can
be found in [6].
40 Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging
CHAPTER 4. SYMMETRIC SINGLE CHANNEL APPROACH
4.4 Inference
This approach is not as attractive as the previous asymmtric approach, as it requires Dialog-Dialog
propritary solution for working. But, in this approach we were able to cancel the clock offset’s
effect due to the very small measurement interval of 150µs. With this Symmetric Single Channel
Approach, we were able to estimate distance with an accuracy of < 2m. From the experiments,
we can also observe that when the time interval between the packets is smaller, the accuracy of
range estimation is better.
Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging 41
Chapter 5
This chapter discusses the Asymmetric Multiple Channel Algorithm in detail starting with the
working of algorithm, implementation in simulation environment, simulation results, practical
results and finally concludes with the inferences that we could draw from them.
5.1 Overview
This algorithm estimates ToF based on the phase differential method. The phase of the signals at
two different frequencies are obtained and the difference between the phases is used to calculate
the distance. As this algorithm involves signals from two different frequencies, it called as the
"Multiple channel method". In this algorithm, Dialog device will act as a Master device/scanner
and any BLE device can act as a peripheral device/advertiser. As this algorithm involves Dialog’s
BLE device at only one end, this algorithm is asymmetric. The advertiser device will send the ADV
packets in all three ADV channels with the constant time gap between its ADV transmissions.
The scanner listens to all the three channels continuously for any incoming connection request.
According to the definition of BLE protocol, a device acting as scanner will close/shut its reception
upon receiving the first ADV packet from one of the three channels. But in order to realize this
approach, the ADV sent from at least two of the channels is needed. This requires a patched BLE
stack running at the local Dialog end (scanner) that would allow the device to capture the first
ADV packet, store it and still keep listening to the other ADV packets too. The Figure 5.1 shows
the working of this algorithm.
As stated in Figure 5.1, this approach involves collecting the phase measurement data at two
different carrier frequencies in a very short time interval. The range is estimated by finding the
difference between the two carriers. This algorithm was inspired by [52].
The phase of the signal 2 varies from the signal 1 in the following aspects:
• The transmitter and receiver do not have synchronized clocks. So, the received phase due to
the difference in their clock grows over time before they get synchronized at the LCM of the
respective clocks and the same repeats. This clock offset leads to the frequency offset between
the transmitter and the receiver. As the product of frequency offset and time grows linearly,
phase change grows over time. If signal 1 has a phase ϕ1 and the signal 2 has phase ϕ2 , the
phase of the signal 2 will be offset by the amount ∆ϕ = ∆f ×time_between_measurements.
42 Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging
CHAPTER 5. ASYMMETRIC MULTIPLE CHANNEL APPROACH
This value of phase offset ∆ϕ, is added to signal 2 generated. This is indicated in the
illustration Figure 5.1 by a line that linearly ramps up between the two phase signals.
• Signal 2 is at a different carrier frequency which is offset from the frequency of Signal 1 by an
amount fh which the frequency separation between the two carriers. Similar to the previous
case, the phase of the signal 2 is also stepped up by this factor which is also added to the
phase of the signal 2. This is indicated by the small purple line at the carrier fc2 in the
Figure 5.1.
As stated in the Section 3.1, the phase of the received signal at carrier fc1 and fc2 will be as
follows:
!
r r
ϕR1 = ∆f × t + 2π(∆f + fc1 ) × + k.ϕT t − +ϕ (5.1)
c c
!
r r
ϕR2 = ∆f × t + 2π(∆f + fc2 ) × + k.ϕT t − +ϕ (5.2)
c c
where the term, fc2 can be represented as fbase + i × fh . fbase in our case will be 2.4GHz and
k × fh is the difference between the two frequencies in Hertz. This term is called the frequency
hub.
2π(∆f + fc2 ) × rc is the term that is used to extract the range in this approach. This term
causes a small step in the signal at carrier fc2
∆f × t is a term that is caused by the clock offset in between the transmitter and the receiver.
The start phase of the signal at the second carrier will not be same as that of the first carrier.
Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging 43
CHAPTER 5. ASYMMETRIC MULTIPLE CHANNEL APPROACH
This is because the clocks of the transmitter and the receiver will grow apart causing the phase
to grow to an amount equal to ∆f × t. This term has to be compensated to estimate the range.
As we deal with absolute phase values in this approach, the accuracy with which this term gets
cancelled plays an important role in calculating the range with good accuracy. If ∆f × t is not
cancelled out entirely or if it is overly cancelled from the phase of the signal 2, this will affect
the ∆ϕ, the phase difference between the signals that is used to calculate the range. So, a very
efficient ways to cancel this term is crucial in this approach.
k.ϕT t− rc +ϕ is the constant in both the carriers. In this approach, the data bits used for the
signal generation in both the carrier frequencies are the same. Hence, the term representing the
GFSK modulation will be a constant. As ϕ denotes the phase offset induced by the transmitter, it
is also a constant for both the carriers. These two parameters cause the shape of the phase signal
at the two given carrier frequencies.
In this phase differential method, the phase obtained from the carriers are subtracted from one
another to estimate the range after the effect of ∆f × t is compensated. The phase difference ∆ϕ
can be given as,
∆ϕ = ϕR2 − ϕR1 (5.3)
r
∆ϕ = 2π(∆f + kfh ) × (5.4)
c
Maximum range can be measured when the ∆ϕ is 2π. As the range here is inversely propor-
tional to the terms kfh (the frequency separation between the carriers), smaller the frequency
separation between the carriers, larger the maximum range. For the BLE protocol, the ADV
channels are 2402 MHz (channel 37), 2426MHz (channel 37) and 2480MHz (channel 37). The
frequency spacing between any pairs of ADV channels taken out of available three ADV channels
is different, so the maximum measurable range varies based on which pair of ADV channel is used.
The minimum frequency separation among three possible pairs occurs between channel 37 and
channel 38 (24 MHz). The maximum range corresponding to this frequency separation will be
≈ 12.5m. The maximum range that can be obtained by using channel 38 and 39 will be ≈ 5.53m
and with channel 37 and 39, the maximum range obtained will be ≈ 4m.
The simulation environment to realize this approach is set-up in MATLAB. Three signals needed
for this approach are as follows:
All these signals can be modelled using in equations 5.1 and 5.2. As the first step of the
simulation process, the ideal signal and the noisy signals at two different frequencies are generated.
44 Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging
CHAPTER 5. ASYMMETRIC MULTIPLE CHANNEL APPROACH
The ideal signal is generated by performing the GFSK modulation on the BLE device’s address
bits. This signal is an ideal signal which does not contain any real-life influences like noise,
influences due to clock offset, Modulation index offset etc. The other two signals are generated
to appear very close to the real-time signals and hence contains the following RF impairments:
Additive White Gaussian Noise (AWGN), frequency offset obtained as the result of clock offset,
unknown phase offset due to the free space travel and ToF of the signal. Except the frequency
offset, the other impairments will be the same in both signals as they are hardware dependent. As
these parameters have the same effect on phase of both the signals, on taking a difference between
the phases of two signals their effect will be cancelled as shown in 5.4.
5.2.2 Estimation
In order to estimate range, it is necessary to compensate for the effect of clock offset in the signal
2 at carrier fc2 . After this, the phase difference is used to estimate the range.
Frequency offset: A simple and novel method of frequency offset estimation is adopted in
this algorithm, which is a simple subtraction on the phase data from the signal 1 and the ideal
signal. With this approach, we try to eliminate the necessity of fitting to estimate the parameters.
The ideal signal and signal 1 are the generated from the GFSK modulation from the same address
bits so that phase variation pattern in both the signals remains the same. But, the signal 1 has
phase offset and frequency offset in its phase, which upon removal is expected to look exactly
similar to that of the ideal signal. Once the phase offset is estimated and compensated in the
Signal 1, the difference in phase between the ideal signal and the Signal 1, divided by the exact
time slice gives the frequency offset according to 5.6
∆ϕ
∆f = (5.6)
time
Initially, in the simulation, the frequency offset is estimated only considering the first and last
samples of the ideal signal and the signal 1. This is done because by observing the phase of the
last sample compared to the first sample and by knowing the exact time interval between them,
the frequency offset is estimated. Without the frequency offset in signal 1, this signal’s last sample
should have had the same phase with as of the ideal signal’s last sample. So, we find the difference
in phase of the last samples between the ideal and signal 1, and divide the difference by their
exact sampling time to obtain the frequency offset. But this estimation was severely affected by
the presence of noise. Since the whole estimation of frequency offset is estimated with one single
sample of the the entire 48 symbols, the resistance against the SNR was expected to improve when
the frequency offset is calculated over the entire 384 samples (48 bits that are oversampled by a
factor of 8) and taking the mean of it. With SNR set to be 40dB, the frequency estimation is done
in different methods and the results obtained are shown in the Table 5.1.
From Table 5.1, it can be seen that the results contradict to our expectation that taking an
average over the entire sample set would reduce the effect of SNR. This contradiction is due to a
simple mathematical reason. Assume that the SNR affects all the samples equally. Hence, let us
assume that the phase of all the samples is varied to the same extent due to the presence of noise.
In our method, the frequency offset estimation is observed as the difference of every sample of ideal
signal and signal 1 over their respective time slices. For the initial few hundred of samples, the
time is so small, so the division gives a larger value (larger error in estimation) than the estimation
done at the larger time. This effect can be observed from Figure 5.2.
It can be clearly observed from the Figure 5.2 that the frequency offset estimation at smaller
time slices is very badly affected. The estimation of the frequency offset gets stabilized after 200
samples. This explains the results from Figure 5.1. So, the only way to improve the accuracy of
frequency offset estimation and minimize the effect of noise is to take measurements over a longer
Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging 45
CHAPTER 5. ASYMMETRIC MULTIPLE CHANNEL APPROACH
Cumulative average
5811.975 156.181 2.414 1.162
on all samples
Cumulative average on
5920.614 61.0134 1.595 0.457
200-400 samples
Figure 5.2: Effect of noise on every sample for frequency offset estimations
period of time i.e instead of using only the known 48 bits, the estimation can be made of the
entire BLE packet received. In order to increase the number of similar bits in both the signals,
the preamble and the address bits are also considered for estimating the frequency offset.
Another way of estimating the frequency offset is by using the LMS fitting as used in the
46 Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging
CHAPTER 5. ASYMMETRIC MULTIPLE CHANNEL APPROACH
previous algorithms. Though this method is computationally more intensive than the currently
adopted method, it can be experimentally observed that for the same amount of noise present
in the signals, LMS fitting yields much better results than the difference method with a longer
sample of the signal (preamble, access address, and the 48-bit device address). When the SNR of
45dB is given to the signal, fitting is able to estimate frequency offset with an accuracy of 50-60
Hz spread whereas the difference method gives a spread of ≈ 100Hz for simulated BLE signals.
As in this algorithm, frequency offset estimate plays a prime role in accuracy of range estimation,
accuracy is traded off with the computational overhead and so, fitting is used to estimate the
frequency offset from Signal 1.
Range With the frequency offset estimated accurately by using LMS fitting and the exact time
interval between the measurement of two carriers is known, the amount of phase offset caused in
signal 2 due to the clock drift between the transmitter and receiver is calculated. This value is
then subtracted from signal 2. Now, the difference between signal 1 and signal 2 only contains the
∆ϕ brought out by the term (fh + ∆f ) × rc , containing the range information, and the rest of the
term from 5.1 are cancelled out. This difference in phase 1 and phase 2 is implemented in 5.1 and
the range is obtained. This range estimation does not require the phase offset to be compensated
because it remains the same in both the signals and hence the subtraction of phases would cancel
them off.
5.2.3 Results
RF Impairments:
Frequency Offset- 6 kHz
Phase Offset- 30 degree
SNR- 30
Modulation Index- 0.51
Range- 10m
The frequency offset estimation is done with the help of LMS fitting. Then, the estimated range
is calculated with the above-said methods. The histogram for range estimation and the frequency
offset estimation are shown in Figure 5.4 and Figure 5.3 respectively. From the results, we can
see that the standard deviation of frequency offset estimation is only ≈ 35Hz and the mean is
6.2kHz. The range estimation has its mean at 10.1m and has a very small spread of 0.6m.
The experiment is repeated for different ranges from 5 to 15m and for different frequency offset
estimation varying from 500Hz to 10KHz for SNR of 30dB and above. We observe that the fitting
estimates frequency offset of ≈500Hz (when the noise is 30dB and the frequency offset 8kHz)
and the range is estimated with an accuracy of < 1m. When the SNR is 20, the spread in the
range estimation becomes ≈4m and for a SNR of 10dB, the simulation gives a very large spread
of ≈ 10m. So, we can conclude from the simulation environments that when SNR is 30dB (which
is the normal signal conditions), we can achieve an accuracy of < 1m.
Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging 47
CHAPTER 5. ASYMMETRIC MULTIPLE CHANNEL APPROACH
During the time interval of measurement between the ADV1 from channel 1 and ADV2 from
channel 2, the phase wrapping occurs at the oscillator. This phase wrapping also causes the
range to get wrapped. Hence, in order to obtain an unambiguous and unwrapped distance, an
unwrapping technique is needed. There are two ways of solving the unwrapping issue. They are
48 Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging
CHAPTER 5. ASYMMETRIC MULTIPLE CHANNEL APPROACH
• CRT (Chinese Remainder Theorem), one of the most commonly used methods
• Fusion techniques, generally using RSSI.
"When the moduli of a system of linear congruences are pairwise relatively prime, there is a
unique solution of the system modulo the product of the moduli" [45].
When the frequencies of operation are pairwise co-prime, the CRT can be used to obtain the
exact unwrapped distance estimation from the wrapped distance measurement. The distance is
solved by converting the whole phase ambiguity problem as a set of linear Diophantine equations
which can later be solved using the CRT, provided that the LCM of the moduli (of frequencies) is
large enough to solve the ambiguity. Though this method might be one of the most sought after
method for solving the phase wrapping issue, this cannot be suitable for this approach for the
following reasons:
• One of the prime conditions for the CRT is that carriers need to be co-prime. But in our
case, the ADV channels, 2402MHz, 2426MHz and 2480MHz are not mutually co-prime.
• This algorithm is highly susceptible to channel noise [45].
RSSI (Received Signal Strength Indicator) As RSSI is available as a free data in the
hardware and that Dialog chips have a very good estimate of RSSI with good accuracy, it is
wise to use the RSSI data available from hardware in fusion with the existing techniques to
achieve better accuracy. Though RSSI is generally known to be inaccurate, we use RSSI to resolve
range ambiguity. The different maximum ranges can be 12.5m, 5.5m and 3.8m depending on the
combination ADV channels selected. Setting an aim to resolve the largest maximum range of
12.5m, RSSI should be able to resolve ambiguity between 1m, 12.5m and 25m.
From the practical measurements obtained earlier, there were RSSI values extracted for every
distance estimation. The mean values obtained from the estimation is plotted to observe if the
RSSI values follow the log-normal model. The graphs obtained are shown in the Figures 5.5 and
5.6.
From the Figures 5.5 and 5.6 , it is pretty visible that the RSSI values (in LOS) follow log
normal shadowing model and be later infused with our phase measurements to improve accuracy.
Before implementing the RSSI into the range estimation algorithm to resolve phase wrapping (and
in turn, range wrapping), it is necessary to verify if the practical RSSI data from the hardware is
able to resolve 12.5m. So, the RSSI data in LOS conditions where taken from the hardware by
[6]. Log-normal shadowing model [65] is used to represent the RSSI as a function of distance. The
equation to represent this is,
RSSI = −10n × log10 (d) + A (5.7)
where
A is the received signal strength at a known distance of 1m,
d is the distance (in m) between the transmitter and the receiver,
n is the path loss exponent.
The above equation was implemented in MATLAB and the distance vs. RSSI estimate looks
as follows:
From the Figure 5.7, it can be seen that the graph is almost linear within the range of < 10m.
The estimations become much spread out for distances larger than 10m. So, this RSSI methods
Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging 49
CHAPTER 5. ASYMMETRIC MULTIPLE CHANNEL APPROACH
when used in practice can resolve phase ambiguity up to 15m when using channels 38, 39 or channel
39, 37 as their maximum range will be 5.5m and 3.8m respectively. More sophisticated estimations
are needed for range estimation with RSSI. Considering the time bound and on observing the initial
practical results, more time was not spent on RSSI.
50 Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging
CHAPTER 5. ASYMMETRIC MULTIPLE CHANNEL APPROACH
Figure 5.7: Distance Estimation using RSSI data obtained from Outdoor Field Measurements
The practical set-up with patched BLE set-up was made by [6] to collect the data from two different
channels out of the hardware. The simulation set-up was also simultaneously modified to accept the
hardware data. The time interval between the measurements was 1.5ms Five indoor measurements
and eight outdoor measurements were taken. The results for one set of measurements is shown in
the Table 5.2. On observing the values from the table, it can be seen that the estimated values
do not change with change in the actual distance. Also, these measurements are inconsistent at
different environments. For same hardware used, indoor measurement gave completely different
frequency offset estimations and range estimations.
One possible reason for this cause would be the inaccurate frequency offset estimation. To
verify, we looked at the individual phases of the signals and observed phase difference between
them. According to the theory, the phase of the signal at second carrier should be ramped by a
factor of ∆f × t. So, the phase difference graph should have a mean centred around the value that
equal to the sum of ∆f × t and the range containing term. But, the practical results taken at 5m
look as shown in the Figure 5.8 and Figure 5.9.
When the frequency offset 6000Hz and the time interval between the packets is 1.5ms, the
phase should have ramped to ≈ 9cycles. In addition, every 1m corresponds to constant step of
0.18 cycles. Considering a range of 5m, the phase change caused by this range is 0.9 cycles. So,
we expect to see an average of ≈ 9 − 10cycles phase difference between the two signals. is But
from the Figure 5.9, it can be clearly observed that phase difference between all the samples is
close to 0.2cycles which is very less compared to theoretical vale of 10 cycles. We can understand
from the graph, two possible reasons:
1. The information containing the frequency offset and range is lost or unreadable from the
signal.
2. The phase wrapping has occurred during the time interval between two packets.
Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging 51
CHAPTER 5. ASYMMETRIC MULTIPLE CHANNEL APPROACH
Estimated
Range (in m) Estimated Frequency Offset
Range (in m)
5 11.21 975.2
10 9.92 756.41
15 10.04 778.90
Figure 5.8: Phase difference between two Figure 5.9: Phase difference between all 384
packets for 1000 transmissions samples of two packets (one transmission)
If the latter was true, the phase difference should at least contain the difference caused due
to the range containing term (0.9 cycles). Further, the validity of the first reason can also be
confirmed by observing the Figure 5.8, we can observe that this phase difference value of 0.2
cycles obtained for one packet is constant throughout all the packet transmissions. The phase
difference between the packets could be any value between a cycle. This means, we look at some
arbitrary value out of the hardware. But, we can see from 5.9 that the spread in the phase
difference over all the samples in one packet is only 0.2 cycles maximum which implies the phase
values are not affected by noise and the accuracy is good.
The possibility for this unexpected behaviour might be due to any wrong assumptions made at
the beginning of the modelling. Going back to the main equation 5.1, we found that there was an
assumption made about the ϕ parameter. We assumed that this term was a transmitter induced
term that is constant for a particular hardware. After discussing with RF experts in the team, it
was found that this term induced by the Phase Locked Loop (PLL) of the hardware is different
for different frequencies. The PLL used in the Dialog’s BLE chips are fractional PLLs. These
PLL can have n- possible phase for a particular carrier frequency. These PLLs, being analog PLLs
do not preserve or store the phase at one channel (say fc1 ) while switching to another channel
52 Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging
CHAPTER 5. ASYMMETRIC MULTIPLE CHANNEL APPROACH
(say fc2 ) or while jumping back again to the same channel (say fc1 ). As there are ’n’ possible for
values for every channel, starting phase of the signal could be anywhere between 0 to 1 cycles.ϕ
was assumed to be a constant term that will get cancelled during phase subtraction but it appears
that ϕ causes additional random phase offset to the signals.This problem happens in Transmitter
as well as the receiver. This explains why the signals are spread throughout a cycle in the Figure
5.8.
The problem with ϕ is hardware induced. If the hardware cannot preserve the phase while
jumping in between the two different carrier frequencies, there is not much that can be done with
algorithm or the software.
5.5 Inferences
From all the above discussions and conclusions, we can conclude that this multiple channel ap-
proach, though successful in the simulation, failed in the practical testing due to the problems in
the hardware. As this problem was a new finding for the PLL design expert themselves, this was
written down as improvement for next generation PLL design.
Assuming the next generation chips will be devoid of the ϕP LL problem, a quick calculation
has been made to estimate the accuracy of this algorithm. The fitting can estimate the frequency
offset with a standard deviation of 500Hz. This means there is a possibility of 500Hz of error that
can be present in frequency offset estimation. If the time interval between two transmissions is
800µs, the additional phase added to the phase difference term will be 0.4 cycles as ∆ϕ is equal
to ∆f × t. This 0.4 cycles of error in phase difference causes a range error of 5m, according to
fec
∆r ≈ × ∆t × c (5.8)
fh
when the fh is 24MHz. When the same spread in ∆f estimation is 500Hz (fec ) for a time interval
of 800µs is applied to Asymmetric single channel approach, the range equation becomes,
fec
∆r ≈ × ∆t × c (5.9)
fc
In this case, a spread in ∆f estimation is 500Hz, would cause a range error of only 0.05m. This
shows that multiple frequency approach is more vulnerable to the accuracy of frequency offset
estimation and in turn, the gives poorer accuracy in range estimation compared to the Asymmetric
Single Channel Approach. The accuracy of the Asymmetric multiple Channel approach can be
improved further by minimising the time interval of 800µs to much smaller value.
Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging 53
Chapter 6
6.1 Conclusions
In this thesis work, three different algorithms were designed to estimate the Time of Flight (ToF)
in the phase domain. In MATLAB, the simulation set-up was created for the BLE communication
medium (Transmitted and received signal). The algorithms were also developed in MATLAB
and tested over the simulated transmitted and received signals. Based on the initial results,
the algorithm was improved and later tested over the practical data. Different inferences and
conclusions can be drawn from each of the algorithms individually as follows.
The Asymmetric Single Channel approach was a very attractive user-case because it will let
the Dialog’s BLE chip to be used in combination with any BLE devices to estimate distance. In
simulation environment the range accuracy obtained was 1m. But in practice, due to the limitation
of the BLE stack protocol that will allow only a minimum of <1.5ms between the adjacent packet
transmissions, the clock offset between the devices was not successfully compensated. This makes
the algorithm not suitable for practical implementations, at the moment. When the issue is solved,
we hope to acheive a range estimation accuracy of < 2m.
The Symmetric Single Channel Approach was not a very attractive use case compared to the
previous algorithm as this requires a proprietary Dialog-Dialog set-up for range estimation. But,
in this algorithm the clock offset was efficiently cancelled off and a range accuracy of <2m was
obtained.
The last algorithm developed was the Asymmetric Multiple Channel approach. This algorithm
uses the phase obtained from multiple channels to estimate the range. The simulation results gave
an accuracy 1m. But the practical implementation of this algorithm was limited by the presence
of analog fractional PLL in the Dialog’s BLE chip that introduces random phase offsets into
the signal. Hence, a phase preserving PLL is needed for the realization of this approach. This
improvement is taken into consideration for the next generation PLL of Dialog. An estimation to
find the accuracy in case of having phase preserving PLLs, yields an estimate of <5m accuracy.
This accuracy can further be improved by decreasing the time interval between the successive
ADV transmissions. From the mathematical model developed for all the algorithms, we can see
that Asymmetric Single Channel Approach performs better than the multiple channel approach
under similar conditions.
54 Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging
CHAPTER 6. CONCLUSIONS AND FUTURE WORK
Due to the time bounds and challenges involved in developing the algorithms, there was not enough
time to do the following tasks in each algorithm, which will be continued as future works.
• More research has to be done to know why the clock compensation did not align with the
Time of Flight estimation. This will enable to track the clocks more accurately and in turn
enable better clock compensation.
• More observations on breathing effect of the crystal’s clock, its effects on Time of Flight
estimation.
• Improvements or modifications in the BLE stack to reduce the time interval between the
successive ADV transmissions
• Implementation of developed Symmetric Single Channel Approach into the Dialog’s 680 chip.
• With the new hardware set-up containing the phase preserving PLLs, this algorithm has to
be tested again with practical data.
• Extensive testing on different environments and observing the time of flight results.
• Based on the results, the next step would be either an improvement in simulation (in case
of poor results) or implementation in the hardware (in case of good results)
Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging 55
Bibliography
[3] D. Vasisht, S. Kumar, and D. Katabi, “Sub-nanosecond time of flight on commercial wi-fi
cards,” arXiv preprint arXiv:1505.03446, 2015. viivii, 11, 13
[4] B. SIG, “Bluetooth specification version 4.2-master table of contents & compliance require-
ments,” tech. rep., Tech. Rep, Dec 2014. viivii, 17
[5] D. Semiconductor, “Da14680 objective specification,” 2016. Den Bosch: Dialog Semicon-
ductor. viivii, 20
[6] Y. He, “Experimental setup for bluetooth low energy ranging solutions,” Dialog Semiconduct-
ors, 2016. viivii, viiiviii, viiiviii, viiiviii, 29, 30, 31, 32, 34, 35, 36, 40, 41, 49, 51
[7] M. G. Wing, A. Eklund, and L. D. Kellogg, “Consumer-grade global positioning system (gps)
accuracy and reliability,” Journal of forestry, vol. 103, no. 4, pp. 169–173, 2005. 1
[10] S. Karnouskos, “Cyber-physical systems in the smartgrid,” in 2011 9th IEEE International
Conference on Industrial Informatics, pp. 20–23, IEEE, 2011. 1
[11] B. Dr. David Chieng, Wireless Innovation Lab MIMOS, “Iot and indoor localization,” (Aspen,
Colorado), 2016. ASEAN RISE conference, Hanoi. 2
[14] M. Andersson, “Use case possibilities with bluetooth low energy in iot applications,” White
Paper, 2014. 2
[15] M. Watch, “Bluetooth low energy (ble) enabled devices shipments to reach 8.4 billion units
by 2020 - industryarc analysis,” 2016. http://www.marketwatch.com/story/bluetooth-
low-energy-ble-enabled-devices-shipments-to-reach-84-billion-units-by-2020—industryarc-
analysis-2016-03-03-11203059. 2
Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging 57
BIBLIOGRAPHY
[20] J. Hightower and G. Borriello, “A survey and taxonomy of location systems for ubiquitous
computing,” IEEE computer, vol. 34, no. 8, pp. 57–66, 2001. 6
[21] H. Liu, H. Darabi, P. Banerjee, and J. Liu, “Survey of wireless indoor positioning techniques
and systems,” IEEE Transactions on Systems, Man, and Cybernetics, Part C (Applications
and Reviews), vol. 37, no. 6, pp. 1067–1080, 2007. 6, 9
[22] F. Seco, A. Jimenez, C. Prieto, J. Roa, and K. Koutsou, “A survey of mathematical methods
for indoor localization,” Intelligent Signal Processing, pp. 9–14, 2009. 6
[23] R. Mautz, “The challenges of indoor environments and specification on some alternative po-
sitioning systems,” in Positioning, Navigation and Communication, 2009. WPNC 2009. 6th
Workshop on, pp. 29–36, IEEE, 2009. 6
[24] A. Bensky, Wireless positioning technologies and applications. Artech House, 2016. 6
[25] Mathuranathan, “Friis free space propagation model,” September 2013. [Online; accessed
19-July-2016]. 8
[26] Wikipedia, “Two-ray ground-reflection model,” July 2016. [Online; accessed 29-July-2016]. 8
[28] D. Rejane, V. Thierry, and B. Adrien Van Den, “Comparison of indoor localization systems
based on wireless communications,” Wireless Engineering and Technology, vol. 2011, 2011. 8
[31] M. Estel and L. Fischer, “Feasibility of bluetooth ibeacons for indoor localization,” 9
[32] Q. Dong and W. Dargie, “Evaluation of the reliability of rssi for indoor localization,” in
Wireless Communications in Unusual and Confined Areas (ICWCUCA), 2012 International
Conference on, pp. 1–6, IEEE, 2012. 9
[34] A. S. Paul and E. A. Wan, “Rssi-based indoor localization and tracking using sigma-point
kalman smoothers,” IEEE Journal of Selected Topics in Signal Processing, vol. 3, no. 5,
pp. 860–873, 2009. 9
58 Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging
BIBLIOGRAPHY
[35] J. Zhou, K.-K. Chu, and J.-Y. Ng, “Providing location services within a radio cellular network
using ellipse propagation model,” in 19th International Conference on Advanced Information
Networking and Applications (AINA’05) Volume 1 (AINA papers), vol. 1, pp. 559–564, IEEE,
2005. 9
[36] A. Teuber, B. Eissfeller, and T. Pany, “A two-stage fuzzy logic approach for wireless lan indoor
positioning,” in Proc. IEEE/ION Position Location Navigat. Symp, vol. 4, pp. 730–738, 2006.
9
[37] M. Klepal, D. Pesch, et al., “Influence of predicted and measured fingerprint on the accuracy
of rssi-based indoor location systems,” in 2007 4th Workshop on Positioning, Navigation and
Communication, pp. 145–151, IEEE, 2007. 9
[38] E. Martin, O. Vinyals, G. Friedland, and R. Bajcsy, “Precise indoor localization using smart
phones,” in Proceedings of the 18th ACM international conference on Multimedia, pp. 787–
790, ACM, 2010. 9
[41] B. Wagner and D. Timmermann, “Classification of user positioning techniques and systems
for intelligent environments.,” in GI-Jahrestagung, pp. 537–548, 2012. 10
[42] B. D. Van Veen and K. M. Buckley, “Beamforming: A versatile approach to spatial filtering,”
IEEE assp magazine, vol. 5, no. 2, pp. 4–24, 1988. 10
[43] B. Ottersten, M. Viberg, P. Stoica, and A. Nehorai, “Exact and large sample maximum
likelihood techniques for parameter estimation and detection in array processing,” in Radar
array processing, pp. 99–151, Springer, 1993. 10
[44] M. Kotaru, K. Joshi, D. Bharadia, and S. Katti, “Spotfi: Decimeter level localization using
wifi,” in ACM SIGCOMM Computer Communication Review, vol. 45, pp. 269–282, ACM,
2015. 10
[45] W. Li, X. Wang, X. Wang, and B. Moran, “Distance estimation using wrapped phase meas-
urements in noise,” IEEE Transactions on Signal Processing, vol. 61, no. 7, pp. 1676–1688,
2013. 12, 14, 49
[46] C. Wang, Q. Yin, and H. Chen, “Robust chinese remainder theorem ranging method based on
dual-frequency measurements,” IEEE Transactions on Vehicular Technology, vol. 60, no. 8,
pp. 4094–4099, 2011. 12, 14
[48] Wikipedia, “Chinese remainder theorem — Wikipedia, the free encyclopedia,” 2016. [Online;
accessed 19-July-2016]. 13
[49] X. Li and X.-G. Xia, “A fast robust chinese remainder theorem based phase unwrapping
algorithm,” IEEE Signal Processing Letters, no. 15, pp. 665–668, 2008. 14
Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging 59
BIBLIOGRAPHY
[51] Y. Cheng, X. Wang, T. Caelli, and B. Moran, “Tracking and localizing moving targets in
the presence of phase measurement ambiguities,” IEEE Transactions on Signal Processing,
vol. 59, no. 8, pp. 3514–3525, 2011. 14
[52] M. Pelka, C. Bollmeyer, and H. Hellbrück, “Accurate radio distance estimation by phase meas-
urements with multiple frequencies,” in Indoor Positioning and Indoor Navigation (IPIN),
2014 International Conference on, pp. 142–151, IEEE, 2014. 14, 42
[53] R. J. Fontana and S. J. Gunderson, “Ultra-wideband precision asset location system,” in
Ultra Wideband Systems and Technologies, 2002. Digest of Papers. 2002 IEEE Conference
on, pp. 147–150, IEEE, 2002. 15
[54] S. Schwarzer, M. Vossiek, M. Pichler, and A. Stelzer, “Precise distance measurement with
ieee 802.15. 4 (zigbee) devices,” in 2008 IEEE Radio and Wireless Symposium, pp. 779–782,
IEEE, 2008. 15
[55] L. Schauer, F. Dorfmeister, and M. Maier, “Potentials and limitations of wifi-positioning
using time-of-flight,” in Indoor Positioning and Indoor Navigation (IPIN), 2013 International
Conference on, pp. 1–9, IEEE, 2013. 15
[56] S. Lanzisera, D. Zats, and K. S. Pister, “Radio frequency time-of-flight distance measurement
for low-cost wireless sensor localization,” IEEE Sensors Journal, vol. 11, no. 3, pp. 837–845,
2011. 15
[57] Y. Jiang and V. C. Leung, “An asymmetric double sided two-way ranging for crystal offset,”
in 2007 International Symposium on Signals, Systems and Electronics, pp. 525–528, IEEE,
2007. 15
[58] Y. Saigo, S.-i. Ko, J.-y. Takayama, and S. Ohyama, “Precise asynchronous rf tof measurement
based on two-way-ranging using heterogeneous clocks,” in SICE Annual Conference (SICE),
2012 Proceedings of, pp. 1437–1442, IEEE, 2012. 15
[59] A. I. Baba, “Calibrating time of flight in two way ranging,” in Mobile Ad-hoc and Sensor
Networks (MSN), 2011 Seventh International Conference on, pp. 393–397, IEEE, 2011. 15
[60] D. Wang, R. Kannan, L. Wei, and B. Tay, “Time of flight based two way ranging for real
time locating systems,” in 2010 IEEE Conference on Robotics, Automation and Mechatronics,
pp. 199–205, IEEE, 2010. 15
[61] A. Whitney, J. Parker, M. Engelhard, Z. Kratzer, and J. Fessler, “Rssi informed phase method
for distance calculations,” in 2015 IEEE International Conference on Advanced Intelligent
Mechatronics (AIM), pp. 1138–1142, IEEE, 2015. 16
[62] D. Macii, A. Colombo, P. Pivato, and D. Fontanelli, “A data fusion technique for wireless ran-
ging performance improvement,” IEEE Transactions on Instrumentation and Measurement,
vol. 62, no. 1, pp. 27–37, 2013. 16
[63] L. Oliveira, C. Di Franco, T. E. Abrudan, and L. Almeida, “Fusing time-of-flight and received
signal strength for adaptive radio-frequency ranging,” in Advanced Robotics (ICAR), 2013
16th International Conference on, pp. 1–6, IEEE, 2013. 16
60 Algorithms and Simulation set-up for realizing Bluetooth Low Energy based ranging