2013 International Conference on Indoor Positioning and Indoor Navigation, 28th-31th October 2013
Acoustic Local Positioning System
Using an iOS Device
T. Aguilera*, J. A. Paredes, F. J. Aด lvarez and J. I. Suaดrez
Department of Electrical Engineering, Electronic and Automatic
University of Extremadura
Badajoz, Spain, 06006
*Email: teoaguibe@unex.es
A. Hernดandez
Electronics Department
University of Alcalดa
Alcalดa de Henares, Spain, 28871
Email: alvaro@depeca.uah.es
Abstract—This work benefits from the capability of the
iPhone’s or iPad’s microphone to acquire high-frequency sound
for accurate acoustic code identification. Although the maximum
theoretical value for the frequency response of the built-in iOS
device microphone is 20 kHz, emissions with frequencies close to
22 kHz have been experimentally detected. The frequencies used
in this work are in the range from 18 to 22 kHz, which are high
enough to be inaudible for almost every people but low enough
to be generated by standard sound hardware.
The aim of this work is to develop an inexpensive indoor
positioning system where the user gets its location by using an
iOS device’s microphone. For this purpose a third-generation
iPad is used for high-frequency sound data acquisition and
neither external acquisition system nor ultrasonic microphone
are required.
The capability of iOS devices to acquire acoustic signals in the
vicinity of 20 kHz has been successfully demonstrated. This fact
allows the use of this kind of device for acoustic code detection
and accurate positioning by means of multilateration.
Keywords. Local Positioning System; iOS Device; Kasami
Codes; CDMA; Objective-C Application.
I. INTRODUCTION AND RELATED WORKS
Everybody is aware about the growing spread and computational
power of mobile phones and the rising number of
applications (apps) we find in app stores, full of different
location-based apps such as restaurant finders, tourist guides
and navigation systems, etc. Since smartphones and wireless
Internet connection became ubiquitous in the last years, location
based interaction, supported via the Global Positioning
System (GPS) or WiFi identification has become a standard
pattern for mobile phone usage.
Nowadays most smartphones are equipped with a GPS
receiver, which raises costs and increases the energy consumption.
Unfortunately, GPS is not able to track people in
indoor environments with acceptable accuracy [1]. Signals
might get lost due to attenuation effects of roofs and walls or
lead to position fixes of very low accuracy due to multipath
propagation. Therefore, GPS is not a good option for indoor
location currently.
Works as the one presented in [2] propose a system based
on infrared receivers (IR), distributed inside the building,
and a device sending IR signals. Unfortunately, smartphones
generally do not integrate an IR emitter, a complex and costly
infrastructure has to be built. The same problem presents
Magnetic Indoor Positioning System (MILPS) [3] [4] which
uses artificial magnetic fields generated by coils for ranging
between multiple coils and a mobile station equipped with a
magnetic sensor. Other option is to use Bluetooth receivers [5],
which are integrated in many mobile devices, but unfortunately
access to it is often limited by the operating system.
A different approach is to use position information deduced
from a combination of Global Navigation Satellite System
(GNSS) where available, combined with Pedestrian Dead
Reckoning (PDR) utilizing inertial measurements and contextaware
activity based map matching [6] [7]. Unluckily experiments
have shown that several sources of error accumulation
exist, being the most important the heading error.
Other works [8]–[10] propose the use of WiFi signals to
perform such a localization, but absorption and reflection generate
confusion [11] and the required WiFi parameters cannot
always be accessed on modern phones operating systems.
An attractive possibility is to triangulate the device position
using ultrasonic signals [12]–[15]. These works use frequencies
and algorithms which require special hardware on the
client side. A compromise is the use of ultrasonic frequencies
close to the human perceiving threshold (i. e. around 20 kHz)
to identify the presence of a beacon sender [16]. Taking into
account that audio recording is a standard smartphone feature,
and that smartphone microphones are capable to sense sound
on ultrasonic frequencies close to 22 kHz, this work presents
an approach for inexpensive and easy indoor positioning which
can be carried out with the help of a mobile device or tablet
using its built-in microphone as receiver [17]. The positioning
algorithm can be implemented locally on the user’s device, if
a particular set of signals and their origin positions (beacons)
are known to the device. This requires the device to access a
beacon map, which must be maintained for every site.
The purpose of this work is to use the good correlation and
cross-correlation properties of Kasami codes [18] for indoor
sound multilateration positioning. At the same time, ultrasonic
signals can be used to sense the proximity of a beacon, offering
useful information related with beacon’s location. In this case,
errors should not exceed a few meters, otherwise, the service
could provide information for places which are quite far away
from the actual position of the target.
978-1-4799-4043-1/13/$31.00 ฉ2013 IEEE
2013 International Conference on Indoor Positioning and Indoor Navigation, 28th-31th October 2013
Such information can be displayed via a webpage, building
plan, sound message...etc. A possible implementation based
on ultrasonic technology of those indoor services could be
carried out in a museum tour guide [19]. Systems currently
used in museums provide unsophisticated functionality which
is very often limited to manually entering a number in order to
hear a recording. Indoor location based services require higher
precision guarantees than outdoor services. Nowadays the state
of the art for indoor LBS and context-sensitive services is still
an outstanding problem.
The remainder of the paper is structured as follows: in the
next section, the algorithms used for Kasami codes generation
and multilateration are presented, followed by a description of
the general system design in the third section. The system has
been evaluated on-site, the results are analyzed in the fourth
section. To conclude, a recapitulation of the main contributions
of this work, together with a description of the next steps and
further improvements are shown in the fifth section.
II. THEORETIC CONCEPTS
A. Kasami Codes
In this work we take advantage of the ability of the iPhone’s
or iPad’s microphone to acquire high frequency sound for
accurate code identification. The signals emitted are 255-
bit Kasami sequences with BPSK modulation at 20 kHz.
This kind of sequences belongs to the well known family of
pseudorandom codes [20].
A Kasami sequence k can be generated from a maximal
sequence and the decimated and concatenated version of this
sequence by performing the module-2 sum of the former with
any delayed version of the latter, i.e.,
k = m1 Dlm2 (1)
where m is a maximal sequence of length L = 2N..1 with N
even, m2 is the sequence obtained from the decimation of m1
with a decimation factor of q = 2N=2+1 and the concatenation
of the result q times, represents the module-2 sum and Dlm2
is the sequence obtained by cyclically shifting l positions the
m2 sequence.
In order to adapt the spectral features of the emission to the
frequency response of the ultrasonic emitter, these codes are
binary phase modulated (BPSK). This modulation scheme has
been widely used to transmit binary codes in matched filteringbased
sonar systems. Every bit in the code k[n] is modulated
with one or more carrier cycles whose phase, 0 or , is given
by the bit value to obtain the modulated pattern as:
p[n] =
Xl..1
k[i] m[n .. i Nc M] (2)
where L is the code length, m[n] is the modulation symbol
formed by Nc carrier cycles, and M represents the number of
samples per period (ratio between the sampling and the carrier
frequencies).
B. Multilateration Algorithm
To resolve the user’s location a multilateration has been
used. This technique involves measuring the time difference
between a captured signal, emitted by a beacon and other signals
captured subsequently emitted by the remaining beacons.
With the information obtained from the distance measurements
and the knowledge of the beacon’s location, we propose a
system of equations that solves the user’s position. Fig. 1
shows a graphic representation for multilateration technique.
Fig. 1. Approach for multilateration technique.
In Fig. 1 Bi (i = 1:::4) are the positions of the ultrasonic
beacons which are known and P is the user’s location which
we want to estimate. On the other hand ri1 is the distance
difference between beacon i and 1 from the user’s position P.
To solve the user’s location the Gauss-Newton algorithm
is used. The Gauss-Newton algorithm is an iterative method
regularly used for solving nonlinear least squares problems.
The procedure consists of a sequence of linear least squares
approximations to the nonlinear problem, each of which is
solved by an iterative process.
The algorithm starts from a close and approximate position
(^x; ^y; ^z) of the user and uses iterations to minimize the sum
of squared errors of the distances F(x; y; z) to estimate the
user’s position, where:
F(x; y; z) =
X4
i=2
(^
ri1 .. ri1)2 (3)
This process works until getting an estimation of the user’s
position (x; y; z) in which the squared error (x;y;z) is
sufficiently small. Finally the user’s position is estimated as:
P(x; y; z) = (^x; ^y; ^z) .. (x;y;z) (4)
2013 International Conference on Indoor Positioning and Indoor Navigation, 28th-31th October 2013
III. SYSTEM DESIGN
A. Hardware
A diagram showing the full system is depicted in Fig. 2.
Such diagram
2013 International Conference on Indoor Positioning and Indoor Navigation, 28th-31th October 2013
Acoustic Local Positioning System
Using an iOS Device
T. Aguilera*, J. A. Paredes, F. J. Aด lvarez and J. I. Suaดrez
Department of Electrical Engineering, Electronic and Automatic
University of Extremadura
Badajoz, Spain, 06006
*Email: teoaguibe@unex.es
A. Hernดandez
Electronics Department
University of Alcalดa
Alcalดa de Henares, Spain, 28871
Email: alvaro@depeca.uah.es
Abstract—This work benefits from the capability of the
iPhone’s or iPad’s microphone to acquire high-frequency sound
for accurate acoustic code identification. Although the maximum
theoretical value for the frequency response of the built-in iOS
device microphone is 20 kHz, emissions with frequencies close to
22 kHz have been experimentally detected. The frequencies used
in this work are in the range from 18 to 22 kHz, which are high
enough to be inaudible for almost every people but low enough
to be generated by standard sound hardware.
The aim of this work is to develop an inexpensive indoor
positioning system where the user gets its location by using an
iOS device’s microphone. For this purpose a third-generation
iPad is used for high-frequency sound data acquisition and
neither external acquisition system nor ultrasonic microphone
are required.
The capability of iOS devices to acquire acoustic signals in the
vicinity of 20 kHz has been successfully demonstrated. This fact
allows the use of this kind of device for acoustic code detection
and accurate positioning by means of multilateration.
Keywords. Local Positioning System; iOS Device; Kasami
Codes; CDMA; Objective-C Application.
I. INTRODUCTION AND RELATED WORKS
Everybody is aware about the growing spread and computational
power of mobile phones and the rising number of
applications (apps) we find in app stores, full of different
location-based apps such as restaurant finders, tourist guides
and navigation systems, etc. Since smartphones and wireless
Internet connection became ubiquitous in the last years, location
based interaction, supported via the Global Positioning
System (GPS) or WiFi identification has become a standard
pattern for mobile phone usage.
Nowadays most smartphones are equipped with a GPS
receiver, which raises costs and increases the energy consumption.
Unfortunately, GPS is not able to track people in
indoor environments with acceptable accuracy [1]. Signals
might get lost due to attenuation effects of roofs and walls or
lead to position fixes of very low accuracy due to multipath
propagation. Therefore, GPS is not a good option for indoor
location currently.
Works as the one presented in [2] propose a system based
on infrared receivers (IR), distributed inside the building,
and a device sending IR signals. Unfortunately, smartphones
generally do not integrate an IR emitter, a complex and costly
infrastructure has to be built. The same problem presents
Magnetic Indoor Positioning System (MILPS) [3] [4] which
uses artificial magnetic fields generated by coils for ranging
between multiple coils and a mobile station equipped with a
magnetic sensor. Other option is to use Bluetooth receivers [5],
which are integrated in many mobile devices, but unfortunately
access to it is often limited by the operating system.
A different approach is to use position information deduced
from a combination of Global Navigation Satellite System
(GNSS) where available, combined with Pedestrian Dead
Reckoning (PDR) utilizing inertial measurements and contextaware
activity based map matching [6] [7]. Unluckily experiments
have shown that several sources of error accumulation
exist, being the most important the heading error.
Other works [8]–[10] propose the use of WiFi signals to
perform such a localization, but absorption and reflection generate
confusion [11] and the required WiFi parameters cannot
always be accessed on modern phones operating systems.
An attractive possibility is to triangulate the device position
using ultrasonic signals [12]–[15]. These works use frequencies
and algorithms which require special hardware on the
client side. A compromise is the use of ultrasonic frequencies
close to the human perceiving threshold (i. e. around 20 kHz)
to identify the presence of a beacon sender [16]. Taking into
account that audio recording is a standard smartphone feature,
and that smartphone microphones are capable to sense sound
on ultrasonic frequencies close to 22 kHz, this work presents
an approach for inexpensive and easy indoor positioning which
can be carried out with the help of a mobile device or tablet
using its built-in microphone as receiver [17]. The positioning
algorithm can be implemented locally on the user’s device, if
a particular set of signals and their origin positions (beacons)
are known to the device. This requires the device to access a
beacon map, which must be maintained for every site.
The purpose of this work is to use the good correlation and
cross-correlation properties of Kasami codes [18] for indoor
sound multilateration positioning. At the same time, ultrasonic
signals can be used to sense the proximity of a beacon, offering
useful information related with beacon’s location. In this case,
errors should not exceed a few meters, otherwise, the service
could provide information for places which are quite far away
from the actual position of the target.
978-1-4799-4043-1/13/$31.00 ฉ2013 IEEE
2013 International Conference on Indoor Positioning and Indoor Navigation, 28th-31th October 2013
Such information can be displayed via a webpage, building
plan, sound message...etc. A possible implementation based
on ultrasonic technology of those indoor services could be
carried out in a museum tour guide [19]. Systems currently
used in museums provide unsophisticated functionality which
is very often limited to manually entering a number in order to
hear a recording. Indoor location based services require higher
precision guarantees than outdoor services. Nowadays the state
of the art for indoor LBS and context-sensitive services is still
an outstanding problem.
The remainder of the paper is structured as follows: in the
next section, the algorithms used for Kasami codes generation
and multilateration are presented, followed by a description of
the general system design in the third section. The system has
been evaluated on-site, the results are analyzed in the fourth
section. To conclude, a recapitulation of the main contributions
of this work, together with a description of the next steps and
further improvements are shown in the fifth section.
II. THEORETIC CONCEPTS
A. Kasami Codes
In this work we take advantage of the ability of the iPhone’s
or iPad’s microphone to acquire high frequency sound for
accurate code identification. The signals emitted are 255-
bit Kasami sequences with BPSK modulation at 20 kHz.
This kind of sequences belongs to the well known family of
pseudorandom codes [20].
A Kasami sequence k can be generated from a maximal
sequence and the decimated and concatenated version of this
sequence by performing the module-2 sum of the former with
any delayed version of the latter, i.e.,
k = m1 Dlm2 (1)
where m is a maximal sequence of length L = 2N..1 with N
even, m2 is the sequence obtained from the decimation of m1
with a decimation factor of q = 2N=2+1 and the concatenation
of the result q times, represents the module-2 sum and Dlm2
is the sequence obtained by cyclically shifting l positions the
m2 sequence.
In order to adapt the spectral features of the emission to the
frequency response of the ultrasonic emitter, these codes are
binary phase modulated (BPSK). This modulation scheme has
been widely used to transmit binary codes in matched filteringbased
sonar systems. Every bit in the code k[n] is modulated
with one or more carrier cycles whose phase, 0 or , is given
by the bit value to obtain the modulated pattern as:
p[n] =
Xl..1
k[i] m[n .. i Nc M] (2)
where L is the code length, m[n] is the modulation symbol
formed by Nc carrier cycles, and M represents the number of
samples per period (ratio between the sampling and the carrier
frequencies).
B. Multilateration Algorithm
To resolve the user’s location a multilateration has been
used. This technique involves measuring the time difference
between a captured signal, emitted by a beacon and other signals
captured subsequently emitted by the remaining beacons.
With the information obtained from the distance measurements
and the knowledge of the beacon’s location, we propose a
system of equations that solves the user’s position. Fig. 1
shows a graphic representation for multilateration technique.
Fig. 1. Approach for multilateration technique.
In Fig. 1 Bi (i = 1:::4) are the positions of the ultrasonic
beacons which are known and P is the user’s location which
we want to estimate. On the other hand ri1 is the distance
difference between beacon i and 1 from the user’s position P.
To solve the user’s location the Gauss-Newton algorithm
is used. The Gauss-Newton algorithm is an iterative method
regularly used for solving nonlinear least squares problems.
The procedure consists of a sequence of linear least squares
approximations to the nonlinear problem, each of which is
solved by an iterative process.
The algorithm starts from a close and approximate position
(^x; ^y; ^z) of the user and uses iterations to minimize the sum
of squared errors of the distances F(x; y; z) to estimate the
user’s position, where:
F(x; y; z) =
X4
i=2
(^
ri1 .. ri1)2 (3)
This process works until getting an estimation of the user’s
position (x; y; z) in which the squared error (x;y;z) is
sufficiently small. Finally the user’s position is estimated as:
P(x; y; z) = (^x; ^y; ^z) .. (x;y;z) (4)
2013 International Conference on Indoor Positioning and Indoor Navigation, 28th-31th October 2013
III. SYSTEM DESIGN
A. Hardware
A diagram showing the full system is depicted in Fig. 2.
Such diagram
การแปล กรุณารอสักครู่..
