INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning...

45
A PROJECT REPORT ON INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) In partial fulfillment for the requirement of the degree of Master of Computer Science of Assam University, Silchar (Paper Code: MCS-1005) Submitted By: SONIA NAG M.Sc (5 years)-10 th sem Roll-101611 No-02220127 Registration No: 22-110021758 of 2011-2012 UNDER THE GUIDANCE OF Mr. Saptarshi Paul Assistant Professor DEPARTMENT OF COMPUTER SCIENCE SCHOOL OF PHYSICAL SCIENCE ASSAM UNIVERSITY SILCHAR PIN-788011

Transcript of INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning...

Page 1: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

A PROJECT REPORT

ON

INDOOR POSITIONING SYSTEM USING WIFI

(TRILATERATION METHOD)

In partial fulfillment for the requirement of the degree of

Master of Computer Science of Assam University, Silchar

(Paper Code: MCS-1005)

Submitted By:

SONIA NAG

M.Sc (5 years)-10th sem

Roll-101611 No-02220127

Registration No: 22-110021758 of 2011-2012

UNDER THE GUIDANCE OF

Mr. Saptarshi Paul

Assistant Professor

DEPARTMENT OF COMPUTER SCIENCE

SCHOOL OF PHYSICAL SCIENCE

ASSAM UNIVERSITY SILCHAR

PIN-788011

Page 2: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

CERTIFICATE

This is certify that SONIA NAG, the student of the Department of Computer

Science, Assam University, Silchar bearing the roll:101611 No:02220127 has

carried out her project work entitled “INDOOR POSITIONING SYSTEM USING

WIFI(TRILATERATION METHOD)” under my guidance for the partial fulfillment

of the course.

I wish her all the very best in near future.

Mr. Saptarshi Paul.

Assistant Professor

Computer Science Department,

ASSAM UNIVERSITY, SILCHAR

DEPARTMENT OF COMPUTER SCIENCE

SCHOOL OF PHYSICAL SCIENCES

ASSAM UNIVERSITY SCILHAR

A CENTRAL UNIVERSITY CONSTITUTED UNDER

ACT XIII OF 1989

ASSAM, INDIA, PIN - 788011

Page 3: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

DECLARATION

I, Sonia Nag, student of 10th semester (M.Sc. 5 years), Department of Computer

Science do hereby solemnly declare that I have duly worked on my project entitled

“Indoor positioning using Wi-Fi” under the supervision of Mr. Saptarshi Paul,

assistant Professor, Department of Computer Science, Assam University, Silchar.

This project work is submitted in the partial fulfillment of the requirements for the

award of degree of Master of Science in computer science. The result embodied in

this thesis have not been submitted to any other university for the award of any

degree or diploma.

Place: Assam University, Silchar

(Sonia Nag,10th sem)

Page 4: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

ACKNOWLEDGEMENT

It gives me immense pleasure to recollect the whole time and effort utilized in

making the project a grand success. First and foremost, I would like to thanks my

adored guide Mr. Saptarshi Paul, Assistant Professor, Department of Computer

Science, Assam University, Silchar, for his valuable time and for being always

supportive to my work under his guidance and giving me the freedom of thought

always.

I wish to express my deep sense of gratitude and indebtedness to Prof. Bipul Shyam

Purkayastha, Head, Department of Computer Science, Assam University, Silchar,

for providing me the opportunity to utilize the facilities of the Department of

Computer Science.

I am grateful to my parents, for their support, concern and help as and when required.

I thank all my friends and classmates for their support.

SONIA NAG

Roll-101611 No-02220127

M.Sc 10th semester

Department of computer science

Page 5: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

Content

Certificate………………………………………………………..i

Declaration………………………………………………………ii

Acknowledgement……………………………………………….iii

Abstract…………………………………………………………..iv

Chapter-1

Introduction……………………………………………………...1

Chapter-2

Wi-Fi technology………………………………………………...2

WLAN, Wi-Fi and IEEE 802.11…………………………2.1

Chapter-3

Objective………………………………………………………….3

Requirements……………………………………………3.1

Chapter-4

Problems and disruptive factors………………………………….4

Chapter-5

Measurement Theory…………………………………………….5

Page 6: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

Based on Proximity sensing………………………………5.1

Based on Trilateration…………………………………….5.2

Based on Triangulation……………………………………5.3

Based on Pattern recognition………………………….......5.4

Chapter-6

Methods and tools…………………………………………………6

Methods………………………………………………...6.1

Tools……………………………………………………6.2

Motivation………………………………………………6.3

Chapter-7

Advantages………………………………………………………7

Disadvantages……………………………………………7.1

Chapter-8

Trilateration positioning algorithm……………………………..8

Taylor series algorithm…………………………………..8.1

New distance based algorithm……………………………8.2

Chapter-9

Implementation ………………………………………………….9

Snapshots…………………………………………………9.1

Page 7: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

Chapter-10

Conclusion………………………………………………………..8

Future work………………………………………………8.1

References……………………………………….………8.2

Page 8: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

ABSTRACT

Wi-Fi positioning plays an increasingly important Role in improving performance

because good positioning can improve performance in indoor environments

without additional devices. It will make use of existing Wi-Fi infrastructure,

although this was never designed to do so.

Methods that were used for other positioning technologies can be adopted for Wi-

Fi. Whether or not these other methods work with Wi-Fi will be explained and

examined.

The increasing demand for location based services inside buildings has made

indoor positioning a significant research topic. This study deals with indoor

positioning using the Wireless Ethernet IEEE 802.11 (Wireless Fidelity, Wi-Fi)

standard that has a distinct advantage of low cost over other indoor wireless

technologies.

The aim of this study is to examine several aspects of location fingerprinting based

indoor positioning that affect positioning accuracy.

This paper also discusses the accuracy of the methods and the optimal area of

application.

Index Terms—Wi-Fi, WLAN, Positioning, Location, Position determination,

localization, Fingerprinting .

Page 9: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

Introduction

The increasing demand for location based services inside buildings has made

indoor positioning a significant research topic. The applications of indoor

positioning are many, for instance, indoor navigation for people or robots,

inventory tracking, locating patients in a hospital, guiding blind people, tracking

small children or elderly individuals, location based advertising, ambient

intelligence etc.

Although the Global Positioning System is the most popular outdoor positioning

system, its signals are easily blocked by most construction materials making it

useless for indoor positioning. This study deals with indoor positioning using the

Wireless Ethernet IEEE 802.11 (Wi-Fi) standard that has distinct advantage of low

cost over other indoor wireless technologies – it has relatively cheap equipment

and in many areas usually a Wi-Fi network already exists as a part of the

Communication infrastructure avoiding expensive and time-consuming

Infrastructure deployment.

Most of the proposed Wi-Fi indoor positioning systems use

either proximity detection via radio signal propagation models or location

fingerprinting techniques.

By using WiFi Positioning Systems it is possible to locate the position of almost

every WiFi compatible device without installing extra software or manipulating the

hardware. In the course of time many methods that were initially used with other

positioning technologies were applied to WiFi positioning. WiFi Positioning also

allows the use of location-based services (LBS) indoors, which is interesting for

the industry. Useful applications of this technology are, for example, for indoor

navigation at shopping malls or for finding a lost child in an indoor area. Lost

devices or items can also be found with this technology. Additionally, this

technology is especially interesting for hospitals because sometimes when staff

move certain pieces of equipment it can be hard to find them again straight away.

Page 10: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

WIFI TECHNOLOGY

WLAN, Wi-Fi and IEEE 802.11:

WLAN, WiFi and IEEE 802.11 all mean the same: they determine

the industrial standard for wireless data transmission. The latter is the most used

expression.

WiFi uses electromagnetic waves to transmit data over the airwaves. In figure 1 the

whole frequency spectrum is shown, starting with radio signals and ending with

gammarays. Looking at the illustration one can see that it operates

in broadband, on about 2,4 GHz and 5 GHz.10 Other longer distance technologies

also use frequencies in between these figures. The frequency is the number of wave

occurrences per unit of time.

In the best case, the radio waves spread out evenly and lose more and more of their

signal strength with increasing radius. This loss of signal strength is due to the

energy transformation because, in physics, energy is never lost, but instead

converted.

Consequently the amplitude of the signal becomes smaller and smaller. In an

outdoor station the radius ratio of distance to signal strength is inversely

proportional, because the decrease of the signal is log-normal.

In conclusion, if the distance to the station is increased in any direction, the signal

strength will decrease steadily. However, indoors we encounter a different

problem, because the waves bump into walls, windows, doors and so on. If a wave

bumps into a different material, it converts more energy than in the air. During this

process, the signal strength is decreased more strongly, because the energy is

transferred to the material (e.g.: in heat). Furthermore the

signal is also reflected from the material.

Page 11: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

Fig. 1 frequency overview - A Wifi wave matches into a baseball.

1.Fundamentals for Wifi measuring: the distance between the transmitter

and the receiver has an important role in determining the position. In contrast to

GPS, WiFi, at a time measurement method, does not come into question, since

such an exact time is difficult to achieve synchronization. Finally, the path from

space to the ground is much farther than from one access point to a mobile device.

The received signal strength (RSS) and the signal noise ratio (SNR) are the most

suitable. These values can be calculated from the incoming signal.

Page 12: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

2) Signal Strength: the signal strength is measured in dBm (decibel in

milliwatt). A Wifi station has a EIRP (Equivalent isotropically radiated power) of

100mW - 1000mW (20dBm - 30dBm).

This is how to calculate:

Lp(dBm) = 10 ∗ log p /1mW

For Example:

Lp(dBm) = 10 ∗ log100mW/1mW = 20dBm

A WiFi connection gives us information about signal strength and interference.

For example: signal strength: -52 dBm ( 0,00001 mW )

interference: -90 dBm

Because of the path loss, the signal becomes weaker and weaker the farther it is

away from its origin. Barriers may attenuate the signal (more about that later). The

property to the path loss can be used to determine the distance.

Page 13: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

Objective

Detail study of indoor positioning system using triangulation and trilateration

methods.

Requirements

At the end of the project the following requirements were to be satisfied:

The main requirement was a system that with reasonable reliability could

estimate the position of the user, in situations where GPS and similar

satellite-based positioning systems are unreliable or unavailable.

In this case an average error of approximately 3.5 meters was considered

reasonable,although the goal was to get a much better result.

A basic functional implementation of the positioning system was to be done

for the Android platform.

Apart from these requirements there were a couple of points that were not

requirements for the project to be considered successful, but which should be

considered a bonus:

Using existing infrastructure and hardware.

Cheap infrastructure and hardware.

Page 14: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

Problems and disruptive factors

In general, wireless radio transmission is subject to many confounding factors.

Even the sun or rain drops have an effect on the signal strength, actually even if

this disruptive factor is very low, it would still be measured. Another problem is

the electromagnetic radiation inside buildings. Additionally, many walls, doors and

floors have to be penetrated. The result of this is attenuation. An additional

problem is the wireless overlay. In an office or apartment building, there are

several dozen wireless stations that provide much interference.

1) Signal attenuation of static environment: usually hits an

electromagnetic wave on a wall or another barrier it passes through. However, the

wave becomes weaker, due to reflection that originates while striking the barrier.

Another part is absorbed and converted into heat, the factor of which is so

small that it would not be noticeable for a human. The size of the loss is related to

the material, specifically its thickness.

For example, glass has a higher attenuation effect than brick walls. These factors

are critical, especially with methods which determine a distance by the measuring

of the signal strength.

2) Signal attenuation by user: As we can see in the experiment, the presence

of a user changes the signal strength. This is especially important for the

Fingerprinting-based location method, because the mean values would be

influenced by the presence of a user. ”When the positioning system is supposed

to cater to real users, it is essential to have the user present while collecting the

RSS values for the fingerprint and to take into account the effect of the humans

body. As already mentioned, WiFi uses the frequencies of about 1,4 GHz, just

like microwaves. The effect that is used to heat up food with a microwave is a

disruptive effect with WiFi. This is because the radiation is partially absorbed by

the water in the human body and the signal is attenuated.

Page 15: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

MEASUREMENT THEORY

There are many different approaches for locating a mobile device using WiFi

technology. In the following, the method to estimate the sought position is

described. In general, the methods need to know the position of the WiFi stations

(=access points) as a reference point that are used for the approximate position of

the mobile device.7 A prerequisite for a good-working WiFi positioning system is

an adequate coverage of the access points. This coverage is called Basic

Service Area (BSA). The expression of the BSA determines which positioning

method is the most suitable. The methods differ in the minimum required number

of stations and its accuracy. This varies between building part accuracy and room

accuracy to an accuracy of a few meters difference.

A. Based on Proximity sensing: Methods based on proximity sensing are

among the simplestand fastest, but they are also imprecise. A position

calculationcan be done with just a single station. It is hardly possible,for example,

to perform an indoor positioning that delivers the right floors in a multi-storey

building. As result, one gets only the part of the building in which the mobile

device is located. On the other hand, this kind of positioning is popular

for outdoor positioning.

B. Based on Trilateration: Lateration or trilateration is the determination of

absoluteor relative locations of points by measurement of distances,using

geometry. The ”tri in trilateration reveals that at least three fixed points are

necessary to determine a position. The idea behind the geometry is that all

trilateration methods start with calculating the distance from a station to a

device. The distance then is used as the radius from the station. Somewhere on the

edge of the resulting circuit, the position of the device is assumed. To lessen the

possibilities, a second group of results is also used from the measurements of

another station. Of course the second station has to be in the range of

the device. With the radius of the second station one receives two

points. If one imagines this in a geometrical way, one keeps two circles and two

intersection points. One of the two points is the position of the devices. To find out

which point is the right point a third station is used. An illustration of this geometry

Page 16: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

can be seen in figure 2. In the following the methods of distance determination are

explained.

Fig. 2 Trilateration

1) Time of Arrival (ToA):

With this method time is measured,which needs a signal from a station to mobile

device and back again, and in this instance it is called the ”Round trip time (RTT).

A requirement for this method is synchronically

running clocks. According to which topology is used, only the clocks of the

stations or also the clocks of the mobile devices must run synchronically. With the

measured data of the station and the given speed of the signal, it can be calculated

how far away the mobile device is. Indeed, no time may pass with the receiving

and sending back of the signal because this would influence the measured data. As

this is not possible without modification in mobile devices, this method does not

function with WiFi.

• Positioning is based ontrilateration with measurements of time

• (-) At least three station in range of the device are necessary.

• (-) Position coordinates of station must be exact.

• (-) Does not work with Wifi.

2) Time Difference of Arrival (TDoA): Like ToA, TDoA also needs exact

clock synchronization. TDoA is more popular with commercial detection systems

than ToA. With this method, the difference is used between the arrival times of the

signals to determine the position. Because WiFi was never planned, nevertheless,

to make such exact time measurements, is also not possible to use TDoA on WiFi.

• Positioning is based ontrilateration with measurements of time difference

• (-) At least three station in range of the device are necessary.

Page 17: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

• (-) Position coordinates of station must be exact.

• (-) Does not work with Wifi.

3) Received Signal Strength (RSS): This method uses propagation-loss of

the WiFi signals to compute the distance. The decibel version of free space path

loss equation is 10 log( s/0.001 ) (s is the signal strength in watts). By using

these measurements, which distance matches which signal power can be found out.

This method functions relatively well outdoors, but in buildings it can come to

strong divergences, because the walls reflect and attenuate the WiFi signals. These

methods work with the WiFi technology and can be used for the localisation. One

can even use all three topologies with this method, however, software must be

modified with the routers network-based topology.

• Positioning is based on trilateration with measurements of signal strength

• (-) At least three stations in range of the device are necessary.

• (-) Position coordinates of station must be exact.

• (+) Does work with Wifi

• (+) Works well outdoors

• (-) Works indoors but doesnt deliver accurate values

• (+) supports all topologies

The method Signal to Noise Ratio (SNR) is neglected here because it usually

provides poorer results than RSS. Only the fact that it exists should be mentioned.

It works on the same principle, but instead of transmitting power, the measured

interference is used.

C. Based on Triangulation

1) Angle of Arrival - AoA: In this method, the angle of the arriving signals is

determined and, using geometry, the position can be determined. At least two

stations in reach of the mobile devices are a requirement for AoA. It is suitable for

indoor and outdoor positioning and it can measure in real time. The estimation of the

angle has an inaccuracy of only degrees.

AoA is not applicable without modification of the hardware, but it returns good

results. Special antennas are mandatory for the determination of the location with

the ”Angle of Arrival method.

Page 18: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

Fig. 3. A special directional Wifi antenna determine the position with AoA.

• Position determination with the intersection point of two lines.

• (-) needs hardware modifications / special antennas

• (+) allows Real-Time positioning

• (+) indoor + outdoor

• (-) only network-based

Comparison of Positioning Techniques-

Trilateration Triangulation • Estimates the position of an object by

measuring its

Distances from multiple reference

points.

• Estimates an object by computing

angles relative to multiple reference

points.

• The distance is computed by

multiplying the radio signal velocity

and the travel time.

• The object to be located is used as a

fixed point of a triangle.

• Usually TOA and TDOA used for

distance measuring.

• Usually AOA used for angle

measurement.

Page 19: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

D. Based on Pattern recognition

1) Fingerprint Positioning: Fingerprinting, also called Location Patterning,

uses a previously created database of signal patterns, which need to be matched for

positioning only. Fingerprinting doesnt need modification of the hardware like, for

example, AoA. Furthermore, no time synchronisation is necessary between the

stations. Before a position can be determined, the entire area in which the positioning

is supposed to work must be recorded. This happens in Phase 1, the so called

calibration-phase, offline-phase or training-phase: The area in which the positioning

should later run, must be covered with a pattern of recording points, called

fingerprints. Step by step, for every fingerprint there must be a measurement, that

includes the information about all stations and their Received Signal Strength (RSS).

Each fingerprint is a vector R , associated with each element of a station

The number of stations must be known and may be changed only if the measurement

is repeated from phase 1. The collected data is stored in a database, called a radio

map, so that it can be retrieved later in phase 2.

Page 20: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

Fingerprinting-based positioning algorithms

• probabilistic methods

• k-nearest neighbor

• neural networks

• support vector machine (SVM)

• smallest M-vertex polygon (SMP)

Fingerprinting-Based Positioning Methods

There are two approaches to estimate the user’s location based on the online RSS

measurements and the fingerprint database.The deterministic approach only uses

the average of the RSS time samples from each RP to estimate the location,

whereas the probabilistic approach incorporates all the RSS time samples for the

computation.

For the following section, assume the collected fingerprint database is denoted as a

set {(pi,ψi(1), . . . ,ψi(T))|i = 1, . . . ,N}, where pi is the Cartesian coordinates for

RP i, ψi(t) = [ψi;1(t), . . . , ψi;L(t)]T is the RSS readings vector for RP i at time t

with ψi;j(t) denoted as the RSS reading from AP j for RP i at time t. T is the total

number of collected time samples, N is the total number of RPs and L is the total

number of APs.

The online RSS measurement vector can be denoted as r = [r1, ...rL]T .

Page 21: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

Figure . Location fingerprinting technique

The Positioning Procedure

The procedure for fingerprint-based positioning using the proposed joint model is

as follows, where steps 1 to 4 are the off-line data training phase and steps 5 to 7

are the on-line positioning phase:

Step1: Choose the RPs, and then collect the RSSs from all APs at each RP.

Step2: Detect the gross errors and filter them out.

Step3: Use a global search procedure to find the two peaks and the minimum value

between the two peaks. The two times minimum is compared with the sum of the

two peaks to decide between using the Gaussian model or the alternative model.

This decision rule was created based on all the data collected.

Step4: Create the fingerprint database.

Step5: RSSs are collected by the user, outliers are removed. Calculate the

probability distribution of received RSSs.

Page 22: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

Step6: Use the fingerprint database to calculate the joint probability density for the

RSSs collected in the step 5.

Step7: Estimate the user’s location using the K weighted nearest neighbour

(KWNN) algorithm.

KWNN is a conventional algorithm used for fingerprint-based Wi-Fi positioning.

Using this algorithm, K (K ≥ 2) nearest neighbours (those with the shortest signal

distance) of a test vector are chosen. The weighted average of the co-ordinates of K

points can be used as the estimate of the user’s location. The inverse of the signal

distance defines the weight.

Page 23: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

K-Nearest Neighbour Method (KNN)

K-nearest neighbour is a deterministic method that involves calculating a weight

based on current measurements, and possibly other factors, for each fingerprint and

then selecting the k fingerprints with the best weight, where k is pre-defined a

constant often set to 3 or 4.

The final position is often determined through using those weights to do a weighted

interpolation between the physical locations of the chosen fingerprints; this

approach is often referred to as ‘weighted k-nearest neighbour’.

The K-nearest neighbour (KNN) method is a deterministic approach that uses the

average of the RSS time samples of RPs from the fingerprint database to estimate

the user’s location. It first examines the Euclidean distance of the online RSS

measurement vector to the RPs in the database, namely:

Di = ∥r −  ̄ ψi∥

where  ̄ ψi = 1/T

ΣT_=1 ψi,1(τ ) is the average RSS vector for RP i.

Page 24: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

K Nearest Neighbor

Lazy Learning Algorithm

Defer the decision to generalize beyond the training examples till

a new query is encountered

Whenever we have a new point to classify, we find its K

Nearest neighbors from the training data.

The distance is calculated using one of the following measures

Euclidean Distance

Minkowski Distance

Mahalanobis Distance

Simple KNN Algorithm:

For each training example <x,f(x)>, add the example to the list of

training_examples.

Given a query instance xq to be classified,

Let x1,x2….xk denote the k instances from training examples that are

nearest to xq .

Return the class that represents the maximum of the k instances.

Page 25: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

KNN Example

If K = 5, then in this case query instance xq will be classified as negative since

three of its nearest neighbors are classified as negative.

Instance Weighted K-NN using Gradient Descent Assumptions

_ All the attribute values are numerical or real

_ Class attribute values are discrete integer values

For example: 0,1,2…..

Algorithm

_ Read the training data from a file <x, f(x)>

_ Read the testing data from a file <x, f(x)>

_ Set K to some value

_ Set the learning rate α

_ Set the value of N for number of folds in the cross validation

_ Normalize the attribute values in the range 0 to 1

Value = Value / (1+Value)

Assign random weight wi to each instance xi in the training set

Divide the number of training examples into N sets

Train the weights by cross validation

_ For every set Nk in N, do

Set Nk = Validation Set

For every example xi in N such that xi does not belong to Nk do

Page 26: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

Find the K nearest neighbors based on the Euclidean distance Calculate the

class value as:

Σ wk X xj,k where j is the class attribute

If actual class != predicted class then apply gradient descent

Error = Actual Class – Predicted Class

For every Wk

Wk = Wk + α X Error

Calculate the accuracy as:

Accuracy = (# of correctly classified examples / # of examples in Nk) X 100

Train the weights on the whole training data set

_ For every training example xi

Find the K nearest neighbors based on the Euclidean distance

Calculate the class value as:

Σ wk X xj,k where j is the class attribute

If actual class != predicted class then apply gradient descent

Error = Actual Class – Predicted Class

For every Wk

Wk = Wk + α X Error

Calculate the accuracy as:

Accuracy = (# of correctly classified examples / # of training

examples) X 100

_ Repeat the process till desired accuracy is reached

For each testing example in the testing set

_ Find the K nearest neighbors based on the Euclidean distance

_ Calculate the class value as:

Σ Wk X xj,k where j is the class attribute

Calculate the accuracy as

_ Accuracy = (# of correctly classified examples / # of testing

examples) X 100

Page 27: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

Example with Gradient Descent

Consider K = 3, α = 0.2, and the 3 nearest neighbors to xq are x1,x2,x3

K nearest neighbors Euclidean Distance Class Random Weight

Class of xq = 0.2 X 1 + 0.1 X 2 + 0.005 X 2 = 0.41 => 0

Correct Class of xq = 1

Applying Gradient Descent

W1 = 0.2 + 0.2 X (1 - 0) = 0.4

W2 = 0.1 + 0.2 X (1 - 0) = 0.3

W3 = 0.005 + 0.2 X (1 - 0) = 0.205

Class of xq = 0.4 X 1 + 0.3 X 2 + 0.205 X 2 = 1.41

Class of xq => 1

Simple K-NN would have predicted the class as 2

K nearest

neighbors

Euclidean

Distance

class Random Weights

X1 12 1 W1 = 0.2

X2 14 2 W2 = 0.1

X2 16 2 W3 = 0.005

Page 28: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

Flowchart of KNN:

Page 29: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

Methods and tools

Methods

The viability of different solutions were to be evaluated primarily through studying

paper detailing their advantages, disadvantages and difficulties, but also through

experimentation and data gathering.

As Android is built for Java, this was to be the primary programming language for

the application. However, performance demanding algorithms could have required

C and thus the Android NDK (Native Development Kit) for implementation as it

typically provides superior

performance.

It was also assumed that a simple server program had to the developed in order to

provide the client application with any static and/or pre-measured data needed for

positioning. Depending on amount and complexity of the data stored by the server,

a simple data-file might have been enough, though a relational database was

thought to most likely have been required.

Encryption of the communication between the server and the client was also meant

to be implemented, in order to protect the users’ integrity, though it was not seen as

strictly required for the project.

Page 30: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

Tools

Eclipse with the Android Development Tools plugin was used as the development

environment for the Java code. Android SDK was used as the underlying layer

providing the actual compiler for the target platform.

Motivation

Following the achievements of satellite‐based location services in outdoor

applications the challenge has shifted to the provision of such services for the

indoor environment.

However, the ability to locate objects and people indoors remains a substantial

challenge, forming the major bottleneck preventing seamless positioning in

all environments.

Many indoor positioning applications are waiting for a satisfactory technical

solution.

Improvements in indoor positioning performance have the potential to create

unprecedented opportunities for businesses.

Page 31: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

Advantages

Indoor positioning system technology uses radio, ultrasound or infrared

signals to more precisely track locations where GPS signals are blocked.

Low cost.

Time-consuming infrastructure.

Applications benefiting from indoor location include:

School campus

Guided tours of museums

Shopping malls

Warehouses

Airports,bus,train and subway stations

Parking lots

Social networking

Hospitals

Sports

Disadvantages

Particle filter improve accuracy.

Increased power consumption.

Page 32: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

Trilateration Positioning Algorithms

TDOA (time difference of arrival)

TOA (time of arrival)

TDOA(TIME DIFFERENCE OF ARRIVAL)

Wireless location with TDOA is essentially to resolve non-linear estimation

problem.

In wireless location area, Taylor Series algorithm is essential to find the

solution to minimize the objective function.

A new algorithm and defines a different objective function that is the sum of

squared distances between iterative point and hyperbolas defined by TDOA.

Then Steepest Descent method is used to find the best point based on the

objective function.

The measured distance between MS and BSs is expressed as:

ri(x)= √(x-Xi)2+(y-Yi)

2, i=1,2,…N (1)

Because we measure the radio propagation time between BS and MS and

treat it as distance.

Page 33: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

Taylor Series Algorithm:

Taylor Series algorithm for wireless location is to iteratively find the best solution to

minimize objective function - squared TDOA.

TDOA for BSi with respect to BS1 is written as:

ri1 = ri-r1+ni1TDOA = √(x-Xi)

2+(y-Yi)2 - √(x-X1)

2+(y-Y1)+ni1TDOA (2)

where i=1,2,….N

ni1TDOA is zero-mean Gaussian noise with variance 𝜎2

of the ith TDOA between BSi

and BS1.

equation (2) is expanded into Taylor

Series at the initial location (x0, y0), and the first two terms

are remained.

Then we get:

ri10+ai,x(x0,y0)x𝛿+ ai,y(x0,y0)y𝛿 = ri1+ni1

TDOA (3)

where

ri10 =√(x0-Xi)

2+(y0-Yi)2 - √(x0-X1)

2+(y0-Y1)2

ri1 is the measure TDOA between BSi with respect to BS1;

ai,x= 𝜕ri1(x,y)

𝜕𝑥, x0,y0 =

𝑋1−𝑥0

𝑟1 -

𝑋𝑖−𝑥0

𝑟𝑖

ai,y= 𝜕ri1(x,y)

𝜕𝑦, x0,y0 =

𝑌1−𝑦0

𝑟1 -

𝑌𝑖−𝑦0

𝑟𝑖

In which ri =√(x0-Xi)

2+(y0-Yi)2

It can also be rewritten as:

A𝛿 = 𝐷 + 𝑒 (4)

Where

Page 34: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

A=[𝑎2, 𝑥 ⋯ 𝑎2, 𝑦⋮ ⋱ ⋮

𝑎𝑁, 𝑥 ⋯ 𝑎𝑁, 𝑦],𝛿 = [𝛿𝑥 𝛿𝑦]T

D=[r21-r210 r31-r31

0 …… rN1-rN10]T

e =[n21 n31…….. nN1]T

ri10=ri-r1

According to Least Square estimation, to find to

minimize the sum of squared remains, i.e.:

e2=(A𝛿-D)2=(A𝛿-D)T (A𝛿-D) (5)

The 𝛿 would be:

𝛿=(AT A)-1ATD (6)

As a summary, Taylor Series algorithm computes from

equation (6) with initial position (x0, y0), and then location

estimation is updated according to:

xk+1= xk+ 𝛿x , yk+1= yk+ 𝛿y (7)

The iteratively estimated location approaches the true

position after executing above procedures.

It is worthy to mention that after enough times of

iteration, 𝛿 will be close to 0 i.e. 𝛿 ≈0; e2 = D2. So in the

end, Taylor Series algorithm is to find the optimized solution

for objective function: sum of D2.

Page 35: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

The new distance based Algorithm

• The proposed distance based algorithm defines a new objective function

• Then uses steepest descent method to find the optimized solution.

• The new objective function is the sum of distances from optimized location

to hyperbola defined by TDOA measurement for each BS1- BSi pair.

The new distance based algorithm follows steps as:

• Specify the initial location value θk(xk , yk) in general

coordinate and u;

• Convert θk into εk under each local coordinate defined by

BS1- BSi pair. And then get t by resolve the nonlinear

equation i.e,

by cost/sint + ax cost = C2

• Calculate each gradient (from 1 to N-1) and sum the gradients into 𝛻 θF(θk).

• get the next estimated location (xk+1,yk+1) according to equation i.e,

Θk+1 =[ 𝑥𝑘 + 1𝑦𝑘 + 1

]=θk -u 𝛻 θF(θk)

Where 𝛻 θF(θk)=𝜕𝐹

𝜕𝑥,𝜕𝐹

𝜕𝑦

• if the delta of (xk+1,yk+1) is small enough, break down;

or go to step 1 for iteration.

Page 36: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

Advantages and disadvantages of taylor series:

When the error is small (under 300 meters) and BS number is more than five,

Taylor Series algorithm can have higher accuracy than the new distance based

algorithm.

But when BS number is less than six, the new distance based algorithm

generally performs better than Taylor Series algorithm.

Fig: FLOWCHART OF WIFI POSITIONING

Page 37: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

Implementation

Software requirements for implementation the system:

Operating system Windows7

coding Android java

testing Android Development Tools/java

Hardware requirements for development and implementing

The system:

1. 4GB RAM

2. ANDROID MOBILE WITH KITKAT VERSION

3. WIFI ROUTER

Page 38: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

Screenshots of trilateration distance measurement

Page 39: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

Snapshots of detecting Wi-Fi signal

Page 40: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of
Page 41: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of
Page 42: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

Snapshots of k nearest neighbor

Here, error rate is 28.109375%

Page 43: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

Here the error rate is 33.21875%

Page 44: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

Conclusion

Wi-Fi has become a wide spreading technology, a technology that has never

been designed for localization.

Nevertheless,WiFi positioning performs well in comparison to other positioning

technologies, and has the favorable advantage that it is based on an existing

infrastructure.

First, it can be said that all Wi-Fi agreed methods are based on signal strength

(except AoA).

The technique best suited for each individual Wi-Fi positioning is dependent on

the environment.

When indoors, positioning fingerprinting delivers the best results. However, it is

also associated with a lot of effort.

FUTURE WORK

To Build an application that describes the Wi-Fi trilateration method for indoor

positioning using Android-based mobile devices.

Page 45: INDOOR POSITIONING SYSTEM USING WIFI (TRILATERATION METHOD) · Detail study of indoor positioning system using triangulation and trilateration methods. Requirements At the end of

REFERENCES

1) Li, Binghao; Salter, James; Dempster, Andrew G.; Ri, Chris, Indoor Positioning

Techniques Based on Wireless LAN. Sydney: University of New South Wales,

2006. Downloaded: 2012-02-20

URL:http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.72.1265&rep=rep1

&typ e=pdf

2) "Location Based Services for Mobiles: Technologies and Standard“, ShuWang,

Jungwon Min and Byung K. Yi, IEEE International Conference on

Communication (ICC) 2008, Beijing, China.

3) Cisco Systems, Inc., Wi-Fi Location-Based Services 4.1 Design Guide San

Jose, USA: Cisco Systems, Inc. 2008. Online:

http://www.cisco.com/en/US/docs/solutions/Enterprise/Mobility/wifich2.html

4) Jami, I.; Ali, M.; Ormondroyd, R.F.; Comparision of Methods of Locating

and Tracking Cellular USA: Dept. of Aerosp. Power & Sensors, Cranfield

Univ., Swindon, 2010.

5) Martin Vossiek, Leif, Wiebking, Peter Gulden, Jan Wieghardt and

Clemens Hoffmann Wireless Location Positioning - Concepts, Solutions,

Applications Munich, Germany: Siemens Corporate Technology, 2003.

6) K. Pahlavan and P. Krishnamurthy Properties of Indoor Received Signal

Strength for Wifi Location Fingerprinting University of Pittsburgh