• No results found

3D localisation of nodes in a network utilising sound

N/A
N/A
Protected

Academic year: 2021

Share "3D localisation of nodes in a network utilising sound"

Copied!
36
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

Bachelor Informatica

3D localisation of nodes in a

network utilising sound

Wouter Vrielink (10433597)

September 18, 2015

Supervisor(s): Anthony (Toto) van Inge (UvA)

Inf

orma

tica

Universiteit

v

an

Ams

terd

am

(2)
(3)

Abstract

This thesis proposes a new distributed technique which uses two-way acoustic signals to estimate the distance between nodes. Acoustic signals can be easily detected and it is possible to receive multiple signals at different frequencies at the same time. This makes the method efficient as multiple distances can be estimated concurrently. Results of the experiments show that location detection using two-way acoustic signals might work. Future research must further improve the technique, and perform comparisons to other indoor localisation techniques.

(4)
(5)

Contents

1 Introduction 5

1.1 Localisation and Sensor Networks . . . 5

1.2 Background . . . 5

1.2.1 Common distance estimation techniques . . . 5

1.2.2 Common combination techniques . . . 6

1.3 Related works . . . 6

1.4 Localisation through two-way acoustic signals . . . 8

2 Design 9 3 Materials and methods 11 3.1 Materials . . . 11

3.1.1 Mbed . . . 11

3.1.2 Piezoelectric sensors . . . 12

3.1.3 Custom PCB and components . . . 13

3.2 Methods . . . 13

3.2.1 Testing the custom PCB . . . 13

3.2.2 Fast Fourier Transform . . . 14

3.2.3 Harmonics . . . 14

3.2.4 Peak detection . . . 14

3.2.5 Implementation . . . 14

3.2.6 Expectations . . . 15

3.3 Experiments . . . 15

3.3.1 Single frequency response experiments . . . 16

3.3.2 Two frequency response experiments . . . 16

3.3.3 Distance estimation experiments . . . 16

4 Results 19 4.1 Single frequency response . . . 19

4.2 Two frequency response . . . 20

4.3 Distance estimation . . . 21

5 Discussion and conclusion 23

Appendices 25

(6)
(7)

CHAPTER 1

Introduction

1.1

Localisation and Sensor Networks

The recent advances in radio and embedded system technologies have enabled the spread of wireless micro-sensor networks. Wirelessly connected nodes are released in many diverse envi-ronments to perform various monitoring tasks. These nodes are battery powered – sometimes mobile – with limited wireless bandwidth.

Location awareness and computing relative position of nodes in sensor networks is a difficult task. An ad-hoc network can often consist of a large number of deployed mobile nodes where the position of most of them is often unknown at the start. However, location awareness is often one of the most essential network parameters. It is important that the position of nodes is known to the whole network; data of which the origin of position is unknown is useless in most cases. In sensor networks where the sensors are mobile, a sensor node needs to know not only its own location, but also the location of its neighbours. This is not only important for preventing collision, but also important in cases where coverage of an area needs to be as high as possible. A method must be found that can provide a way to estimate the distances between a multitude of mobile nodes real-time and accurately. Since these mobile nodes are often run from a battery, the method must be power efficient and lightweight. Moreover, sensor networks often need a large amount of sensors. This means that the method must be cost efficient, easily and preferably automatically extensible, and thus also robust.

1.2

Background

The process of estimating the location of each node in a sensor network is known as localisation. Basic localisation of nodes can be divided in two stages [23]. The first stage is distance or angle estimation, where the distance or angle to a neighbouring node is directly derived from measure-ment. The second stage is distance or angle combining. Herein nodes combine information that was gained from measurements from neighbouring nodes to derive the estimated location.

1.2.1

Common distance estimation techniques

Methods that can be used to estimate the distance between nodes can also be classified as one of the following three techniques: Received Signal Strength Indicator (RSSI), Time of Arrival and Time Difference of Arrival (ToA and TDoA), and Angle of Arrival (AoA).

RSSI is a technique where the power of a signal to the receiver is measured. The strength of a signal decreases over distance. This is called propagation loss. Propagation loss can be calculated for certain signals, which means that the distance between a node and the source of the signal can be estimated. A weak spot for this technique is that it is fairly inconsistent and needs to be calibrated regularly as the environment changes. Differences in propagation loss due to air-humidity, air-density and temperature are common and need to be further researched [17].

(8)

ToA and TDoA are both techniques that make use of the propagation time of a message. The propagation speed of the message is known, the time the message takes to arrive is known, and thus the distance is known. A con of ToA is that the internal clocks of source and destination nodes need to be synchronised. It is a known issue on wireless devices that clock synchronisation is really difficult and only accurate to a certain extent [31]. Even if the clock is out of synchro-nisation by a millisecond, the distance error can be big (almost 300km for RF/light signals). TDoA does not have this issue since it uses two signals with different propagation speeds. The time-difference between the arrivals of these two signals can be used to determine the position of the source of the signal [8]. An advantage to these techniques is that any signal that has a known propagation speed can be used.

Angle of Arrival systems estimate the angle of an incoming signal and use geometric calcula-tions to pinpoint posicalcula-tions [19]. A disadvantage to this technique is that it costs more resources. In order to calculate the angle, multiple receivers are needed. Next to that there are more calculations involved in estimating the angle [11].

1.2.2

Common combination techniques

When the distance between nodes is known, a method must be found to calculate the relative positions of all nodes. This is called combining. A method to combine the estimates of distance is called circular lateration (see figure 1.1a)[3]. It locates nodes by creating a set of circles of which the radius is the distance calculated to a specific neighbour. The point where these circles cross is the position where the neighbour can be found.

A method to combine the estimates of angles is called triangulation (see figure 1.1b)[3]. Node positions are calculated trough trigonometry. This method can use the same extension as the previous. It is possible to extend this method to 3D; angles can be replaced by vectors.

In environments with noise, or if the measurements taken have a low accuracy, it would be wise to use something like Maximum Likelihood estimation (ML) [30]. This method tries to minimise the differences between the estimated distances (for example with Least Squares).

(a) Circular lateration: three circles (A, B, C) with their respective radii (ρA, ρB, ρC) are

shown. The point x is the derived position.

(b) Triangulation: the angles between A, B, and C can be defined, so the relative position of the points is known.

Figure 1.1: Two different methods of combining. Figures from [3].

1.3

Related works

Nodes that use WiFi technology to measure distances to their neighbours inside a network allow 3D positioning and real-time tracking of devices in the environment. These networks require three key capabilities: estimation of ranges between sensor nodes, network communications and positioning. Previous research has shown that the first two of these capabilities are feasible [16]. Adding Global Navigation Satellite Systems (GNSS), or the most commonly known GNSS: GPS, to mobile sensor nodes would not work. GNSS have no coverage in environments that

(9)

are shielded from satellite signals. Examples of these environments are indoors, under foliage in forests, or even under water. Yet another issue with GPS is the cost, both in power consumption as in materials. Sensor nodes – especially mobile ones – are often restrained in their battery life. GPS requires a lot of power and will thus reduce the life expectancy between charges [14].

In a relatively short time a large amount of studies have shown up regarding localisation in sensor networks using acoustics. These studies led to systems being developed and deployed. To understand why these studies were done one must first look at the precursor of positioning systems: the Global Positioning System (GPS) [12]. GPS was first deployed in 1993 and provides accurate, continuous worldwide, 3D position and velocity information. 24 satellites use the one-way ToA to determine the position of the satellite at the time of signal transmission and the propagation time of the signal. The technique requires that the receiver also has a clock. To prevent clock synchronisation from being required, the measurements are made to at least four satellites. If the clocks were synchronised there would be only three satellites required. As described before, despite being the most used localisation system world-wide, this system has its downsides: GPS cannot work indoors, and GPS has a relatively high power consumption.

This is why, recently, new studies have been done towards localisation techniques that work indoors using ultrasonic signals [13]. For example: the Cricket location support system [21], Active Bat [9], and DOLPHIN [10, 6].

The Cricket location support system allows applications on mobile and static nodes to learn their location by using listeners. These listeners hear and analyse information from beacons spread throughout a building. It uses a combination of infrared and ultrasound signals (TDoA) to calculate the location of the listener nodes. The system has an accuracy of 10 cm, however, it needs beacons to achieve this accuracy.

Active Bat was developed by Cambridge as a better and more accurate indoor positioning ultrasonic tracking technology than the previous Active Badges [32]. This method involves users and objects being tagged with ultrasonic tags named “bats”. These bats emitted periodic ultrasonic signals to receivers positioned on the ceiling. However, this requires a large number of receivers. This system is called ”room accurate”, but given enough beacons an accuracy of 8 cm can be achieved (16 beacons in a room of 75 m3).

Distributed Object Locating System for Physical space Inter Networking (DOLPHIN) is another ultrasonic positioning system. It sends and receives RF and ultrasonic signals (TDoA). DOLPHIN uses a distributed positioning algorithm to self-localise its nodes. A similar method to locate and orient a network of sensors is described in “In A Self-Localization Method for Wireless Sensor Networks” [18]. It uses a number of known source signals for calibration. Nodes that can estimate their position from these source points with a known position can now function as reference points for other nodes. This way, eventually, every node is a reference point and all positions are known.

AHLoS [23] is another ad-hoc system that uses RF and ultrasound like the Cricket, Active Bat, and DOLPHIN. However, it does not rely on a pre-installed infrastructure. It uses (like “In A Self-Localization Method for Wireless Sensor Networks”[18]) distributed localisation algorithms running at every node. This results in a system that only needs a fraction of the nodes to be aware of their location. Other than that, the location awareness will cascade through the network. Resulting in nodes that have estimated their location even though they are not within reach of a beacon node. It also ensures that all nodes have equal power consumption; all nodes have an equal role in calculating the positions.

A downside of these techniques is that they all need some form of beacon that has a known position. These beacons have to be positioned manually. This is an intensive task and therefore expensive. Another problem would be situations where it is impossible to set up beacons. To ensure that a technique will work in ample situations, it is important to increase flexibility by making it non-reliant on beacons.

In underwater sensor networks, determining the location of every node is important [2]. These networks could provide a early warning system for tsunamis, and assist in ecosystem monitoring, oil drilling, and military surveillance. There are relatively few localisation methods for underwater sensor networks. The reason for this being the large difference between the underwater sea environment compared to terrestrial environments. The variable speed of sound and the long propagation delays under water create problems that need to be solved.

(10)

An example of research that has had big social relevance is the paper “Sensor Network-Based Countersniper System” [26]. It provides a system consisting of large numbers of cheap nodes communicating through an ad-hoc wireless network that can locate shooters by finding the origin of sound of the shot.

Other localisation techniques that can be used are inertia (like in phones), magnets, near field communication (NFC), and optical recognition. The downside of inertia is that it requires a starting position to be known. For large numbers of sensor nodes this is a tedious task. Moreover, slight inaccuracies in the measurement of inertia can cause the estimated position values to drift over time. Meaning that resets to a known position must be frequent. Magnets or NFC both have fixed positions meaning that setup is required. These two systems also have a limited range, which makes extension to 3D environments difficult. Optical recognition requires an environment or reference points that are known. It is also difficult and costly (computation-wise) to estimate distances. Computation in general is fairly heavy for these systems.

The most common and promising localisation techniques rely on a form of sound or RF to locate nodes. Currently, there is no technique that is both accurate and does not need beacons.

1.4

Localisation through two-way acoustic signals

A new distributed technique is proposed which uses two-way acoustic signals to estimate the distance between nodes. The system relies on the relative distances between the nodes itself to calculate the relative position of each node. This way, the technique does not have a costly setup, since it does not need beacons to be set up manually (or at all). Moreover, the components used to communicate (speaker, microphone) are lightweight, cheap, and relatively power efficient since they do not need to be employed constantly. These features make this method especially interesting for unmanned airborne vehicles (UAVs).

Combination of the distances (see 1.2.2) between nodes can be done in different ways. A method must be chosen that can cope with the inaccuracies of the distance estimation.

(11)

CHAPTER 2

Design

To be able to communicate properly, the sensor nodes must be part of a network. Preferably, this network must be ad-hoc [20]. This way the nodes or small networks that were not in range of others can join a network of other nodes, thereby creating a network that is dynamic and robust [28, 22].

Then, distance between the nodes must be calculated. The technique used in this thesis is a time based technique (see 1.2.1). It uses two messages – one signal, one response – to calculate the distance between nodes. The signal is sent on a specific frequency, the response on another. This way there can be multiple nodes giving a response to the signal; they would all use different frequencies. What frequency is used for response and initial signal should be communicated through the ad-hoc network.

The frequencies must be detected before a response can be given. To do this, a method must be used that translates the sound over time to a frequency spectrum. This way, a frequency that has been sent will show a peak in the frequency spectrum. This peak must be detected by an algorithm that analyses the frequency spectrum. When the peak is detected on the expected frequency, the response can be sent. It is important that this is done as fast as possible and in a consistent amount of time. Inconsistency in the time it takes to percieve a signal will lead to inaccuracy in estimation of the distance.

Figure 2.1: Shows the two-way acoustic localisation technique time-line for two nodes. Node 1 is the node sending a signal, node 2 is awaiting the signal, and responds as soon as possible

The distance between two nodes (Dnodex−nodey) can be calculated using the propagation

speed of a signal. The technique proposed uses acoustic signals, with a known speed (Vacoustic).

Time is measured from the moment the signal is sent to the moment the response arrives (T = Tarrives− Tsent). From this, the time it takes the nodes to process the signal is subtracted

(12)

(Tprocess). Since the signals travelled twice the distance, the actual propagation time is calculated

by dividing the remaining time by two. The propagation distance can now be calculated by multiplying the propagation time with the propagation speed:

Dnodex−nodey=

T − Tprocess

2 ∗ Vacoustic (2.1)

After acquiring the distance between nodes, a graph can be build that contains the relative 3D locations of the nodes. Preferably, nodes should know where all the neighbouring nodes are in the network that they are in. Another importance is that the distances between nodes should be checked; this will improve accuracy. This can be done by measuring each neighbour of each node and then using a combination technique (see 1.2.2) combined with a form of error reduction. This error reduction tries to minimise the differences between the estimated distances.

Combination of the distances between nodes can be done in different ways (see 1.2.2). For example it is possible to opt for a less computational, less accurate method by not calculating graph edges to neighbouring nodes multiple times (the neighbouring node does not need to calculate a distance if another node already did it). Of course this could also be done dynamically to be as accurate as need be on that moment.

In this thesis, only the distance estimation will be implemented and tested. Combination techniques have been tested and proven in previous papers and experiments. [26, 2, 18, 23, 32, 10, 6, 9, 21, 13]

(13)

CHAPTER 3

Materials and methods

3.1

Materials

3.1.1

Mbed

As described in 2, consistency in computation time while estimating distances is important. Consistency of measurements will be difficult on devices that run an operating system. Operating systems often lack user-control over scheduling, or are really difficult to manage in such a way that user-programs have priority over other tasks. This makes it almost impossible to make sure tasks are performed directly when you want them to, creating situations in which you can not predict processing time. Therefore, it is easier to use a controller that can be fully programmed. This is why a micro-controller is used for this thesis.

The embedded micro-controller used is an ARM mbed lpc1768 (see figure 3.1). It has an ARM Cortex-M3 Core that runs on 96MHz, has 32KB RAM, and 512KB FLASH memory. The mbed has 40 pins and can be powered through USB (5V) or through a 4.5-9V powersupply. It was chosen because it has a wide variety of analog and digital inputs and outputs and the – for a micro-controller – relatively strong processor.

Figure 3.1: Scheme of the mbed. [https://developer.mbed.org/platforms/mbed-LPC1768/]

The mbed platform provides free software libraries, hardware designs and online tools. Code for the mbed can be compiled online (through the online compiler on the mbed-developer website) and can be programmed in C, C++ or ARM Assembly. The version of firmware used is rev 16457 since later versions hold a bug that prevents one from opening files while the mbed is running a program. This would make it harder to debug. Debugging was done by creating log-files or using

(14)

the USB serial port (also known as COM-ports) to communicate with TeraTerm on Windows. The mbed is placed on a printed circuit board (PCB) that was designed by DesignSpark; the MBED AnimatronicLab rev03. This PCB is not required, but makes plugging the hardware (PCB that holds the microphone, speaker, and amplifier) and testing easier. This is shown in figure 3.2.

The figure also shows the cables connecting the custom PCB with the mbed. The red cable supplies 3.3V to the PCB, it is connected to VOUT on the mbed. The yellow cables transport the signal of the microphone (to AnologIn pin 20) and to the speaker (from PwmOut pin 21). The black cable provides ground, it is connected to GND on the mbed. The analog signal of the micro-phone is translated to a digital signal by the Analog Digital Converter (ADC) positioned on the mbed. The signal that controls the speaker is provided by the Pulse Width Modulator (PWM). This PWM has a maximum frequency of 48MHz [https://developer.mbed.org/platforms/mbed-LPC1768/].

Figure 3.2: Picture of the mbed placed in the PCB. Top left the custom PCB holding the speaker (big black circle), and the microphone (small silver circle with black on top) with the circuit that amplifies its signal.

3.1.2

Piezoelectric sensors

A piezoelectric sensor is a device that uses the piezoelectric effect, to measure changes in pressure, acceleration, temperature, strain, or force by converting them to an electrical charge [27][7]. The piezoelectric effect herein is that the crystal inside the sensor compresses or decompresses, thereby creating sound. Applying an electric charge also compresses or decompresses the crystal. The main use of piezoelectric sensors in this thesis is to create and record sound. This is done with two different piezoelectric sensors; one that is operable as a speaker, and one that is used as a microphone.

(15)

3.1.3

Custom PCB and components

The custom PCB (see figure 3.3) holds the microphone with the circuit that amplifies its signal, and the speaker. The microphone and speaker both operate in the 100-16000Hz frequency range. The output of the microphone is amplified by an op-amp (OP77GP/OP77F) by 1000 times (this can be calculated by dividing the Ohmage feedback-resistor (1 million Ω) by the Ohmage of the input resistance (1000 Ω), which is 1000). This amplification is necessary since the output of the microphone would normally be under 50mV, which is too low for the mbed to properly detect a signal.

Figure 3.3: Schematic of the custom PCB.

3.2

Methods

3.2.1

Testing the custom PCB

The PCB was tested using three different devices: a tone generator, a two-channel oscilloscope, and a mobile phone (using the app SpecScope).

To test the speaker, the tone generator was used to provide a sinusoid wave to the speaker. The sound that the speaker produced was translated by the mobile phone to a frequency spectrum representation. The frequency that the speaker produced was the same as the frequency of the sinusoid wave that the tone generator generated.

To test the microphone, the tone generator was used to drive the speaker. The sound the speaker produced was directed at the microphone. The output signal of the microphone was fed into the oscilloscope. The oscilloscope displayed a weak signal (<50mV) that was similar to the tone produced by the tone generator.

To test the amplification circuit, the tone generator was used to provide a clean sinusoid wave. This wave was fed into the circuit and into one of the channels of the oscilloscope. The output of the amplification circuit was directed into the other channel of the oscilloscope. Now the two channels could be compared. The output was the same sinusoid wave, but amplified. The output signal had more noise than the input signal, since the noise also got amplified.

To test the microphone in combination with its amplification circuit, the previous two ex-periments were combined. The tone generator provided a tone to the speaker. The sound the speaker produces was directed at the microphone. The output signal of the microphone was fed into the amplification circuit. The output of the amplification circuit was directed to the oscilloscope. The oscilloscope now displayed the same tone as the one produced by the tone generator, this time having an amplitude of 0.5V. The oscilloscope also displayed that there was some noise (the wave was not “clean”).

(16)

3.2.2

Fast Fourier Transform

Fast Fourier transform (FFT) is an algorithm that computes the Discrete Fourier Transform (DFT) of a sequence of analog signals [4]. It converts a discrete signal (a signal that has values for a finite number of N numbers with a finite distance) to the frequency domain.

This thesis will use FFT to translate the discrete (the sample frequency is defined; discrete time, and the bit size for each sample is defined; discrete value) analog signal of a piezoelectric microphone to the frequency domain. The analog signal is digitised by the ADC (see 3.1.1). This will make it possible to find signals within the recording even if there is noise. To make a proper estimation of the frequencies involved in a spectrum, the sample size needs to be at least twice as high as the highest frequency that needs to be detected [5].

3.2.3

Harmonics

A harmonic of a wave is a component frequency of the signal that is an integer multiple of the fundamental frequency, if the fundamental frequency is f , the harmonics have frequencies 2f , 3f , 4f , ... etc.

3.2.4

Peak detection

Peak detection can be done in numerous ways. Since the peak detection will be run on an mbed, it needs to be efficient though still accurate. Also, it is important that the peak detection will automatically adjust to differences in the hardware. It is possible to expect a peak at a certain frequency, since this can be communicated through the network. This makes it possible to look at the frequency spectrum in “windows”. It is not necessary to check for peaks at places where you do not expect them. This will also rule out any harmonics and noise still present in the measurement. These windows are selected to be a certain amount of Hz below and above the frequency that is expected. If in this window, the highest peak is the peak of the expected frequency, the frequency is detected. This peak must also be at least 1.2 times as big as the average of the other peaks in that part of the spectrum. This way, it is ruled out that the peak can be detected in noise.

3.2.5

Implementation

Two separate programs were used in this study: one that provides the code to produce sound, and one that provides the code to record and interpret sound. The program that produces sound is provided as a C++ class and can produce a sinusoid wave according to commands given. It is very easy to use as it only needs three variables (floats) to function: frequency in Hz, time in seconds, and volume (0 to 1). It controls the speaker through PWM, that generates square waves to fake a sinusoid wave. This does cause higher frequency harmonics to be present. For higher frequencies (above 8kHz) these harmonics are less important since these harmonics are outside the operating spectrum of the microphones and speakers.

The second program consists of three main components. The first component is a C++ class that makes it possible for the ADC unit to only read from one pin instead of eight. The result of this is, that instead of a maximum sampling frequency of only 20kHz spread over the eight pins, one pin can be sampled at a frequency of over 160kHz. These samples can then be stored in the RAM of the mbed. The sampling frequency that is needed to make a DFT is at least twice the frequency of the signal that you want to be able to detect [5]. The microphones and speakers used work up to 16kHz, so a sampling rate of at least 32kHz is needed. The class offers the ability to go higher, but this is unwanted since the RAM of the mbed is limited (see 3.1), and can only store around 8000 samples before overflowing. Therefore a sampling frequency of 32kHz was chosen. The second component of the program is the code that does the FFT (see 3.2.2). It is written in AMD-assembly and provides a fast an optimised way to calculate the DFT.

The third component binds the other two components together. It prepares the file-system (internal storage) on the mbed and starts sampling data. After 0.1 second of buffering it stops sampling and a 1024 size FFT is performed by the assembly. For debugging purposes, there is

(17)

also an option to save the buffer to an audio file. The maximum size of this audio file is 80KB (any higher and the mbed would brick because of insufficient space), allowing for about one second of recording at 32000Hz sampling rate.

Once the FFT is done, the frequency spectrum can be analysed. Here, there is an option to save the output of the FFT in a CSV-file. It is also possible to send the data through the serial port to be received on a computer. If nothing would be saved on to the mbed, the process of buffering and computing the DFT would be able to run indefinitely. Something to be noted is that all frequencies are off by 5% (5% lower then they should be). This is a bug in the FFT (since the hardware was fully tested, see 3.2.1), but is of minor importance since the deviation is always 5%.

3.2.6

Expectations

The expectation is that the technique that uses two-way acoustic signals to estimate the dis-tance between nodes will work on small scale. However, pushing the frequencies close together (as described in 2) while trying to communicate with more nodes at the same time, could prove troublesome. The reason for this is that the restriction to embedded processors limits the com-putational power. This causes the sampling rate and the bin size of the FFT to be limited, which will in turn make the recordings more prone to noise.

Additionally, the mbed is limited in its power output. This means that the volume of the speakers will not be very loud; increasing speaker volume involves drawing more power from the mbed. Combined with the fact that acoustics will be in the 100-16000Hz range, since the used microphone and speakers can not operate outside these frequencies, probably means that noise is more prevalent in the recordings. This is caused by the ambient noise also found in this part of the acoustic spectrum, for example birds tweeting or car noises. Using microphones and speakers that operate at ultrasound would be less prone to noise. Other than that, frequencies that are higher up in the range of frequencies (100-16000Hz), will probably be less prone to noise). A solution would be not to use these lower frequencies.

Moreover, the microphone used has a very low signal output (as explained in 3.1.3 and 3.2.1). This is why the sound needs to be amplified. Strong amplification will also lead to amplification of noise. This can be solved by using a microphone that has a stronger output-signal.

Furthermore, the computation time must be considered. Since the mbed can not perform multiple tasks at the same time (see 3.1.1), computation time decreases the amount of time that can be spent listening for signals. Increasing the listening time too much, will decrease the response time, since time spent listening is not spent perceiving the signal. The goal is therefore to minimise the time spent computing and maximise the time listening, while keeping response time at a minimum.

Finally, due to the used PWM controller on the mbed (explained in 3.2.5), lower frequencies will echo through the DFT. For example, if 2000Hz would be recorded, the DFT could display peaks on every multiplication of 2000Hz (4000, 6000, 8000, ..., etc). These echoes are called harmonics (see 3.2.3) and are caused by a non-perfect sinusoid wave (caused by the PWM). [15].

3.3

Experiments

To test the two-way acoustic localisation technique, three experiments must be performed. The goal of the first of these experiments is to prove that frequencies can be detected at a multitude of distances, and which frequencies are suitable for use in the proposed technique. A frequency is suitable, if it does not show harmonics and if a peak can be detected on each of the distances. The goal of the second experiment is to get to know how close frequencies can be brought to each other without interfering. The result of this experiment tells the amount of nodes that can communicate with each other at the same time. The goal of the third and last experiment is to prove that the technique works and to show how accurate the technique is. This experiment also includes calculating the computation time.

(18)

3.3.1

Single frequency response experiments

For the single-frequency related experiments, frequencies where chosen from 1kHz to 16kHz with intervals of 1kHz. These frequencies were chosen because they lie within the spectrum of operating frequencies of both the speaker and the microphone.

Two of the mbeds were placed next to each other. The distance between the speaker and microphone of the mbeds was five centimetres. The FFT was run on one of the mbeds. First filling up the buffer for 0.1 second and then calculating the DFT, repeating this process ten times. Saving the CSV-files generated by the code on a computer. The speaker was driven by the other mbed, producing a continuous tone at the desired frequency. Before testing any of the frequencies, there was a test without anything producing sound. This was done to monitor the noise of the surroundings (for comparative measure). Next, each of the frequencies were tested in ascending order.

After this experiment was completed, the CSV-files were analysed. This was done by aver-aging all ten CSV-files and creating a graph. The y-axis of the graph was made logarithmic so that peaks of different heights can be found more easily. Furthermore, the first bin of the DFT (0-30Hz) was excluded from the graphs. This was done because this bin contains the frequency 0Hz and therefore has all the non-noise in it. The results from this experiment could result in excluding frequencies from the remainder of experiments. Frequencies that do not give a response at this distance do not have to be checked for the next distance, since these frequencies are not The experiment was repeated for a distance of 1, 2, 4, 6, and 8 metres. After the test at one metre, the CSV-files were analysed again. This could, again, result in excluding frequencies from the remainder of the experiments. The tests after one meter were not followed by analysing the CSV-files; these tests were done after all distance experiments.

3.3.2

Two frequency response experiments

For the two-frequency experiments, a set of frequencies was chosen that performed correctly over all the distances tested for the single frequency response experiment. Preforming correctly here is defined as giving a reasonable peak at a significant amount of the distances and not having any harmonic frequencies present. The frequencies chosen where the frequencies that had the biggest difference in Hz.

This experiment used three mbeds. Each of the mbeds had a microphone / speaker positioned at a distance of 1 metre from the others. The FFT was run on one of the mbeds, first filling up the buffer for 0.1 second and then calculating the DFT, repeating this process 10 times. Saving the CSV-files generated by the code on a computer. The speakers where driven by the other mbeds, producing a continuous tone at the desired frequencies. Before testing any of the frequencies, there was a test without anything producing sound. This was done to monitor the noise of the surroundings (for comparative measure).

After completion of each of the experiments, the CSV-files were analysed. If the frequency still gave a clear peak, a smaller frequency difference was chosen. If this was not the case, the experiment stopped. The method used here was the same as the method used in 3.3.1. Deleting the first bin (0-30Hz) and creating graphs. This experiment was not repeated for different distances, since that was not the aim.

3.3.3

Distance estimation experiments

For the distance estimation experiments, two optimal frequencies where chosen from the set derived in the two frequencies response experiments.

This experiment used two mbeds. Each of the mbeds had a microphone / speaker positioned at a distance of .5 or 1 metre from the other. The FFT was run on both of the mbeds. One of the mbeds was assigned to only listen for a signal at one of the optimal frequencies and then returning a response for 0.2 seconds. The other mbed was tasked with sending a signal for 0.1 second at the other optimal frequency, and then waiting for a response. This mbed also timed the response. This was done by starting a timer just before the signal was sent and stopping the timer after recognising the response. The FFT was done on a buffer of 0.001 seconds and the process was repeated 25 times. Timed-out responses (responses above .2 seconds) were discarded.

(19)

Signals that never got a response were also discarded. The numbers chosen in this experiment will be explained in the discussion (see 5).

Another part of the experiment measured the time it would take an mbed to process a signal (perform the FFT and detect peak). This time is measured from the moment the buffer was filled to the end of perceiving a possible signal. This process was repeated 100 times.

(20)
(21)

CHAPTER 4

Results

4.1

Single frequency response

The control measurements show that the environment had a constant amount of noise present (see figure 4.1). It is also shown that the lower part of the frequency spectrum shows more noise then the higher part, as the amplitude is higher in the lower part. This can be the effect of the surrounding noise, but also that the microphone or speaker could work better in this part of the spectrum.

The control measurements also show a dip at 8kHz. This dip can be caused by a fault in the hardware (either the amplifier or the microphone), but is not important in further measurements since it is constant.

Figure 4.1: The control measurements at all distances.

There where signs of harmonics in the measurements. The harmonics where primarily present in the lower frequency ranges (1kHz - 5khz). Interesting to see is that there where two types of harmonics present: repeating peaks at multiplications of the original peak (like in 1kHz, see A.1), and mirrored harmonics that appeared at 16kHz minus the measured frequency (like in the measurement for 4kHz, see A.4). The former is caused by the speaker (see 3.2.5 for an explanation). The latter is caused by the microphone.

For the distances further than 1 metre, frequencies between 6kHz and 14kHz where chosen. The other frequencies where excluded from further measurements. This is explained in 3.3.1.

The graphs of 6kHz and 14kHz both show one measurement that has more static noise then the others. The cause of this is unknown, but probably has to do with the grounding cable not connecting properly during those measurements. However, this does not matter, since the peaks are still visible.

The frequencies that showed no harmonics and showed a peak at every distance, were the frequencies between 7kHz and 13kHz (see figures A.7 to A.13). These frequencies are all suitable for the proposed two-way acoustic localisation technique.

(22)

4.2

Two frequency response

The figures below (4.2) show the results of the two frequency response experiments. It shows that 1kHz difference between two frequencies is still suitable for use, but that a difference of 500Hz causes the frequencies to interfere.

From this, it can be concluded that 7 signals (7kHz to 13kHz, with intervals of 1kHz) can be used concurrently.

(a) Shows the 9kHz and 13kHz measurement at a distance of 1m.

(b) Shows the 9kHz and 12kHz measurement at a distance of 1m.

(c) Shows the 9kHz and 11kHz measurement at a distance of 1m.

(d) Shows the 9kHz and 10kHz measurement at a distance of 1m.

(e) Shows the 9kHz and 9.5kHz measurement at a distance of 1m.

(23)

4.3

Distance estimation

Figure 4.3: This scatter-plot shows the measurements of the distance estimation experiments. The blue dots show all measurements. The orange dots are the lowest measurements of each distance. The blue line shows the fitted linear trend for the average of the measurements. The orange line shows the fitted linear trend for the lowest measurements of each distance.

The FFT worked better and more efficient than expected. This was also evident in the results of the tests with two frequencies, where multiple frequencies where able to be detected with a difference 1kHz. The expectation that computation time could be a problem was correct. To minimise the amount of time needed to perceive a sample, a buffering time of 0.001 second was chosen. The result of this is that computation takes more then two thirds of the total time needed for a single iteration of the algorithm (0.001 second of recording and then 0.0022 seconds of computation). This causes a significant loss in time that could have been spent buffering. A faster processor would solve this.

The results show that there is a spread over time in the measurements (see figure 4.3). The frequency chosen to signal was 9kHz, the frequency for the response was 13kHz. The time it took to perceive the measurement one time was constant: 2.2ms. The rate of failure was 20% at the first two distances, and 56% for the last distance.

This increase in rate of failure indicates that 1.5 metres is close to the edge of what the mbed is able to perceive. This is also seen in the spread of the measurements (which is also shown in the deviation in table 4.1). The spread increases when the distance gets larger.

Table 4.1 shows the average response time, estimated errors, and corresponding distances for all two-way measurements. To get the actual distance, the time spent measuring must be subtracted and the then remaining time needs to be divided by two.

Distance Response time Response distance Deviation Deviation distance 0.5 metres 0.121702s 41.41402m 0.011591s 3.944406 m 1 metre 0.136213s 46.35196m 0.013371s 4.550082 m 1.5 metres 0.145874s 49.63946m 0.016910s 5,754465 m

Table 4.1: This table shows the two-way average response times, estimated errors, and corre-sponding distances.

A first glance would say that the error in the distance estimation is relatively big. However, this is the two-way error estimation. The one-way error estimation is twice as low. Since a full cycle of buffering and computing takes 0.0032 seconds, part of the error will be caused by differences in perception speed. Perceiving a signal three cycles later will already cause an error of 0.01 second (0.0032 * 3). In addition, these results still include outliers. Outliers can be

(24)

found and discarded to provide a better estimation. This can be done with complex and less complex algorithms (RANSAC, calculating leverage or the Mahalanobis distance, etc.). It is also possible to only use only the lowest 5% of the measurements; a message can not be received before it is sent, so these measurements are probably the most reliable. Other than that, these are measurements between two nodes. A real life situation would often involve a larger amount of nodes, making it possible to apply ML (see 1.2.2).

It is also possible to estimate the error in measurement. The basis of this is provided by either of the formulae of the fitted lines in figure 4.3. However, since the deviation goes up, this will still be inaccurate over greater distances.

Measuring time is quite high; it takes five seconds (worst case; 0.2*25) to complete a full estimation. However, multiple estimations can be performed at the same instance. This can be done by having separate nodes respond over unique frequencies. The results (see 4.2) show that communicating can be done over at least two separate frequencies.

Based on these results, it can be concluded that using two-way acoustic signals to estimate the distance between nodes might work. The DFT proved better than expected and has shown interesting results. Acoustic signals can be detected and it is possible to receive multiple signals at different frequencies at the same time. This makes the method efficient as multiple distances can be estimated concurrently.

(25)

CHAPTER 5

Discussion and conclusion

This study examined whether the proposed new technique, that uses two-way acoustic signals to estimate the distance between nodes, could provide an alternative solution to indoor localisation. Results have shown that communicating trough acoustics is feasible.

It was expected that low frequencies would be less evident in the frequency analysis. This was confirmed by the results. Even though the tests where done in a relatively quiet environment, frequencies below 7kHz where proven to not be perceived as well as frequencies above 7kHz. This implies that using frequencies that are above the frequencies involved in ambient noise is recommended.

In contrast, the expectation that the speakers would not be loud enough to cover a large distance, was disproved. The results at 8 metres show that the microphone could still detect the sound produced by the speakers. Though obviously, the detected peaks would be higher when the speaker would have been louder. Similarly, the amplification of the sound produced less noise in the measurements than expected. There was visible difference to the signal. Finally, the results show the expected harmonics. Some of the harmonics are caused by the PWM controller of the mbed, because it can not create perfect sinusoid waves but produces square sinusoid-like waves.

In the results of the distance estimation (4.3) it was concluded that the deviation of the samples increases when the distance increases. This is likely to be caused by the piezoelectric-speaker. The speakers had a ”pop” while starting to produce sound. This pop resulted in unreliable perception by producing false frequencies and being of variable length (0.04-0.05 sec-onds). The latter probably being the most influencing factor in the varying of the estimated distance. After the pop, the speaker gets progressively louder over a short amount of time. This causes the frequency to be detected earlier on shorter distances, since it does not need to be as loud as for longer distances. This can be solved by using speakers that can be louder and more power (to get them louder faster). Fail rate can also be brought down by using a higher sample rate. Doing this will result in a higher amount of samples being buffered in turn resulting in a better DFT.

Earlier research has shown that GPS has no coverage in environments that are shielded from satellite signals. Other methods that do work indoors often lack precision, require a lot of beacons, need accurate clock synchronisation, or are not cost efficient.

Using two-way acoustic signals to estimate the distance between nodes might work. Acoustic signals can be detected and it is possible to receive multiple signals at different frequencies at the same time. This makes the method efficient as multiple distances can be estimated concurrently. Processing could be done by the processor that the sensor node already has; if it is possible to schedule tasks. If this processors power is lacking, an external embedded processor could be used. The method also requires the nodes to be able to communicate. This can be done through ad-hoc communication.

Future comparative research must prove this technique of localisation to be better than existing methods. The system must be further extended to make and test a network of nodes. Likewise, the accuracy of the method needs to be further tested. Experiments at further distances

(26)

will provide a better basis for an error-estimation-function. It is advised for these experiments to use better speakers and microphones, and a better processor. This will make measurements more reliable.

(27)
(28)
(29)

APPENDIX A

Graphs

The following graphs show the results of the frequency response experiments. The graphs are grouped per frequency in ascending order. The x-axis of every graph shows the frequency in Hz, ranging from 0 to 15000 with intervals of 1000. The y-axis shows relative values (this is why the axis has no name) given by the FFT on a logarithmic scale.

(30)

Figure A.1: This graph shows the measurements over all distances at 1kHz.

Figure A.2: This graph shows the measurements over all distances at 2kHz.

Figure A.3: This graph shows the measurements over all distances at 3kHz.

(31)

Figure A.5: This graph shows the measurements over all distances at 5kHz.

Figure A.6: This graph shows the measurements over all distances at 6kHz.

Figure A.7: This graph shows the measurements over all distances at 7kHz.

(32)

Figure A.9: This graph shows the measurements over all distances at 9kHz.

Figure A.10: This graph shows the measurements over all distances at 10kHz.

Figure A.11: This graph shows the measurements over all distances at 11kHz.

(33)

Figure A.13: This graph shows the measurements over all distances at 13kHz.

Figure A.14: This graph shows the measurements over all distances at 14kHz.

(34)
(35)

Bibliography

[1] Erik Berglund and Joaquin Sitte. “Sound source localisation through active audition.” In: IROS. Citeseer. 2005, pp. 653–658.

[2] Vijay Chandrasekhar et al. “Localization in underwater sensor networks: survey and chal-lenges”. In: Proceedings of the 1st ACM international workshop on Underwater networks. ACM. 2006, pp. 33–40.

[3] Inc Cisco Systems. In: Wi-Fi Location-Based Services 4.1 Design Guide. CISCO. 2008. [4] James W Cooley, PAW Lewis, and PD Welch. “The fast Fourier transform algorithm:

Programming considerations in the calculation of sine, cosine and Laplace transforms”. In: Journal of Sound and Vibration 12.3 (1970), pp. 315–337.

[5] Maurice Dodson. “Shannons Sampling Theorem”. In: Current science 63.5c (1992). [6] Yasuhiro Fukuju et al. “DOLPHIN: An Autonomous Indoor Positioning System in

Ubiq-uitous Computing Environment.” In: WSTFEUS. 2003, pp. 53–56. [7] Dip-Ing ETH Gustav Gautschi. Piezoelectric sensors. Springer, 2002.

[8] Fredrik Gustafsson and Fredrik Gunnarsson. “Positioning using time-difference of arrival measurements”. In: Acoustics, Speech, and Signal Processing, 2003. Proceedings.(ICASSP’03). 2003 IEEE International Conference on. Vol. 6. IEEE. 2003, pp. VI–553.

[9] Mike Hazas and Andy Hopper. “Broadband ultrasonic location systems for improved indoor positioning”. In: Mobile Computing, IEEE Transactions on 5.5 (2006), pp. 536–547. [10] Jeffrey Hightower and Gaetano Borriello. “Location systems for ubiquitous computing”.

In: Computer 8 (2001), pp. 57–66.

[11] Pedro. Juli´an et al. “A comparative study of sound localization algorithms for energy aware sensor network nodes”. In: Circuits and Systems I: Regular Papers, IEEE Transactions on 51.4 (2004), pp. 640–648.

[12] Elliott Kaplan and Christopher Hegarty. Understanding GPS: principles and applications. Artech house, 2005.

[13] Hakan Koyuncu and Shuang Hua Yang. “A survey of indoor positioning and object locating systems”. In: IJCSNS International Journal of Computer Science and Network Security 10.5 (2010), pp. 121–128.

[14] Akos L´´ edeczi and Mikl´os Mar´oti. “Wireless sensor node localization”. In: Philosophical Transactions of the Royal Society of London A: Mathematical, Physical and Engineering Sciences 370.1958 (2012), pp. 85–99.

[15] Li Li et al. “Multilevel selective harmonic elimination PWM technique in series-connected voltage inverters”. In: Industry Applications, IEEE Transactions on 36.1 (2000), pp. 160– 170.

[16] Rainer Mautz, Washington Y Ochieng, et al. “A robust indoor positioning and auto-localisation algorithm”. In: Positioning 1.11 (2007).

[17] Yu Song Meng, Yee Hui Lee, and Boon Chong Ng. “Study of propagation loss prediction in forest environment”. In: Progress In Electromagnetics Research B 17 (2009), pp. 117–133.

(36)

[18] Randolph L Moses, Dushyanth Krishnamurthy, and Robert M Patterson. “A self-localization method for wireless sensor networks”. In: EURASIP Journal on Applied Signal Processing (2003), pp. 348–358.

[19] Rong Peng and Mihail L Sichitiu. “Angle of arrival localization for wireless sensor net-works”. In: Sensor and Ad Hoc Communications and Networks, 2006. SECON’06. 2006 3rd Annual IEEE Communications Society on. Vol. 1. IEEE. 2006, pp. 374–382.

[20] Charles E. Perkins. Ad Hoc Networking. 1st ed. Addison-Wesley Professional, 2008. isbn: 0321579070, 9780321579072.

[21] Nissanka B Priyantha, Anit Chakraborty, and Hari Balakrishnan. “The cricket location-support system”. In: Proceedings of the 6th annual international conference on Mobile computing and networking. ACM. 2000, pp. 32–43.

[22] C Savarese J Rabaey and Koen Langendoen. “Robust positioning algorithms for distributed ad-hoc wireless sensor networks”. In: USENIX technical annual conference. 2002, pp. 317– 327.

[23] Andreas Savvides, Chih-Chieh Han, and Mani B Strivastava. “Dynamic fine-grained lo-calization in ad-hoc networks of sensors”. In: Proceedings of the 7th annual international conference on Mobile computing and networking. ACM. 2001, pp. 166–179.

[24] Yi Shang et al. “Localization from mere connectivity”. In: Proceedings of the 4th ACM international symposium on Mobile ad hoc networking & computing. ACM. 2003, pp. 201– 212.

[25] Xiaohong Sheng and Yu-Hen Hu. “Maximum likelihood multiple-source localization using acoustic energy measurements with wireless sensor networks”. In: Signal Processing, IEEE Transactions on 53.1 (2005), pp. 44–53.

[26] Gyula Simon et al. “Sensor network-based countersniper system”. In: Proceedings of the 2nd international conference on Embedded networked sensor systems. ACM. 2004, pp. 1– 12.

[27] Jayant Sirohi and Inderjit Chopra. “Fundamental understanding of piezoelectric strain sensors”. In: Journal of Intelligent Material Systems and Structures 11.4 (2000), pp. 246– 257.

[28] Ivan Stojmenovic. “Position-based routing in ad hoc networks”. In: Communications Mag-azine, IEEE 40.7 (2002), pp. 128–134.

[29] Christopher Taylor et al. “Simultaneous localization, calibration, and tracking in an ad hoc sensor network”. In: Proceedings of the 5th international conference on Information processing in sensor networks. ACM. 2006, pp. 27–33.

[30] Ledyard R Tucker and Charles Lewis. “A reliability coefficient for maximum likelihood factor analysis”. In: Psychometrika 38.1 (1973), pp. 1–10.

[31] Jana Van Greunen and Jan Rabaey. “Lightweight time synchronization for sensor works”. In: Proceedings of the 2nd ACM international conference on Wireless sensor net-works and applications. ACM. 2003, pp. 11–19.

[32] Roy Want and Andy Hopper. “Active badges and personal interactive computing objects”. In: Consumer Electronics, IEEE Transactions on 38.1 (1992), pp. 10–20.

Referenties

GERELATEERDE DOCUMENTEN

The power grid is controlled by a Supervisory Control and Data Acquisition (SCADA) network, which allows to centrally execute commands in remote locations and to maintain an overview

To answer the hypotheses seven concepts were constructed, being: interest in social issues, knowledge of the internet, constant access, website integrity, corporate reputation,

De studiepopulaties (n=641 en n=696) betroffen patiënten met door opioïden geïnduceerde constipatie (OIC) bij behandeling met een stabiele dagdosis opioïden over een periode van

De grote hoeveelheid vondsten (fragmenten van handgevormd aardewerk, huttenleem en keien) in de vulling doet vermoeden dat de kuil in een laatste stadium werd gebruikt

The research questions addressed how attitudes toward Muslim immigrants are affected by news framing (RQ1), and questioned the moderating roles of political knowledge and

De relevantie van de HoNOS- domeinen voor het monitoren van (psychische) klachten binnen de ambulante forensische GGZ werd benaderd door de spreiding van (psychische)

Op basis van het huidige onderzoek wordt deze bevinding niet ondersteund en lijkt het vertonen van meer ADHD-symptomen geen invloed te hebben op reactiesnelheid.. De

For the domestic herbivores of the Ginchi Vertisol area, native pastures and crop residues are the major sources of minerals and other nutrients, although whole crop or grains of