0% found this document useful (0 votes)
12 views9 pages

Acoustic Local Positioning System Using An iOS Device: Conference Paper

Uploaded by

yonatanmelaku9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views9 pages

Acoustic Local Positioning System Using An iOS Device: Conference Paper

Uploaded by

yonatanmelaku9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/271483585

Acoustic local positioning system using an iOS device

Conference Paper · October 2013


DOI: 10.1109/IPIN.2013.6817872

CITATIONS READS

20 1,489

5 authors, including:

José A Paredes Fernando Javier Álvarez


Universidad de Extremadura Universidad de Extremadura
14 PUBLICATIONS 107 CITATIONS 131 PUBLICATIONS 915 CITATIONS

SEE PROFILE SEE PROFILE

Álvaro Hernández
University of Alcalá
182 PUBLICATIONS 1,681 CITATIONS

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Fostering knowledge about the relationship between Information and Communication Technologies and Public Spaces supported by strategies to improve their use
and attractiveness (CYBERPARKS) View project

Underground Built Heritage as catalyser for Community Valorisation (Underground4value) View project

All content following this page was uploaded by José A Paredes on 09 April 2015.

The user has requested enhancement of the downloaded file.


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. Álvarez and J. I. Suárez A. Hernández
Department of Electrical Engineering, Electronic and Automatic Electronics Department
University of Extremadura University of Alcalá
Badajoz, Spain, 06006 Alcalá de Henares, Spain, 28871
*Email: [email protected] Email: [email protected]

Abstract—This work benefits from the capability of the Magnetic Indoor Positioning System (MILPS) [3] [4] which
iPhone’s or iPad’s microphone to acquire high-frequency sound uses artificial magnetic fields generated by coils for ranging
for accurate acoustic code identification. Although the maximum between multiple coils and a mobile station equipped with a
theoretical value for the frequency response of the built-in iOS
device microphone is 20 kHz, emissions with frequencies close to magnetic sensor. Other option is to use Bluetooth receivers [5],
22 kHz have been experimentally detected. The frequencies used which are integrated in many mobile devices, but unfortunately
in this work are in the range from 18 to 22 kHz, which are high access to it is often limited by the operating system.
enough to be inaudible for almost every people but low enough A different approach is to use position information deduced
to be generated by standard sound hardware. from a combination of Global Navigation Satellite System
The aim of this work is to develop an inexpensive indoor
positioning system where the user gets its location by using an (GNSS) where available, combined with Pedestrian Dead
iOS device’s microphone. For this purpose a third-generation Reckoning (PDR) utilizing inertial measurements and context-
iPad is used for high-frequency sound data acquisition and aware activity based map matching [6] [7]. Unluckily experi-
neither external acquisition system nor ultrasonic microphone ments have shown that several sources of error accumulation
are required. exist, being the most important the heading error.
The capability of iOS devices to acquire acoustic signals in the
vicinity of 20 kHz has been successfully demonstrated. This fact Other works [8]–[10] propose the use of WiFi signals to
allows the use of this kind of device for acoustic code detection perform such a localization, but absorption and reflection ge-
and accurate positioning by means of multilateration. nerate confusion [11] and the required WiFi parameters cannot
Keywords. Local Positioning System; iOS Device; Kasami always be accessed on modern phones operating systems.
Codes; CDMA; Objective-C Application. An attractive possibility is to triangulate the device position
using ultrasonic signals [12]–[15]. These works use frequen-
I. I NTRODUCTION AND RELATED WORKS cies and algorithms which require special hardware on the
Everybody is aware about the growing spread and compu- client side. A compromise is the use of ultrasonic frequencies
tational power of mobile phones and the rising number of close to the human perceiving threshold (i. e. around 20 kHz)
applications (apps) we find in app stores, full of different to identify the presence of a beacon sender [16]. Taking into
location-based apps such as restaurant finders, tourist guides account that audio recording is a standard smartphone feature,
and navigation systems, etc. Since smartphones and wireless and that smartphone microphones are capable to sense sound
Internet connection became ubiquitous in the last years, lo- on ultrasonic frequencies close to 22 kHz, this work presents
cation based interaction, supported via the Global Positioning an approach for inexpensive and easy indoor positioning which
System (GPS) or WiFi identification has become a standard can be carried out with the help of a mobile device or tablet
pattern for mobile phone usage. using its built-in microphone as receiver [17]. The positioning
Nowadays most smartphones are equipped with a GPS algorithm can be implemented locally on the user’s device, if
receiver, which raises costs and increases the energy con- a particular set of signals and their origin positions (beacons)
sumption. Unfortunately, GPS is not able to track people in are known to the device. This requires the device to access a
indoor environments with acceptable accuracy [1]. Signals beacon map, which must be maintained for every site.
might get lost due to attenuation effects of roofs and walls or The purpose of this work is to use the good correlation and
lead to position fixes of very low accuracy due to multipath cross-correlation properties of Kasami codes [18] for indoor
propagation. Therefore, GPS is not a good option for indoor sound multilateration positioning. At the same time, ultrasonic
location currently. signals can be used to sense the proximity of a beacon, offering
Works as the one presented in [2] propose a system based useful information related with beacon’s location. In this case,
on infrared receivers (IR), distributed inside the building, errors should not exceed a few meters, otherwise, the service
and a device sending IR signals. Unfortunately, smartphones could provide information for places which are quite far away
generally do not integrate an IR emitter, a complex and costly from the actual position of the target.
infrastructure has to be built. The same problem presents

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 B. Multilateration Algorithm


plan, sound message...etc. A possible implementation based To resolve the user’s location a multilateration has been
on ultrasonic technology of those indoor services could be used. This technique involves measuring the time difference
carried out in a museum tour guide [19]. Systems currently between a captured signal, emitted by a beacon and other sig-
used in museums provide unsophisticated functionality which nals captured subsequently emitted by the remaining beacons.
is very often limited to manually entering a number in order to With the information obtained from the distance measurements
hear a recording. Indoor location based services require higher and the knowledge of the beacon’s location, we propose a
precision guarantees than outdoor services. Nowadays the state system of equations that solves the user’s position. Fig. 1
of the art for indoor LBS and context-sensitive services is still shows a graphic representation for multilateration technique.
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. T HEORETIC C ONCEPTS
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 Fig. 1. Approach for multilateration technique.
sequence by performing the module-2 sum of the former with
any delayed version of the latter, i.e.,
In Fig. 1 Bi (i = 1...4) are the positions of the ultrasonic
k = m1 ⊕ D m2 l
(1) beacons which are known and P is the user’s location which
we want to estimate. On the other hand ∆ri1 is the distance
where m is a maximal sequence of length L = 2N −1 with N difference between beacon i and 1 from the user’s position P.
even, m2 is the sequence obtained from the decimation of m1 To solve the user’s location the Gauss-Newton algorithm
with a decimation factor of q = 2N/2 +1 and the concatenation is used. The Gauss-Newton algorithm is an iterative method
of the result q times, ⊕ represents the module-2 sum and Dl m2 regularly used for solving nonlinear least squares problems.
is the sequence obtained by cyclically shifting l positions the The procedure consists of a sequence of linear least squares
m2 sequence. approximations to the nonlinear problem, each of which is
In order to adapt the spectral features of the emission to the solved by an iterative process.
frequency response of the ultrasonic emitter, these codes are The algorithm starts from a close and approximate position
binary phase modulated (BPSK). This modulation scheme has (x̂, ŷ, ẑ) of the user and uses iterations to minimize the sum
been widely used to transmit binary codes in matched filtering- of squared errors of the distances F (x, y, z) to estimate the
based sonar systems. Every bit in the code k[n] is modulated user’s position, where:
with one or more carrier cycles whose phase, 0 or π, is given
4
by the bit value to obtain the modulated pattern as: X
F (x, y, z) = ˆ i1 − ∆ri1 )2
(∆r (3)
l−1
X i=2
p[n] = k[i] · m[n − i · Nc · M ] (2)
This process works until getting an estimation of the user’s
where L is the code length, m[n] is the modulation symbol position (x, y, z) in which the squared error (∆x, ∆y, ∆z) is
formed by Nc carrier cycles, and M represents the number of sufficiently small. Finally the user’s position is estimated as:
samples per period (ratio between the sampling and the carrier
frequencies). P (x, y, z) = (x̂, ŷ, ẑ) − (∆x, ∆y, ∆z) (4)
2013 International Conference on Indoor Positioning and Indoor Navigation, 28th -31th October 2013

III. S YSTEM D ESIGN B. Software


A. Hardware
To acquire audio with an iOS device is necessary to im-
A diagram showing the full system is depicted in Fig. 2. plement and configure the Audio Queue Services, which is a
Such diagram shows the connections between the different C programming interface in Core Audio Toolbox framework,
elements composing the system. available through The Mac Developer Library [21]. System
FPGA Nexys 2
frequency acquisition was chosen as 48 kHz and buffers
DC Source
Pmod DA2 capabilities were set to 3624 samples, this implies that every
75.5 ms the program saves data from the buffer to a pointer
Amplifiers
in memory.
The data acquisition process is described in Fig. 4.
Speakers

Code 1 Code 2 Code 3 Code 4

iPad (Objective-C Program)

Fig. 2. Conection diagram of the whole system.

The codes were synthesized by means of a Nexys 2 FPGA-


based board which has been programmed to simultaneously
generate four diferent Kasami codes that are periodically emit-
ted with an interval of 50ms between emissions. These digital
signals are converted to analog with the help of two double
digital to analog converter modules (Digilent PmodDA2). After
that, signals are transmitted to the audio amplifiers (Philips
TDA8920BTH) which are powered by means of a DC source
in order to drive a set of four speakers (Visaton SC5). Once
the codes have been emitted, they are acquired and processed
by the iPad, using its own built-in microphone and finally the
device identifies these codes by matched filtering.
Beacons have been placed in diferent positions inside our
laboratory, whose dimensions are 5.75 × 5.50 × 3.00 meters.
To measure the beacon’s positions a laser rangefinder (Bosch
GLM80) is used which has a ±1 mm of error. Fig. 3 shows
the distribution of the beacons in the working environment.

Fig. 4. Data acquisition process.

After that, these samples are processed by means of the


vDSP API which provides mathematical functions for appli-
cations involving data processing. This utility allows: (1) the
identification of the emitted codes by performing a matched
filtering, (2) the correlation peak detection by thresholding and
(3) the computing of the time-of-flight-differences (DTOF) to
determine the distances to the beacons.
Finally the user’s location is carried out by means of the
Fig. 3. Beacons distribution.
multilateration algorithm implemented on the iPad and whose
operation was described in detail in section II B .
2013 International Conference on Indoor Positioning and Indoor Navigation, 28th -31th October 2013

IV. E XPERIMENTAL R ESULTS C. Data Acquisition and Processing


A. Frequency Response The data are captured by the 32-bit Analogic-to-Digital
Since modern smartphones allow to record sound with 48 Converter (ADC) integrated in the iPad. Since the length of
kHz sample rate, is technically possible to detect sounds with the codes are 612 samples and a period of time of 50 ms exists
a maximum frequency of 24 kHz according to the Nyquist- between emissions (2400 samples at 48 kHz sample rate), the
Shannon theorem. Also, modern smartphone microphones are buffer capacity has been set to 612+2400+612 = 3.624 samples
well able to record sounds up to this frequency, offering a to ensure that at least a package of four Kasami codes, which
spectrum of about 4 kHz above the human reception which is are emitted simultaneously, is captured into every buffer.
high enough to be inaudible for almost every people. Fig. shows 7 a graphic representation of the data stored into
the audio buffer.

Fig. 5. Frequency response.


Fig. 7. Acquired signal.
Fig. 5 shows the frequency response of the receiver when
is located at one meter in the acoustic axis of one of the Once the codes have been acquired they are processed by the
speakers, emitting sinusoidal signals at different frequencies. iPad, which identifies the codes performing a cross correlation
Besides a 50-tap IIR filter has been designed to simulate the between the acquired signal and the emission patterns. Fig. 8
system behavior. represents the overlapped results for the four cross-correlations
B. Signal Processing where are distinguishable the correlation peaks belonging to
the four emitted codes. These correlation peaks determine
To avoid hearing the transient effects produced between
the TOF from each of the beacons to the iPad and thus
emissions, some additional signal processing has been neces-
the distance to each one. From these distances the user’s
sary. Figs. 6 a) and b) show the behavior of Code1 before
position is estimated with the help of the already described
and after to carry out a band-pass filtered together with a
multilateration algorithm.
Hamming-windowed respectively. After this treatment tran-
sient effects are so attenuated that they result inaudible, unless
very sensitive people get really close to the speaker.

Fig. 6. Signal processing of Code1. Fig. 8. Overlapped cross correlation results.


2013 International Conference on Indoor Positioning and Indoor Navigation, 28th -31th October 2013

D. Accuracy and Reliability


To assess the accuracy and reliability of the positioning
system, we have taken the user’s position on certain zones. To
measure the accuracy of the system a set of points were chosen
where the system could present problems (corners, close to
walls, far points...etc). A total of five points were selected and
one hundred measurements were taken from each of these
positions, to evaluate the reliability of the measurements. Fig.
9 represents the coordinates of the selected points.

Fig. 9. Locations of tested points.

The position of Point 1 has been chosen because of its


proximity to one of the side walls (left). The reason for this
choice is to check how the reception of the codes in that
position is affected by the directivity pattern of the speakers.
On the other hand, Point 2 is an intermediate position among
points 1, 3 and 5, and was chosen to compare its results with
these points. Point 3 is centered, at an appropriate distance
from the beacons and walls, to prevent near-far effect and
multipath respectively. With the election of this point, we are
looking for a location having the best conditions to be located
with the best possible accuracy. Then Point 4 is located in the
proximity of a corner, we choose these coordinates to study
how multipath affects the reception of the emissions. Finally
Point 5 is situated near Beacon 1, where the receiver captures
a strong signal coming from the nearest beacon, and thereby
making it impossible to detect others weaker signals from the
remaining beacons (near-far effect).
Fig. 10 depicts the five points studied, the beacon’s locations
and the estimated user’s positions. We eventually considered
representing a cenital view since x and y coordinates are the
most relevant and the results are more clearly exposed.
Fig. 10. Cenital view with the results obtained in the test points.
2013 International Conference on Indoor Positioning and Indoor Navigation, 28th -31th October 2013

A statistical study of the positioning errors have been also Moreover, Point 2 has worse results than Point 3 but slightly
carried out. Fig. 11, shows the CDF of the error measured in better than Point 1. Both cases, Point 1 and 2, the errors for
the five test points for the three coordinates. the three coordinates are lower than 0.30 meters with a 100 %
of probability, however Point 2 is more likely to have a lower
magnitude of the error.
On the other hand, Point 4 and 5 have worse results than the
first three points, especially Point 4. This point is located near a
corner, therefore is strongly affected by multipath propagation.
Multipath is the most dominant error source for positioning
because it has a large influence on the positioning accuracy
due to the received signals are disturbed by reflections. This
can lead to a large bias in the user’s TOF value. As shown the
CDF graph of the error for Point 4, the results obtained are
clearly inaccurate, especially for the y coordinate, where 0.9
meter errors exist in some cases.
Finally the results obtained for Point 5 are also quite
imprecise. This time the source of error is the near-far effect
due to the proximity between the Beacon 1 and the receiver.
The result shows that exists errors lower than about 0.6 meters
for the y coordinate with a 100% of probability.
As said, near-far effect is produced when the receiver cap-
tures a strong signal provenient from a close beacon and makes
impossible the detection of other weaker signals provenient
from the rest of the beacons. When this phenomenon happens,
the peak of correlation corresponding with the code which is
emitted by the closer beacon to the receiver, presents a clearly
higher value. Fig. 12 despicted this phenomenon when occurs
in Point 5.

Fig. 11. Cumulative distribution function of the error.

According to Fig. 11, the first three points present the best
results, with error less than 0.3 m in all cases for the three
coordinates. Fig. 12. Near-far effect in Point 5.
As expected, Point 3 presents the lowest error of the five
points because is less affected by multipath and the near-
far effect than the rest of the points. Looking into its CDF, Although this phenomenon causes errors in the determina-
it can be observed that a 100% of probability exists that tion of the TOF, this fact can be exploited to detect the user
the measurements have errors below 0.10 meters for x, z proximity to the beacon. Also, the beacon’s location could be
coordinates, and 70% for y coordinate. related with useful information for the user, providing him
Location-Based Services (LBS).
2013 International Conference on Indoor Positioning and Indoor Navigation, 28th -31th October 2013

E. User Inteface After data acquisition and processing to calculate the po-
sition of the user, this information is displayed through an
user interface. The interface consists of two tabs, which are
illustrated in Figs. 13 and 14.
The first tab shown in Fig. 13 describes the plane of the
laboratory where the tests are performed. The location of the
beacons (gray squares), and the estimated position of the user
(cyan cross) can be distinguished at every moment. Also a
Start/Stop button and another Exit button are necessary to
handle the application.
On the second tab shown in Fig. 14, the user can receive
information when being close to one of the beacons. This
tab consists of a User Interface Web View (UIWebView), a
Start/Stop button, controls for surfing the internet and finally
an Exit button. As shown in this figure, the iPad has detected
the emission of Code 1. The speaker which emits Code 1 is
supposed to be near the painting associated with this code,
i.e. The Gioconda. After detection of Code 1, the application
load a URL where the user is informed about the painting of
The Mona Lisa. When the user approaches another picture,
a new code is detected and inmediatly the iPad will display
information via web page regarding the new painting, since
every code has associated its own URL address.
V. C ONCLUSIONS AND F URTHER W ORKS
In this work the ability of iPhone or iPad to acquire ultra-
sonic signals around 20 KHz and its possible use for accurate
Fig. 13. Screenshot of the LPS user interface. ultrasonic code identifying, it has been succesfully developed.
The implementation of an ultrasonic local positioning system
has been carried out favorably. In addition, it has been made
an study on the accuracy and reliability of the system at certain
positions in the working environment. These results show that
for a total of 100 measurements in each of the positions
studied, the error vary between 0.03 and 0.9 meters in the
best and worst of the cases respectively, depending on the
user’s location. In this way for the determination of the TOF in
locations where the received signal is not affected by multipath
or / and near-far effect, the accuracy of the system significantly
improves respect to areas affected by these phenomena, such
as corners or at positions very close to the beacons or walls.
Besides, a code-detection related utility has been developed,
displaying information to the users through a web page. This
utility benefits from near-far effect to detect when the user
is close to a beacon offering him LBS related with beacon’s
location.
Facing further work we are developing improvements re-
lated with emitted codes from the point of view of dynamic
thresholding, as well as their Doppler effect tolerance when
the users are moving.
ACKNOWLEDGMENTS
This work has been supported jointly by the University
of Extremadura through its Aid Program for Initiation in
Research (ACCVII-11), and the Spanish Ministry of Econo-
my and Competitiveness, through the project LORIS-UEx
Fig. 14. Screenshot of the LBS user interface. (TIN2012-38080-C04-02).
2013 International Conference on Indoor Positioning and Indoor Navigation, 28th -31th October 2013

R EFERENCES
[1] P. Zandbergen, “Accuracy of iphone locations: A comparison of assisted
gps, wifi and cellular positioning,” Transactions in GIS, vol. 13, pp. 5–
26, 2009.
[2] R. Want, A. Hopper, V. Falçao, and J. Gibbons, “The active badge
location system,” ACM Transactions Information systems, pp. 91–102,
1992.
[3] J. Blankenbach, A. Norrdine, H. Hellmers, and E. Gasparian, “A
novel magnetic indoor positioning system for indoor location services,”
Proceedings, 2001.
[4] A. Bilke and J. Sieck, “Using magnetic field for indoor localisation on
a mobile phone,” Progress in Location-Based Services, 2013.
[5] K. C. Cheung, S. S. Intille, and K. Larson, “An inexpensive bluetooth-
based indoor positioning hack,” 2006.
[6] D. Gusenbauer, C. Isert, and J. Krösche, “Self-contained indoor posi-
tioning on off-the-shelf mobile devices,” Proceedings of International
Conference on Indoor Positioning and Indoor Navigation (IPIN), 2010.
[7] C. Lukianto, C. Hönniger, and H. Sternberg, “Pedestrian smartphone-
based indoor navigation using ultra portable sensory equipment,” Pro-
ceedings of Conference on Indoor Positioning and Indoor Navigation
(IPIN), 2010.
[8] P. Bahl and V. N. Pandmanabhan, “Radar: An in-building rf-based user
location and tracking system,” IEEE Infocom, pp. 775–784, 2000.
[9] Y. Inoue, A. Sashima, and K. Kurumatani, “Indoor positioning system
using beacon devices for practical pedestrian navigation on mobile
phone,” Lecture Notes in Computer Science, pp. 251–265, 2009.
[10] T. Gallagher, B. Li, A. G. Dempster, and C. Rizos, “A sector-based
campus-wide indoor positioning system,” Proceedings of Conference on
Indoor Positioning and Indoor Navigation (IPIN), 2010.
[11] K. Kaemarungsi and P. Krishnamurthy, “Properties of indoor received
signal strength for wlan location fingerprinting,” Proceedings of MobiQ-
uitous, pp. 14–23, 2004.
[12] A. Ward, A. Jones, and A. Hopper, “A new location technique for the
active office,” IEEE Personal Communications, pp. 42–47, 1997.
[13] N. B. Priyantha, A. Chakraborty, and H. Balakrishnan, “The cricket
location-support system,” Proceedings of ACM Mobicom, 2000.
[14] M. Hazas and A. Ward, “A novel broadband ultrasonic location system,”
Proceedings of UbiComp 2002: Fourth International Conference on
Ubiquitous Computing, vol. 2498, pp. 264–280, 2002.
[15] A. Mandal, C. V. Lopes, T. Givargis, A. Haghighat, R. Jurdak, and
P. Baldi, “Beep: 3d indoor positioning using audible sound,” Proceed-
ings of IEEE Consumer Communications and Networking Conference,
January 2005.
[16] A. Madhavapeddy, D. Scott, and R. Sharp, “Context-aware computing
with sound,” Proceedings of Ubicomp, 2003.
[17] V. Filonenko, C. Cullen, and J. Carswell, “Investigating ultrasonic
positioning on mobile phones,” 2010.
[18] F. Aĺvarez, T. Aguilera, J. A. Fernańdez, J. A. Moreno, and A. Gordillo,
“Analysis of the performance of an ultrasonic local positioning system
based on the emission of kasami codes,” In Proceedings of 2010
International Conference on Indoor Positioning and Indoor Navigation
(IPIN), 2010.
[19] P. Bihler, P. Imhoff, and A. B. Cremers, “Smartguide -a smartphone
museum guide with ultrasound control,” Procedia Computer Science,
pp. 586–592, 2011.
[20] T. Kasami, “Weigh distribution formula for some class of cyclic codes,”
Technical Report R-285, 1968.
[21] “https://developer.apple.com/xcode/.”
[22] C. Shannon, “Communication in the presence of noise,” Proceedings of
IRE, pp. 10–21, 1949.

View publication stats

You might also like