• No results found

Wireless electrocardiogram based on ultra-wideband communications

N/A
N/A
Protected

Academic year: 2021

Share "Wireless electrocardiogram based on ultra-wideband communications "

Copied!
79
0
0

Loading.... (view fulltext now)

Full text

(1)

UPTEC F 19007

Examensarbete 30 hp April 2019

Wireless electrocardiogram based on ultra-wideband communications

Maria Toll

(2)

Teknisk- naturvetenskaplig fakultet UTH-enheten

Besöksadress:

Ångströmlaboratoriet Lägerhyddsvägen 1 Hus 4, Plan 0

Postadress:

Box 536 751 21 Uppsala

Telefon:

018 – 471 30 03

Telefax:

018 – 471 30 00

Hemsida:

http://www.teknat.uu.se/student

Abstract

Wireless electrocardiogram based on ultra-wideband communications

Maria Toll

The goal for this master thesis is to develop a prototype that uses ultra-wideband (UWB) communications to wirelessly transfer electrocardiogram (ECG) data from an ECG measurement unit to an Android device (smartphone or similar), which is used to process and display the ECG signals.

The prototype should consist of two hardware nodes; (1) Node one having a ECG measurement unit (an AD8232 single lead heart rate

monitor), an UWB communication module (a Decawave DWM1000 module) and a microcontroller unit (an Arduino DUE); and (2) Node two having an Android device (an Android smartphone), an UWB communication module (a Decawave DWM1000 module) and a microcontroller unit (an Arduino DUE). On Node one the AD8232 monitor for ECG measurements is connected to an analog input (with an analog to digital converter

(ADC)) on the Arduino and the DWM1000 module is connected to the Arduino via serial peripheral interface (SPI). On Node two the

DWM1000 is connected to the Arduino via SPI to receive ECG data from Node one, and the Arduino is connected to the smartphone through a serial USB cable with an USB on-the-go adapter to send the ECG data to the smartphone, where it is filtered and displayed with an

Android application. The application has the potential to add, for example, ECG analysis for diagnosing heart activities with artificial intelligence (AI) and further transmit the ECG data for remote medical care.

The Arduino is programmed in Arduino IDE (integrated development environment) to handle ECG measurements and UWB communications (transmitting and receiving ECG data), which is limited to a single UWB channel because of limitations of the DWM1000 module. The Android application is created using Android studio, and it can process (with a notch filter) and display 1-12 channel ECG.

The prototype has been built and tested. The results show that a single lead ECG measurement can be sent via UWB communication to a smartphone to display in real time. Multiple data channels (1-12

analog inputs on the Arduino) can be multiplexed, transmitted and displayed in real time.

This thesis concludes that UWB has huge development potential, and will likely be used for various wireless devices in the future.

Handledare: Håkan Sjörling

(3)

Popul¨ arvetenskaplig sammanfattning

Idag g˚ar tekniken mer och mer ˚at att bli tr˚adl¨os, eftersom detta g¨or oss mer mobila och mindre beroende av trassliga sladdar. Ett vanligt f¨orekommande problem hos m˚anga tr˚adl¨osa produkter ¨ar batteritid, d¨ar str¨omf¨orbrukningen ofta ¨okar markant n¨ar det tr˚adl¨osa protokollet aktiveras.

Ett tr˚adl¨ost alternativ som ¨ar p˚a frammarsch ¨ar Ultra-wideband (UWB). F¨or den enskilda anv¨andaren, som inte ¨ar s¨arskilt insatt i hur radiokommunikation fungerar, s˚a verkar UWB vara v¨aldigt likt andra tr˚adl¨osa protokoll, s˚a som Wi-Fi eller Bluetooth. Dock ¨ar detta l˚angt ifr˚an sanningen. Ist¨allet f¨or att anv¨anda en b¨arv˚ag som moduleras i frekvens, som f¨or de smalbandade alternativen som tidigare funnits, s˚a skickas korta, bredbandade pulser, vilket g¨or tekniken v¨aldigt energisn˚al. F¨or att f¨olja de standarder som finns m˚aste dessa korta pulser ha en l˚ag ampltud, eftersom UWB annars riskerar att st¨ora ut annan tr˚adl¨os teknink, och tack vare dess ultrabreda bandbredd f˚ar datan ¨and˚a plats i pulserna.

Ett viktigt framtida omr˚ade f¨or UWB ¨ar medicintekniken, eftersom den l˚aga am- pletuden inte st¨or ut annan k¨anslig medicinsk utrustning som kan finnas i n¨arheten.

D¨arf¨or har m˚alet med detta projekt varit att ta fram en prototyp d¨ar UWB anv¨ands inom medicinteknik, i detta fall EKG (Elektrokardiogram). Dessutom ¨ar h¨alsotrenden stor nu, och flera privatpersoner anv¨ander sig av diverse medicinsk hobby-utrustning f¨or att h˚alla koll p˚a h¨alsan.

Prototypen skulle best˚a av tv˚a noder, d¨ar den ena g¨or de faktiska m¨atningarna som sedan skall anv¨andas f¨or att rita ett EKG, medan den andra ¨ar kopplad till en smartphone med en Android-applikation skapad f¨or projektet, d¨ar EKG:t ritas upp. De tv˚a noderna kommunicerar med varandra via UWB med hj¨alp av varsin DWM1000-modul fr˚an Decwave. Applikationen skulle vara baserad p˚a en tidigare applikation med ett liknande syfte.

B˚ade prototypen samt applikationen uppn˚adde kravst¨allningen som gjordes i b¨orjan av projektet, f¨orutom en punkt, ang˚aende flerkanalskommunikation, som str¨oks snabbt p˚a grund av h˚ardvarubegr¨ansningar.

(4)

Acknowledgments

First I want to send a big thank you to H˚akan Sj¨orling and Kent Zetterberg, for letting me do my master thesis work at Syntronic G¨avle.

A huge thank you to the thesis supervisor Ping Wu. Without you this project would not have been possible. Your help along the way has been invaluable. I also want to thank Oskar Flink, for helping me getting started, and Joakim Lindstr¨om, for exchanging ideas along the way.

Lastly I would like to thank Anton Sj¨oberg, for being a good sport when I glued electrodes to him, for the sake of this project. Also, just for the overall support during this project. Thank you.

(5)

Contents

1 Introduction 1

1.1 Background . . . 1

1.2 Purpose of project . . . 1

1.3 Project specifications . . . 2

1.4 Method . . . 3

1.5 Outline . . . 3

2 Ultra-wideband communication 4 2.1 A brief history of radio communication and UWB . . . 4

2.2 The basics of Ultra-wideband . . . 5

2.2.1 FCC regulations and definitions . . . 5

2.2.2 Key benefits of ultra-wideband . . . 6

2.2.2.1 Shannon’s theory . . . 7

2.3 Signal waveform and modulation . . . 7

2.3.1 Signal waveform - Gaussian pulse . . . 7

2.3.2 Modulation . . . 8

2.3.2.1 Burst/Pulse position modulation (BPM/PPM) . . 8

2.3.2.2 Binary Phase-Shift Keying (BPSK) . . . 9

2.3.2.3 Pulse Amplitude Modulation (PAM) . . . 10

2.4 UWB spectrum - Interference and coexistence . . . 10

2.5 IEEE 802.15.4-2011 communication standard . . . 11

2.5.1 Functional overview . . . 12

2.5.1.1 Data transfer . . . 13

2.5.1.2 CSMA/CA . . . 14

2.5.1.3 ALOHA mechanism . . . 14

2.5.1.4 Frame acknowledgement . . . 15

2.5.1.5 Error correction - SECDED . . . 15

2.5.1.6 Error correction - CRC . . . 15

2.5.1.7 Power consumption . . . 15

2.5.1.8 Security . . . 15

2.5.2 MAC - Medium access control . . . 16

2.5.2.1 MDPU . . . 17

2.5.3 PHY - Physical layer . . . 18

2.5.3.1 UWB channel definitions . . . 18

2.5.3.2 UWB PPDU . . . 19

2.5.3.3 BPM-BPSK Modulation . . . 20

(6)

3 Electrocardiogram - ECG 22

3.1 Bioelectromagnetism and the electrical system of the heart . . . 22

3.2 12-lead electrocardiogram . . . 23

3.2.1 The Einthoven leads . . . 24

3.2.2 The Wilson central terminal . . . 26

3.2.3 The Goldberger Augmented leads . . . 27

3.2.4 The precordial leads . . . 27

3.2.5 Combining the 12 leads . . . 28

3.3 Interpreting an Electrocardiogram . . . 28

3.3.1 The ECG segments . . . 29

3.3.2 Step by step interpretation . . . 29

3.4 Filtering out disturbances . . . 31

4 Hardware implementation 32 4.1 Overview of prototype . . . 32

4.2 Android smartphone and USB On-The-Go . . . 34

4.3 Arduino Due . . . 35

4.4 DWM1000 . . . 36

4.5 SparkFun AD8232 Single Lead Heart Rate Monitor . . . 39

5 Software implementation 41 5.1 IDE - Integrated development environment . . . 41

5.2 Logical overview for the system . . . 41

5.3 Android application programming . . . 42

5.3.1 Main activity . . . 43

5.3.2 Settings menu . . . 44

5.3.3 Graph menu . . . 45

5.3.4 Filtering . . . 46

5.3.5 Communication menu . . . 46

5.4 Arduino programming . . . 47

5.4.1 UWB-Receiver . . . 47

5.4.2 UWB-sender . . . 50

6 Results and discussion 51 6.1 The Prototype . . . 51

6.1.1 Results . . . 51

6.1.2 Discussion . . . 52

6.1.2.1 UWB technology lacking in smartphones . . . 52

6.1.2.2 Sensitivity and disturbances . . . 55

6.1.2.3 User friendliness . . . 55

6.1.2.4 Multi-channel . . . 55

(7)

6.2 Android application . . . 56

6.2.1 Results . . . 56

6.2.2 Discussion . . . 60

6.3 UWB for medical applications . . . 61

7 Conclusions and future development 62 7.1 Conclusion . . . 62

7.2 Future development . . . 62

7.2.1 Prototype . . . 62

7.2.2 Android application . . . 63

A Appendix: Generation of ECG signal 64

(8)

List of Abbreviations

ADC Analog-to-Digital Converter. 33

ASCII American Standard Code for Information Interchange. 47 BPM/PPM Burst/Pulse Position Modulation. 8

BPSK Binary Phase-Shift Keying. 8, 9 CAP Contention Access Period. 13 CCA Clear Channel Assessment. 14 CFP Contention Free Period. 13 CRC Cyclic Redundancy Check. 15

CSMA/CA Carrier Sense Multiple Access with Collision Avoidance. 13, 14 ECG Electrocardiogram. 1, 22

FCC Federal Communications Commission. 4, 5 FCS Frame Check Sequence. 17

FFD Full-Function Device. 12 FIR Finite Impulse Response. 31

GPIO General-Purpose Input/Output. 37 GTS Guaranteed Time Slot. 13

IDE Integrated Development Environment. 41

IEEE Institute of Electrical and Electronics Engineers. 4 IIR Infinite Impulse Response. 31

LR-WPANs Low-Rate Wireless Personal Area Networks. 11 MAC Medium Access Control. 11, 16

MCU Microcontroller Unit. 36

(9)

MFR MAC Footer. 17 MHR MAC Header. 17

MPDU MAC Protocol Data Unit. 17 PAM Pulse Amplitude Modulation. 8, 10 PAN Personal Area Network. 12

PHR PHY Header. 19 PHY Physical Layer. 11, 18

PPDU Physical Protocol Data Unit. 15, 19 PRF Pulse Repetition Value. 20

PSD Power Spectral Density. 5 RF Radio Frequency. 36

RFD Reduced-Function Device. 12

SECDED Single Error Correct, Double Error Detect. 15, 20 SFD Start Frame Delimiter. 19

SHR Synchronization Header. 19 SNR Signal-to-Noise Ratio. 4, 7 SPI Serial Peripheral Interface. 32

UART Universal Asynchronous Receiver/Transmitter. 35 USB OTG USB On-The-Go. 35

UWB Ultra-wideband. 1, 4–6

(10)

1 Introduction

In this section information about the thesis project is presented. This includes the background, the purpose and specifications for the project, the method which was used and the outline of the report.

1.1 Background

Today’s technology is moving more towards wireless, since plugging in your device of choice is an extra step, and connected cables are in the way. But is the wireless technology developing rapidly enough?

Two of the most known and used wireless communication technologies are Wi-Fi and Bluetooth, which have been around since the 1990’s, but now a new alterna- tive is rapidly developing: Ultra-wideband (UWB). For an everyday user, who is not familiar with how wireless communications work, UWB seems very similar to Bluetooth. It is a way to connect two or more slave devices, such as a speaker or a keyboard, to a master device, with rapid transmission and a fair range. However, when you look closer the technology differs significantly. The signals are transmit- ted in very different ways, which is explained more closely in section 2.

Another area of technology which is gaining interest from the public is health and medical related technology. People are becoming more and more interested in health, and the technology is following along this development. Nowadays, when almost everyone owns and uses a smartphone (in Sweden 74 % of the population is a smartphone user[1]), it is easier than ever to look after your health. Do you need to keep track of what you eat? There is an app for that. Do you need to see statistics of how far and where you have run this month? There is an app for that.

You can have a Wi-Fi connected scale that gives you statistics for your weight and a Bluetooth smart watch that tracks your pulse. At the same time the most common cause of death worldwide is cardiovascular disease, around 31 % in 2015.[2]

This project aims to combine the rapidly developing technologies in the areas of wireless communication and medical engineering. The focus will lay on utiliz- ing the upcoming wireless technology UWB to transmit Electrocardiogram (ECG) signals.

1.2 Purpose of project

The purpose of this project is to develop a prototype for an ECG device with UWB communication, along with an easy to use Android application, where the ECG data should be processed and displayed in real time.

(11)

The prototype consists of two separate parts. The first one is intended to per- form ECG measurements (one to twelve leads) and transmission, and the other one is to receive the data and then to process and display the data on an Android device (smartphone or similar). UWB communications are to be used for trans- ferring the signals between the nodes.

The Android application should be able to interact with and receive information from the UWB device via USB serial communication, handle this information, fil- ter it (if needed) and plot a real-time ECG from the information. It is based on an application from a previous master thesis.[3]

Figure 1.1: A simplified illustration showing the general idea of the project, here with a 12 lead measurement.

1.3 Project specifications

The final Android application should fulfill the following:

• Allow the user to choose the number of channels/measurements/leads

• Have a way for the user to start the measurements

• Be able to display ECG measurements in real-time

• Be able to print received messages (if required)

• Filter the measurements

(12)

The prototype should fulfill the following:

• Node one (receiver) should be able to communicate with an Android unit, preferably a smartphone

• The two nodes should be able to communicate with each other using UWB communication

• Node two (sender) should do ECG measurements

• Node two should pack and send the data according to formatting set by the application, allowing ”multi-channel” (multiplexing)

The project should be based on an earlier master thesis [3] and be executed at Syntronic G¨avle.

1.4 Method

Since the thesis was built on a previous project the early work consisted mainly of understanding and troubleshooting the earlier project, along with a literature study, to get to know the technology at hand. The early focus was on the specific hardware and UWB in general.

After the troubleshooting the hardware used in the previous project was ex- changed, and the implementation of this hardware was executed. This included some minor soldering, but mostly wiring on a breadboard.

When the hardware was connected, the software was implemented for it, as well as for the application. The software development part was, along with the literature study, the substantial part of the project.

1.5 Outline

After this introduction section a theory section on UWB technology is presented in section 2, aiming to give the reader the information needed on the subject. Section 3 presents theory on electrocardiograms and the basics of bioelectromagnetism.

The following section, section 4, describes the hardware used and how it was implemented, and then section 5 explains how the software was implemented.

Then follows the results and discussion of these results, among other things, in section 6, some conclusions and future developments in section 7. There is also an appendix, giving some further detail on ECG.

(13)

2 Ultra-wideband communication

This section of the thesis presents theory regarding UWB communication. It can be seen as an introduction to UWB technology which describes the background and development potential of it. UWB is sometimes referred to as impulse radio, due to the short pulses used for transmissions. [4]

2.1 A brief history of radio communication and UWB

Although UWB might seem like a new form of radio technology some would say that it is the exact opposite.

The earliest form of radio communication was created in 1886, when H. R. Hertz proved the existence of electromagnetic waves, using a spark-gap transmitter. Ra- dio technology rapidly improved during the late 19th century, and very soon long distance radio was created. The fist long distance transmission was done by G.

Marconi, who transmitted the Morse code for the letter S. The message rate of Morse signaling was about 25 words per minute, which is roughly equal to 20 bps.

This means that the information bandwidth of the early radio signals were quite small, in the range of 10s of Hertz. The actual transmitting frequency, however, was very wideband, usually some 100s of kHz. This meant that the channels used became very noisy due to the unnecessarily large parts of the spectrum that these signals occupied. The receivers was also collecting much more information than necessary, making it difficult to the decipher the actual message that was sent, i.e.

the Signal-to-Noise Ratio (SNR) was low.

The technologies of AM radio, where a continuous wave with modulated amplitude was used, and FM radio, where the frequency of the carrier wave was modulated, took over. It was not until the 1960s and 1970s that the real research on UWB, or pulse radio as it was more commonly known, really started. The application was mainly military in form of impulse radars, and was kept under the radar (no pun intended) until the 1990s, due to the advancements in microprocessing and fast switching semiconductors. [5]

Due to the increasing interest and development of UWB the Federal Commu- nications Commission (FCC) found it necessary to set some rules and guidelines, and in 2002 the first report and order for commercial use was approved. Various teams has been set in place to develop the standards regarding UWB, and since September 2011 the IEEE.802.15.4-2011 standard by the Institute of Electrical and Electronics Engineers (IEEE) is in use (more on that in section 2.5).

(14)

2.2 The basics of Ultra-wideband

As mentioned in the previous section, a continuous carrier wave modified by either amplitude or frequency is used to convey information in ”classic” radio. For UWB, its early name is a clue for how it works; Pulse radio. The signals are transmitted as short pulses, in the order of nano seconds (depending on the chosen frequency), with a broad spectrum and a very small energy content, i.e. low Power Spectral Density (PSD).

2.2.1 FCC regulations and definitions

UWB, just like other wireless communication, is regulated by the FCC in the United States. Their rules provide a collection of definitions for UWB. One of these deciding factors is that the signal must have a bandwidth of at least 500MHz.

Another way the FCC classifies radio signals as UWB is to look at the fractional bandwidth, which is a measure of how wideband a signal is. The definition of UWB is that the fractional bandwidth, Bf, of the signal is over 20 %. If the fractional bandwidth is lower than 1 % it is defined as a narrowband signal, and anything between UWB and narrowband is defined as wideband. The fractional bandwidth depends on the bandwidth and the center frequency in the following manner

Bf = BW fc

100% = (fh− fl)

(fh+ fl)/2 (2.1)

where BW is the bandwidth, fcis the center frequency, which is calculated with lower cutoff frequency fland the upper cutoff frequency fh. A visual representation of these values is shown figure 2.1, where a signal x(t) is shown in both time- and frequency domain. [6, 5]

Figure 2.1: A signal in time domain (left) and frequency domain.

(15)

2.2.2 Key benefits of ultra-wideband

As mentioned, UWB has a wide bandwidth, which is a result of the narrow pulses.

This bandwidth allows much more information to be conveyed with these short pulses rather than longer pulses over a given time interval, which leads to an energy efficient system, due to the fact that sending a short pulse needs less energy than transmitting a narrowband signal which requires a longer pulse. The wide bandwidth also allows high data rates, which many see as one of the main benefits for this technology. The data rates can be over 100 Mbps, and theoretically even higher speeds for shorter distances. In table 2.1 some different data rates for both wireless and wired communication are shown. As one can see, UWB can, in some conditions, even match the speed of wired USB 2.0 communication.

Speed (Mbps) Standard

480 UWB, USB 2.0

200 UWB (minimum 4m), 1394a/Firewire (4.5m)

110 UWB (minimum 10m)

90 Fast ethernet

54 802.11a

20 802.11g/Wi-Fi

11 802.11b

10 Ethernet

1 Bluetooth

Table 2.1: Data speeds for various standards. [6]

The short length of the pulses also gives them a fine time resolution, which makes them easy to filter out, and simple to differentiate from unwanted multi- path reflection. This also makes it easier to differentiate signals from each other, meaning less interference between signals. The low frequency components of the UWB pulses enables the signals to propagate through materials common in walls, like cement and bricks.

Due to the ability to directly modulate a pulse onto an antenna, the technol- ogy for UWB is cheap to produce relative to sinusoidal transceivers. These classic transmitters and receivers need a larger amount of components, which increases the price. [5]

(16)

2.2.2.1 Shannon’s theory

In information theory, a common way to evaluate communication systems is using Shannon’s capacity equation. By using the SNR and a channel’s bandwidth one can calculate the maximum channel capacity, a value which shows the maximum transmission rate for a communication channel. Shannon’s equation is given by

C = Blog2

 1 + S

N



(2.2) where C denotes the maximum channel capacity (bps), B the channel band- width (Hz), S the signal power (W) and N the noise power (W), which gives the SNR. As one can see, there are three variables that affect the channel capac- ity. One can increase the bandwidth, increase the signal strength on decrease the noise. One other important thing to note is that it increases logarithmically with the signal strength and linearly with the bandwidth, i.e. it is more effective to adapt the bandwidth. This is very beneficial for UWB, since its bandwidth is ultra-wide, leading to a high maximum channel capacity, without needing a strong signal strength. [5]

2.3 Signal waveform and modulation

The UWB waveform differs a lot from the classic radio signals. Where the classic radio uses a carrier signal, which is modulated in frequency in order to convey the digital information, UWB send blasts of information, referred to as impulse modulation.

2.3.1 Signal waveform - Gaussian pulse

The UWB signals can have any shape, but the most common is a Gaussian shape, since this is easy to generate by quickly switching a transistor on and off. It as a square pulse, which is shaped by the limited rise and fall times for the short UWB pulse, as well as the filtering effects of the antennas. The pulse shape approximates the Gaussian function curve, which fulfills the Gaussian equation

G (x) = 1

√2πσ2e12(x−µσ )2 (2.3) where µ is the expected value and σ2 is the variance. The resulting pulse will not be exactly rectangular, instead the edges of the curves will be smoothed off.

An example of this is shown in figure 2.2.

(17)

Figure 2.2: A plot of a Gaussian pulse and its frequency spectrum.

2.3.2 Modulation

Although the pulses are able to contain much information due to its wide band- width, a sequence of pulses is needed to convey all the information needed for most cases. For UWB a number of different type of pulse modulations are used, where the most common are Burst/Pulse Position Modulation (BPM/PPM), Pulse Am- plitude Modulation (PAM) and Binary Phase-Shift Keying (BPSK). These can be grouped in time-based and shape-based modulation techniques, where only PPM is time-based.

2.3.2.1 Burst/Pulse position modulation (BPM/PPM)

The most common type of modulation in literature is BPM/PPM, which, as pre- viously mentioned, is a time-based modulation. The pulses convey information by sending the short pulses with a delay, in reference to the regular time interval.

This is done by creating pulses si by defining a basis pulse with an arbitrary shape p(t), where t is time. The modulation factor is the delay parameter τi.

(18)

si = p (t − τi) (2.4) An example of this is shown in figure 2.3. In this figure a BPM/PPM signal is shown in reference to an un-modulated signal. Here, a pulse shifted ”forward”

equals 1 and a pulse shifted ”backwards” equals 0. The biggest advantage with this method is the simplicity of it. Adding a delay to a signal is an easy way to control the message. However, since UWB pulses are incredibly short, extreme precision is necessary to accurately modulate the pulses. [6]

Figure 2.3: Burst position modulation and Binary Phase-Shift Keying. (a) is an un-modulated signal, (b) is a BPM signal and (c) is a BPSK signal. [6]

2.3.2.2 Binary Phase-Shift Keying (BPSK)

BPSK, or Bi-Phase Modulation, is a way of conveying digital data by modulating the pulse shape. A binary system is created by using a basis pulse p(t) which is modulated with the pulse weight σi in the following manner

si = σip(t), σi = 1, −1 (2.5) For this binary system, σi can have two values; ±1, meaning that s1 = p(t) and s2 = −p(t). An illustration of this is shown in the previous section in figure 2.3. There, a ”normal” pulse represents a 1 and a reversed pulse represents a 0.

A benefit of BPSK is that σ is zero-mean, which makes spectral peaks easy to

(19)

filter out, and it is able to convey information continuously, which makes it more efficient than PPM, which does not transmit continuously.

2.3.2.3 Pulse Amplitude Modulation (PAM)

Another type of shape modulation is PAM. For this modulation the basis pulse p(t) is modulated by a pulse shape parameter σi, which has a value greater than zero

si = σip(t), σi > 0 (2.6) This is a less preferred modulation for UWB communication, since the main reason for the use of its sinusoidal counterpart is its ability to convey information with a smaller bandwidth due to its high amplitude. This would contradict the main benefit of UWB.

Figure 2.4: Pulse Amplitude Modulation. (a) is an un-modulated signal and (b) is a PAM signal. [6]

2.4 UWB spectrum - Interference and coexistence

The FCC granted the spectral mask 3.1-10.6 GHz to UWB, a span which overlaps other communication protocols, for example 802.11a, shown in figure 2.5. This overlay leads to two problems that needs to be solved, which can be summarized with two words: interference and coexistence.

The UWB signals are not allowed to affect the signals from the overlapping spec- trum, nor should they be effected by these competing signals. 802.11a, WLAN, or as it is more known Wi-Fi, is strictly regulated. Therefore the effect from UWB

(20)

onto 802.11a needs to be less than the legal maximum, while UWB just need to work in the presence of these interferences. The first problem is solved within the restrictions of UWB. The low amplitude required lies beneath the noise floor of the WLAN, hence it will not be effected. [6, 5] For the other way around, UWB has inherent immunity against narrowband interference, due to very short time windowing used in the correlation receiver. Unfortunately, due to the strict re- strictions on the power spectral density allowed for UWB, this immunity might not be in full effect against strong narrowband interference, and the UWB receiver could potentially become jammed. This could happen if, for example, a WLAN device operated closely to a UWB receiver. [6]

Figure 2.5: Spectrum allocated to various wireless standards. UWB spectrum shown in lime green.

2.5 IEEE 802.15.4-2011 communication standard

A standard is an established norm or recommended practice in a specific area.

They are used to ensure that the use of technology meet certain demands. In communication technology important factors are usually interference with other communication devices.

The IEEE 802.15.4 standards deals with Low-Rate Wireless Personal Area Net- works (LR-WPANs), which are used to convey information over short distances.

From the beginning the goal of it was to produce a standard which enabled low- cost and low-power communications. It specifies the Physical Layer (PHY) and the Medium Access Control (MAC) for UWB communications (among other pro- tocols). [7]

(21)

The simplest form of a WPAN is two devices communicating in the same channel, where at least one needs to be a Full-Function Device (FFD). A FFD is able to act as a Personal Area Network (PAN) coordinator. Devices not acting as coordina- tors are referred to as Reduced-Function Device (RFD). These are used for simple tasks, that only requires small amounts of data, and can only communicate with one FFD at a time. [7]

Figure 2.6: A figure showing Star topology and Peer-to-Peer topology.

These network can use one of two topologies; Star or Peer-to-Peer (both shown in figure 2.6). In star topology a single PAN coordinator is used, and several de- vices communicates with it. The peer-to-peer also uses a PAN coordinator, but in this case all devices can communicate with each other, assuming they are in range.

In both topologies, all devices has a unique address.

In the networks, data can be transferred in three different ways. Either to a coordinator, from a coordinator or Peer-to-Peer. For Peer-to-Peer networks all three types are used, but in Star topology only the first two mentioned are uti- lized. [7]

Since this project only uses two nodes, which both collect and transmit infor- mation, it can be seen as a very simple peer-to-peer network.

2.5.1 Functional overview

An optional use for a superframe structure is allowed for this standard. The co- ordinator defines the superframe, which is bounded by network beacons, i.e. one beacon is sent before the superframe and one is sent after. Networks using this

(22)

format are referred to as beacon-enabled PANs. These beacons are used to iden- tify the PAN, to synchronize the devices and describe the superframes. If the transfer does not need synchronization, the beacon-enabled PAN can chose to not use the beacon for normal transfer, however it is still needed for PAN identification.

The superframes are divided into 16 equally long time slots. The coordinator also has the option of defining an inactive period, where the device can enter a low-power mode. The 16 slots of the active period can in turn be grouped in two periods; the Contention Access Period (CAP) and the Contention Free Period (CFP). Any devices transmitting during CAP uses slotted Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA) or ALOHA mechanism, where they compete with other devices. For applications which needs a specific data band- width or low-latency applications, Guaranteed Time Slot (GTS) are used. GTS:s are portions at the end of the active frame, immediately after the CAP, which are dedicated to that specific purpose. It is these GTS:s that form the CFP. The PAN coordinator allocates up to seven GTS:s. [7]

2.5.1.1 Data transfer

As mentioned, data can be transferred in three different ways; to a coordinator, from a coordinator or Peer-to-Peer.

When transmitting to a coordinator, the device first listens for the network beacon.

When (or if) the beacon is found, a synchronization to the superframe structure is done. The data frame is then transmitted according to the time frame set by superframe. If a nonbeacon-enabled PAN is used, the data frame is simply trans- ferred to the coordinator, without the need of synchronization. For both cases, an acknowledgement is sent from the coordinator when the data is received success- fully, if requested.

When data should be transferred from a coordinator in a beacon-enabled PAN, the network beacon indicates that a message is pending. The target device peri- odically listens to the network beacon, and if a message pending is discovered, a MAC command requesting the data message in transmitted. If this is successfully received by the coordinator, an acknowledgment frame is transmitted and then the pending data frame. If requested, an acknowledgement is sent from the coor- dinator when the data is received successfully by the target device. The message is then removed from the beacon.

When data should be transferred from a coordinator in a nonbeacon-enabled PAN,

(23)

the coordinator stores the data and awaits an appropriate request. The data is re- quested in the same way as for the beacon-enabled PAN, and an acknowledgement follows. If a data frame is pending, this frame is transmitted by the coordinator, otherwise a data frame with a zero-length payload is transmitted instead. The no data pending message could also be done in the acknowledgement. Just as for the other cases, an acknowledgement can be transmitted if the data is received successfully by the target device and requested.

For peer-to-peer, all devices communicate with all other devices in its range. The devices will either synchronize with each other or receive constantly. When receiv- ing constantly, the device can simply transmit its data. The synchronization case, however, is beyond the scope of this standard. [7]

2.5.1.2 CSMA/CA

CSMA/CA is an access mechanism used to enable multiple users to transmit over the same medium, such as a specific radio channel. Two different types of this mechanism in utilized in IEEE 802.15.4-2011 LR-WPAN; slotted and unslotted.

As mentioned in section 2.5.1 slotted CSMA/CA is used for beacon-enabled PANs.

Unslotted are used for nonbeacon-enabled PANs.

Both methods use a backoff time period, which is a random amount of time for which a device waits. For the slotted CSMA/CA the backoff periods are aligned with the start of the beacon transmission, and all of the periods within the same network aligns with its coordinator. When a device wishes to transmit during the CAP a random time slot is chosen, and a Clear Channel Assessment (CCA) is performed. If the channel is busy it awaits another backoff period, then tries to access the channel again. If the channel is idle the transmission begins.

For unslotted CSMA/CA the device waits for a random period of time, then check if the channel is idle. If it is, the transmission begins, otherwise the device waits for another random period of time, then tries again.

Neither acknowledgements nor beacons are sent with these methods. [7]

2.5.1.3 ALOHA mechanism

Another access mechanism used in IEEE.802.15.4-2011 is the ALOHA mechanism.

Here, the device does not check if the channel if idle, nor does it wait for a certain time slot. If the device has data it needs to transmit, it transmits the data right away. ALOHA suits lightly loaded network, with smaller collision probability.

(24)

2.5.1.4 Frame acknowledgement

When (or if) the data has been successfully received and handled, and optional acknowledgement can be sent. If the sender has not received the acknowledgement after a previously decided time period, it will assume that the transmission failed, and re-send the data. If the transmission is not successful, the device can decide to terminate this particular data transmission. For systems without acknowledge- ments, all transmissions are assumed to be successful.

2.5.1.5 Error correction - SECDED

Single Error Correct, Double Error Detect (SECDED) is a form of Hamming code.

This family of error-correcting codes can correct one-bit error or detect two-bit error, which the name SECDED makes quite obvious. In this standard it is used to protect the physical header from errors. This method is recommended in systems where few errors occurs, since the code elongates the transmitted massage, due to how the SECDED functions. Extra parity bits are added to the message by a linear block code, which checks if the message is received correctly. SECDED is used in the PHY header (see section 2.5.3).

2.5.1.6 Error correction - CRC

Cyclic Redundancy Check (CRC) is used for error detection in the Physical Pro- tocol Data Unit (PPDU). It is a form of error-detecting code, i.e. it does not correct the detected errors. CRC is used to detect accidental changes to raw data.

Similarly to SECDED, extra information is attached to the message, in this case a calculated check value. In retrieval, the calculations are repeated and the results compared. If they do not match an error was detected.

2.5.1.7 Power consumption

As mentioned, the IEEE.802.15.4-2011 standard was adapted for low power con- sumption. Many applications which utilizes this standard are battery operated, where a low power consumption is ideal for longer use. To keep the power con- sumption low, the devices spend most of their operational time in sleep state, and listen periodically to the RF channel. This allows the user of this technology to balance message latency and power consumption.

2.5.1.8 Security

An important factor when using a wireless network for medical purposes is re- garding security. In general, wireless networks are vulnerable to eavesdropping

(25)

and active tampering, due to the fact that physical connection to the wire is not needed. The low-cost devices used usually have a very limited computing power.

This limited power, combined with the devices’ limited storage and battery life, makes it difficult to add any complicated security program onto them. The de- vices might also communicate with new devices they have never communicated with before during short time periods. All of these factors limits the choices of the security programming. Much is done in higher layers, which is not included in this standard, but a cryptographic mechanism in included in the MAC. It is based on symmetric-key cryptography, which uses keys provided by higher layers. It is assumed that the operations of the higher layers are done securely.

The mechanism provides data confidentiality, data authenticity and replay pro- tection. The confidentiality is an assurance that the data transmitted only reaches its intended receiver or receivers. The authenticity is assurance of the information source, and that the information was not modified in transit. The replay protec- tion ensures the detection of duplicate information.

Cryptographic frame protection uses a key. The key is shared either among a group of devices, and is then called a group key, or between two peers, and is then called a link key. If a group key is used in a setting were all devices share information, i.e. peer-to-peer, it will only protect against outside threats, and not those who might exist withing the network.

2.5.2 MAC - Medium access control

The MAC sublayer handles all access to the physical radio channel, and is respon- sible for:

• Supporting PAN association and disassociation

• Supporting device security

• Employing the CSMA/CA

• Generating network beacons for the device coordinator

• Synchronizing network beacons

• Handling the GTS mechanism

• Providing a reliable link between two peers

(26)

The sublayer provides the MAC data service and the MAC management service.

The data service enables the transmission and reception of MAC Protocol Data Unit (MPDU) across the PHY data service. The IEEE.802.15.4-2011 standard defines four MAC frame structures; beacon, data, acknowledgement and MAC command. The beacon frame is used to transmit beacons, which is only done by coordinators, the data frame is used for data transfers and the acknowledgement frame is used for acknowledgements. The fourth frame is used for handling MAC peer entity control transfers.

2.5.2.1 MDPU

The general frame format for the MAC, i.e. MAC Protocol Data Unit (MPDU) consists of a MAC Header (MHR), a MAC payload and MAC Footer (MFR), shown in figure 2.7. The MAC frames are passed to the PHY as the PPDU.

The MHR contains information on, among other things, the target destination, the source address and frame type. It also contains information about which type of frame structure is used. This information lays in the frame type field of the frame control field. The frame control field also contains information about if the frame is protected by the MAC sublayer, if more data is pending and whether acknowledgements are required.

The frame payload field contains the payload, i.e. information specific to indi- vidual frame types.

Figure 2.7: Mac protocol data unit, showing the MHR, MAC payload and the MFR, as well as what they contain.

The footer contains a Frame Check Sequence (FCS) field. The FCS is an im- portant part of the MPDU, especially for information filtering, since the definition of a frame reception is a successful reception in the PHY, combined with a success- ful FCS in the MAC. Since devices compliant with this standard in receiver mode

(27)

will receive everything on the same channel, as long as it is also compliant with the standard as well as in range, it can receive a lot of information, some of which might not be of interest. Therefore, an important feature of the MAC sublayer is the filtering of incoming frames, where only the necessary frames are presented to the upper layers. The aforementioned FCS is the first level of this filtering. On reception the suggested FCS is recalculated over the MHR and payload, and then compared to the received FCS. The MAC sublayer discards all received frames not containing the correct FCS value.

2.5.3 PHY - Physical layer

The physical layer, or PHY, is also specified in this standard. In general, PHY is responsible for:

• Channel frequency selection

• Data Transmission and reception

• UWB ranging

• Clear channel assessment (CCA) for CSMA/CA

• Activation and deactivation of the radio transceiver

• Energy detection on the current radio channel

• Link quality indicator for received packets.

The PHY provides two services; the data service, which enables the trans- mission and reception of the PPDU across the physical radio channel, and the management service. A number of PHYs are defined in this standard, but here we only look at the UWB PHY.

2.5.3.1 UWB channel definitions

The UWB PHY supports three independent bands of operations; The sub-gigahertz band, the low band and the high band. [7]

The first band consists of a single channel with a spectrum between 249.6 MHz and 749.6 MHz. The low band consists of four channels between 3.1 GHz and 4.8 GHz, and the high band consists of eleven channels between 6.0 GHz and 10.6 GHz. The specific frequencies and their corresponding channel numbers are shown in 2.2. Within each channel, at least two complex channels, which is a combination of a preamble code and a channel, are supported. For a device to be complaint

(28)

with this standard, one of three channels must be supported; 0, 3 or 9.

Band Channel number Center frequency (MHz) Bandwidth (MHz)

Sub-gigahertz 0 499.2 499.2

1 3494.4 499.2

Low 2 3993.6 499.2

3 4492.8 499.2

4 3993.6 1331.2

5 6489.6 499.2

6 6988.8 499.2

7 6489.6 1081.6

8 7488.0 499.2

High 9 7987.2 499.2

10 8486.4 499.2

11 7987.2 1331.2

12 8985.6 499.2

13 9484.88 499.2

14 9984.0 499.2

15 9484.8 1354.97

Table 2.2: Channel numbers and corresponding frequencies for UWB PHY. [7]

2.5.3.2 UWB PPDU

The UWB PPDU is comprised by a Synchronization Header (SHR) preamble with a Start Frame Delimiter (SFD), a PHY Header (PHR) and a data field, shown in figure 2.8. The SHR preamble is coded at the base rate, the PHR and the data field is coded with BPM-BPSK modulation, which is a combination of the two modulation types mentioned in sections 2.3.2.2 and 2.3.2.1 (more on this in section 2.5.3.3). The frame structure is designed to minimize the complexity, while still being robust enough for a reliable transmission on a noisy channel.

Figure 2.8: The physical protocol data unit for the UWB PHY.

The SHR preamble base rates are 1.01 Msymbol/s and 0.25 Msymbol/s, due to

(29)

the fact that a UWB device should support a number of length 31 preamble codes as specified by the standard, as well as the two base rates corresponding to the two mandatory mean Pulse Repetition Value (PRF) result for this code length, i.e. 15.6 MHz and 3.90 MHz. There is an optional 127 length preamble to be used, in which case a mean PRF shall be 62.4 MHz.

The SYNC field in the SHR consists of repetitions of the preamble symbol. There are four possible lengths for the SHR, since the SYNC field has four possible lengths, depending on the number of repetitions, either 16, 64, 1024 or 4096.

The PHR is sent at 110 kb/s for a data rate of 110 kb/s, and 850 kb/s for all data rates greater than or equal to 850 kb/s, and is transmitted using BPM- BPSK. It consists of 19 bits, and contains information which is needed to decode the packet to the receiver. Information included is, among other things, the data rate of the received PSDU, the frame length that the MAC sublayer is requesting and a ranging packet.

The PHR also contains SECDED check bits, that are used to protect the PHR for errors from noise and channel impairments. These bits are able to detect two errors and correct one error at the receiver.

The data field uses forward error correction, which is an encoding using system- atic Reed-Solomon block code, which adds 48 parity bits, and then a systematic convolutional encoder. Just as for the PHR, it is transmitted using a BPM-BPSK modulation.

2.5.3.3 BPM-BPSK Modulation

As mentioned several times in the previous section a combination BPSK and BPM, described in sections 2.3.2.2 and 2.3.2.1, is used. This combination is used to modulate the symbols, which are composed by active burst of UWB pulses. For this scheme, a UWB PHY symbol is capable of carrying two bits of information.

One bit is used to determine the position of the burst of pulses, and the other bit is used to modulate the phase of the burst, i.e. chose a 0 or a 1 (see section 2.3.2.2).

(30)

Possible burst Guard interval

| {z }

TBP M

Possible burst Guard interval

| {z }

TBP M

Figure 2.9: UWB PHY symbol structure, showing one data symbol with total duration Tdsym. The symbol equals one bit.

Each symbol is divided into two equally long BPM intervals, which enables binary position modulation. These two intervals are in turn divided in two. The first half of these half BPM interval (i.e. the first and third quarter) is a possible burst position. Different messages are sent depending on which burst position is chosen. A burst in the first position translates to one 0 bit, and a burst in the second position equals 1. Additionally the phase of the burst (-1 or +1) indicates a second bit of information. As shown in figure 2.9, the remaining two quarters are guard intervals, which are used in order to limit the amount of inter-symbol inter- ference caused by multipath. In each symbol interval a single burst event should occur. The bursts are usually much shorter than the total BPM duration, which provides some multi-user access interference rejection in form of time hopping. [7]

This modulation can be expressed as:

x(k)(t) = [1 − 2g1(k)]

Ncpb

X

n=1

[1 − 2sn+kNcpb] × p(t − g0(k)TBP M − h(k)Tburst− nTc) (2.7)

which describes the time hopping with polarity scrambling. Equation (2.7) describes the waveform which the UWB PHY transmit during the k th symbol interval. [7] g0(k) and g1(k) ∈ {0, 1}, and are the two information bits, where g(k)0 is encoded into the burst position, and g(k)0 is encoded into burst polarity. p(t) is the pulse shape at the antenna input, and 2sn+kNcpb ∈ {0, 1}, n = 0, 1, . . . , Ncpb− 1 is the code for the scrambling. h(k) ∈ {0, 1 − Nhop − 1 is the burst hopping sequence, which provides the multi-user interference rejection. Nhop is the hop burst parameter, which is the number of burst positions which may contain an active burst.

(31)

3 Electrocardiogram - ECG

An ECG is a graphical representation of a hearts activity. This section aims to clarify how an electrocardiogram is created and interpreted, based on bioelectro- magnetism.

3.1 Bioelectromagnetism and the electrical system of the heart

In order to get a muscle to contract an electrical impulse is sent to stimulate that muscle. This is ofter referred to as excitation. The same is true for the heart, where this electrical impulse creates a heartbeat. The study of these electrical impulses in living organisms is called bioelectromagnetism, and it is this field of study which is the base for the ECG.

The electrical system of the heart is called the cardiac conduction system. This system contains three main parts; the sinoatrial node, the antrioventicular node and the His-Purkinje system. The sinoatrial node is located in the right atrium, the antrioventicular node is in the interatrial septum close to the tricuspid valve and the His-Purkinje system is located along the walls of the ventricles (see figure 3.1).

The heartbeat has two basic parts; diastole and systole. The diastole part of the cycle is where the heart fills up with blood and systole is where the muscle contracts and pushes the blood out into the rest of the body.

Figure 3.1: Anatomy of the heart, with various areas labeled. [8]

(32)

The cycle begins with an electrical signal, generated by the sinoatrial node, which is often referred to as the natural pacemaker. The signal is generated as the heart’s right atrium is filled with blood. The signal spreads across the cells of both the right and left atria, activating them causing the atria to contract. This pushes the blood into both ventricles, while the electrical stimulus travels down through the conduction pathways, reaching the antrioventicular node near the ventricles.

There, the impulses are slowed down for an instant, allowing the left and right ventricles to fill with blood. Then the signal continues along a pathway called the bundle of His. Here the signal fibers divide into left and right bundle branches through the Purkinje fibers. These are connected to the walls of the ventricles, and while the signal spreads the ventricles contract. The left ventricle contracts an instant before the right. As the signal passes, the walls of the ventricles relaxes, and waits for the next cycle. [8, 9]

3.2 12-lead electrocardiogram

To create an electrocardiogram a number of electrodes is placed on the patient to measure the electric activity mentioned in the previous section. There are several different way of doing so, but the most common one is a 12-lead ECG. A common misconception is that leads are the same as the electrodes, which they are not!

The electrodes measures the potential at its location, and these potential values are then used to calculate the lead values. For a 12-lead ECG ten electrodes are used, the placement of which are shown in figures 3.2 and 3.3.

Figure 3.2: Recommended placement of chest electrodes for a 12-lead ECG.

(33)

Figure 3.3: Recommended placement of limb electrodes for a 12-lead ECG.

The placement of the electrodes needs to be quite precise, and in table 3.1 the placement is described. For the limb electrodes the placement does not to be as exact as for the chest electrodes, and as one can see in figure 3.3 there are two different ways of placing them. How the leads are calculated, is explained closer in the sections following this one.

Electrode name Placement

V1 Fourth intercostal space on the right sternum V2 Fourth intercostal space at the left sternum V3 Midway between placement of V2 and V4 V4 Fifth intercostal space at the midclavicular line

V5 Anterior axillary line on the same horizontal level as V4 V6 Mid-axillary line on the same horizontal level as V4 and V5 RA (Right Arm) Anywhere between the right shoulder and right elbow

RL (Right Leg) Anywhere below the right torso and above the right ankle LA (Left Arm) Anywhere between the left shoulder and left elbow

LL (Left Leg) Anywhere below the left torso and above the left ankle Table 3.1: Electrode placement specifications. [10]

3.2.1 The Einthoven leads

The first three leads are the standard bipolar leads, and together form the Einthoven triangle, shown in figure 3.4, using the limb electrodes as described in the previous section. It is named after Willem Einthoven, who invented one of the first ECG systems, in which he used this triangle. The leads are calculated according to table

(34)

3.2, where V stands for the voltage potential for the different electrodes and the calculated leads.

Einthoven lead Potentials used Equation

I LA, RA VI = VLA− VRA

II LL, RA VII = VLL− VRA

III LL, LA VIII = VLL− VLA

Table 3.2: Table showing how the Einthoven leads are calculated.

Figure 3.4: The Einthoven triangle. First row shows limb lead measurements, while the second row shows the augmented limb leads.

The potential of lead I is the potential difference between the right arm and the left arm, with the vector oriented to 0° in the frontal plane (see figure 3.5).

The potential of lead II is the potential difference between the right arm and the left leg, with the vector oriented to 60°, and the potential of lead III is between the left arm and the left leg, with the vector oriented to 120°. According to Kirchoff’s law the voltages of the leads has the relation given in equation (3.1), which means that only two of the three leads are independent.

(35)

VI = VIII − VII (3.1) This helps in determining if the limb electrodes are correctly placed, since if equation (3.1) is not fulfilled this means that the electrodes are placed incorrectly.

[11, 12]

Figure 3.5: The lead vectors in the three orthogonal planes. [11]

3.2.2 The Wilson central terminal

The Wilson central terminal is used for calculating the average potential, which acts as a theoretical null point. This is needed to find the augmented leads. It was first done by Frank Norman Wilson, who connected 5kΩ resistors from the limb leads to a common point, referred to as the central terminal. The central terminal voltage was calculated according to equation (3.3), where VCT is the voltage of the central terminal. Only one of the leg electrodes is used, usually the left one.

The Wilson central terminal can be found in the middle of the Einthoven triangle.

[11, 12]

(36)

IRA +ILA+ ILL = VCT5000−VRA +VCT5000−VLA +VCT5000−VLL (3.2)

⇒ VCT = VRA+VLA3 +VLL (3.3)

3.2.3 The Goldberger Augmented leads

In figure 3.4 the second row shows the next three leads, also called the augmented leads. These are unipolar leads, which are calculated using the Wilson central terminal and the limb electrodes. The potentials of the augmented leads are cal- culated according to equations (3.4), (3.5) and (3.6). [11, 12]

VaV F = VLL− 1

2(VRA+ VLA) = 3

2(VLL− VCT) (3.4) VaV R= VRA− 1

2(VLA+ VLL) = 3

2(VRA− VCT) (3.5) VaV L= VLA−1

2(VRA+ VLL) = 3

2(VLA− VCT) (3.6) As one can now see, from just three electrodes six leads are calculated. These six are often referred to as the limb leads.

3.2.4 The precordial leads

The six leads placed across the chest are called the precordial leads. The precordial leads are used for measuring potentials close to heart. These leads are unipolar, just as the augmented leads. For the previous six leads at least two electrode measurement were needed, however the chest leads are only dependent on a single electrode measurement. These leads are simply the absolute potential which the electrode measures. The placement of these leads in reference to the other six leads is shown in figure 3.6. All of the leads are directed along the transverse plane (see figure 3.5). [11, 12]

(37)

Figure 3.6: The six frontal leads, the three standard bipolar leads and the three unipolar leads. [13]

3.2.5 Combining the 12 leads

As you might have noticed, all of the six limb leads are derived from three elec- trode measurements. The right leg electrode is only used as a reference electrode for recording purposes. Mathematically this means that any two of these six leads include the same information about the heart’s activity as the other four. This type of dipole model can explain over 90 % of the heart’s electric activity. If we look at figure 3.5 we see that any two of lead I, II and III can explain the frontal plane components. If we also use the precordial lead V2 as the anterior-posterior component, as it is closest to the x-axis, we would get a sufficient way of describing the heart’s electric vector, giving us nine redundant leads.

So why use twelve leads? In fact, the precordial leads also detect non-dipolar components. Since they are close the the frontal part of the heart these leads have diagnostic significance. The main reason for using all of the twelve leads is that it enhances pattern recognition. It allows the physician to compare the projections of the resultant vectors in the the orthogonal planes and at different angles. [11]

3.3 Interpreting an Electrocardiogram

With some insights on bioelectromagnetism and what the leads are one can then interpret the resulting electrocardiogram.

(38)

3.3.1 The ECG segments

Now recall section 3.1. First the sinus node is activated, and the electrical signal spreads along the atrial walls. This depolarization is represented by the P wave, as shown in figure 3.7. The ventricular depolarization causes the QRS complex, and the repolarization causes the T part. The atrial repolarization occurs during the QRS complex, but since it produces such a low signal it cannot be seen in the normal ECG. [11]

Figure 3.7: An ECG of a heart with normal sinus rhythm.

3.3.2 Step by step interpretation

If an assumption can be done that the ECG was done correctly, you can interpret the ECG. The first thing to look at is the heart rate. This value is calculated auto- matically by most ECG systems, and is in most cases reliable. It is done by reading the distance between two R waves. An ECG, such as in figure 3.8, is printed on a grid with small boxes (1x1 mm), which represents 0.1 mV×0.04 seconds, and large squares (5x5mm), which represents 0.5 mV× 0.20 seconds. To get the heart rate one counts the number of large squares between the R waves, and divide 300 (i.e. the number of large squares in a minute) by that number. This gives a heart rate in bpm. However, if the patient has an irregular rhythm one should in- stead count the number of QRS complexes in a longer interval (about ten seconds).

Secondly one looks at the heart rhythm. The rhythm can be regular, regularly irregular (meaning a recurrent pattern of irregularity) or irregularly irregular. The

(39)

rhythm is found by looking at the distance between several QRS complexes and comparing the distances.

Next, one looks at the PR interval, i.e. from the beginning of the P wave to the beginning of the QRS complex. A normal interval is between 0.12-0.20 sec- onds. In the clinically used ECG, as the one shown in figure 3.8, a large square is 0.2 seconds. Then one looks at the QT interval, which reaches from the beginning of the QRS complex to the end of the T wave. This interval varies depending on heart rate.

Figure 3.8: A complete 12-lead ECG with normal sinus rhythm. [14]

Then follows the most difficult reading step: The heart axis. Simplified this is the total vector of the ventricular depolarization. With the six different chest leads one gets observations of the same electrical stimuli from six different loca- tions. Think of it at six observers in separate places looking at the same event.

When the stimuli approaches the lead in yields a positive reading, the opposite for it moves away, and a biphasic reading if it moves perpendicularly.

The simplest method of calculating the heart axis is to look at the QRS com- plex for lead I and aVF. For a normal ECG these should both be positive. A normal ECG could also have a negative QRS complex in lead aVF, but only if both lead I and II have a positive QRS complex. For any other results there is a deviation of the heart axis.

(40)

Lastly one looks at the ST segment. It reaches from the end of the QRS com- plex and the beginning of the T wave. It must be isoelectric, i.e. electrically neutral. To get a complete picture, one should also check all the other intervals to look for abnormalities after these initial steps.[15]

3.4 Filtering out disturbances

The electrical signals measured for ECGs are quite weak, in the range of 0.1 to 5.0 mV. They are also highly susceptible to interference from other electromagnetic devices, in particular strong signals in the electrical grid at 50 Hz. These interfer- ences should be filtered away to obtain a clean ECG signal. [16]

To filter away a certain frequency a notch filter should be used. For both dig- ital and electronic filtering one usually use either Infinite Impulse Response (IIR) or Finite Impulse Response (FIR) filters. In this digital filtering case an IIR filter is used, which utilizes feedback, unlike the FIR filter.

The IIR filter output is computed according to equation (3.7), where x[n] is the input at sample n, y[n] the output at sample n, and a[] and b[] are the filter coeffi- cients that define the filter characteristics. These coefficients needs to be calculated to match the requirements of the filter.

y[n] = b[0]x[n] + . . . + b[M ]x[n − M ] − a[1]y[n − 1] − . . . − a[N ]y[n − N ]

a[0] (3.7)

(41)

4 Hardware implementation

This section of the thesis describes the different hardware components used in this project and how they were implemented in the final prototype.

4.1 Overview of prototype

Figure 4.1: An overview the communication between the two nodes.

The prototype consists of two main nodes. A very simplified overview of the com- munication between the two nodes are shown in figure 4.1. Node one (also referred to as the receiver ), shown in figure 4.2, is powered by a connected smartphone, which it also communicates with. The connection between the two is Serial USB.

The smartphone is connected to an USB OTG adapter, which in turn is connected to the Arduino Due:s programming port. The Arduino Due is also connected to a DWM1000 UWB transceiver, which in communicates with Serial Peripheral In- terface (SPI). The connection is done with wires on a breadboard. The connected setup is shown in figure 4.3.

Figure 4.2: An overview of node one (receiver ) connections.

(42)

Figure 4.3: The receiver setup. (A) Arduino Due (B) DWM1000 (C) Android smartphone (D) USB OTG adapter.

The second node (sender ), shown in figure 4.4, is powered by a computer or a power adapter via the programming port. Just as for node one, the Arduino Due is connected to a DWM1000 UWB transceiver. This Arduino is also connected to a SparkFun AD8232 Single Lead Heart Rate Monitor. The Ad8232 is powered by the 3.3v connection on the Arduino and its output is connected to an Arduino analog input, which is connected to the Analog-to-Digital Converter (ADC). The connected setup is shown in figure 4.5.

(43)

Figure 4.4: An overview of node two (sender ) connections.

Figure 4.5: The sender setup. (A) Arduino Due (B) DWM1000 (C) Heart rate monitor.

4.2 Android smartphone and USB On-The-Go

For this project a smartphone from Sony Xperia was used. Since it is not UWB compatible some form of UWB compatible hardware needs to be connected to and controlled by the smartphone. As mentioned in the previous section, a Arduino

(44)

Due was used in this case. Since a smartphone by default is in slave-mode when connected via USB, an adapter called USB On-The-Go (USB OTG) is used, which enables devices to act as both master and slave. The adapter has two sides, named A and B. A device connected to the A-side is the link-host by default, and a device connected to the B-side is the link-peripheral (usually not called slave when talking about USB OTG). In this case the smartphone is connected to the A-side, as it is supposed do act as a master. Usually, the master sets up the USB communications at startup, and for USB OTG this is now instead done by the A-device. The same goes for power supply, where the host provides power to the link.

4.3 Arduino Due

Figure 4.6: The Arduino Due board. [17]

Arduino Due is a microcontroller board based on the Atmel SAM3X8E ARM Cortex-M3 CPU, which has 512KB of flash memory for code storage. The Ar- duino Due contains two USB ports, however only one is used during this project;

the programming port. This port is connected to a ATmega16U2, which acts as a USB-to-TTL Serial converter. The converter is connected to the first Universal Asynchronous Receiver/Transmitter (UART) of the Atmel SAM3X8E (RX0 and TX0). To communicate with the programming port the serial object can be used in Arduino Software. The programming port is also used for programming the

(45)

Microcontroller Unit (MCU).

Microcontroller AT91SAM3X8E Operating Voltage 3.3V

Digital I/O Pins 54 Analog inputs 12 Flash memory 512kB

SRAM 96kB

Clock Speed 84 MHz Board length 101.52 mm Board width 53.3 mm

Weight 36 g

Table 4.1: Technical specifications for Arduino Due. [18]

The board has a 6-pin SPI header that supports communication with the SPI library. For this project the Arduino is the SPI master, which is connected to the DWM1000, the SPI slave. The board also contains twelve analog inputs with ADC connections, where only one of the twelve is used for the final prototype, connected to a SparkFun AD8232. The board is recommended to be driven with voltages between 7-12 and is operating at 3.3V, where the maximum current draw is 800 mA. This power pin drives both the DWM1000 and the SparkFun AD8232, along with the GND pin. Table 4.1 shows some of the technical specification for the Arduino Due. [18]

4.4 DWM1000

The DWM1000 module, shown in figure 4.7, is based on DecaWave’s DW1000 UWB integrated circuit, which is compliant with the IEEE802.15.4-2011 standard described in section 2.5. A huge advantage of this module is that it includes an antenna, all Radio Frequency (RF) circuitry, power management and clock circuitry needed for the DW1000, meaning that no further RF design is needed.

The module also contains a 38.4 MHz reference crystal, which has been trimmed to reduce the initial frequency error to about 2 ppm. [19]

(46)

Figure 4.7: The Decawave DWM1000 board [20]

The host communications interface is a slave-only SPI, which supports a num- ber of different clock and data phase modes. These modes are chosen using General-Purpose Input/Output (GPIO) 5 and 6. In figure 4.8 a block diagram of the module is shown. There you can see the analog front-end receiver and transmitter and the digital back-end interface to an off-chip host processor. As mentioned in the previous section, the Arduino Due acts as the master, meaning that the AT91SAM3X8E microcontroller will act as the host.

Figure 4.8: Block diagram of the inner workings of the DWM1000 module.

The DW1000 chip supports the six channels 1−5 and 7 defined in the IEEE802.15.4- 2011 protocol (shown in table 2.2 in section 2.5.3.1). However, it is important to

References

Related documents

This thesis investi- gates a novel wireless technology, the IEEE 802.11ax WiFi standard, and its potential applicability for smart grid communications, and more specifically,

Keywords: fetal ECG, ST analysis, electronic fetal monitoring, cardiotocography, fetal blood sampling, metabolic acidosis.

Channel sounder measurements SISO/MIMO Link level simulations Channel reconstruction Measurement based channel modeling Stored data Decision Pathloss and fading estimator High

Figure 34: The graph illustrates a typical example of a heart rate signal in frequency domain, taken from the second study for six breaths per minute, which corresponds to a

The first outphasing design, presented in Paper 5, was based on a Class-D stage utilizing a cascode configuration, driven by an AC-coupled low-voltage driver, to allow a

Linköpings universitet, SE-581 83 Linköping, Sweden Linköping 2011 Jonas Fritzin CMOS RF Power Amplifiers for W ir eless Communications Linköping 201 1. Linköping Studies

The length of the coupled regions is expected to be some were around λ/4 of the desired center frequency. Spacing has most impact on the attenuation while width and

Linköping studies in science and