declaration of originality - university of...
Post on 30-Jan-2018
214 Views
Preview:
TRANSCRIPT
DECLARATION OF ORIGINALITY
FACULTY/ SCHOOL/ INSTITUTE: Engineering
DEPARTMENT: Electrical and Information Engineering
COURSE NAME: Bachelor of Science in Electrical & Electronic Engineering
TITLE OF NAME OF STUDENT: BANJA WENDY LAUREN AKOTH
REGISTRATION NUMBER: F17/29532/2009
COLLEGE: Architecture and Engineering
WORK: HOME PATIENT MONITORING BASED ON GPRS
1) I understand what plagiarism is and I am aware of the university policy in this regard.
2) I declare that this final year project report is my original work and has not been
submitted elsewhere for examination, award of a degree or publication. Where other
people’s work or my own work has been used, this has properly been acknowledged
and referenced in accordance with the University of Nairobi’s requirements.
3) I have not sought or used the services of any professional agencies to produce this
work.
4) I have not allowed, and shall not allow anyone to copy my work with the intention of
passing it off as his/her own work.
5) I understand that any false claim in respect of this work shall result in disciplinary
action, in accordance with University anti-plagiarism policy.
Signature:
………………………………………………………………………………………
Date: ……………………………………………………………………………………………
i
DEDICATIONThis project is dedicated to my family for their love and support and to my mentors and peers
who have guided and supported me.
ii
ACKNOWLEDGEMENTI acknowledge the helpful input by my supervisor, Prof. V. K. Oduol for the useful comments
and suggestions which have led me down the right path in the design of the project and for
the guidance and moral support that he gave me.
I also want to thank God almighty for being with me and guiding me the whole time during
this project.
iii
ContentsDECLARATION OF ORIGINALITY.............................................................................................................. i
DEDICATION........................................................................................................................................... ii
ACKNOWLEDGEMENT...........................................................................................................................iii
List of Figures........................................................................................................................................vi
List of Acronyms...................................................................................................................................vii
ABSTRACT...........................................................................................................................................viii
CHAPTER 1: INTRODUCTION..................................................................................................................1
1.1Background.......................................................................................................................................1
1.2 Problem statement..........................................................................................................................2
1.3Main Objectives................................................................................................................................2
1.4 Project Scope...................................................................................................................................2
CHAPTER 2: LITERATURE REVIEW..........................................................................................................3
2.1 Introduction.....................................................................................................................................3
2.2 Sensors.............................................................................................................................................3
2.2.1 Factors to consider when choosing a biomedical sensor..............................................................3
2.2.2 Types of biomedical sensors.........................................................................................................4
2.2.3 Sensor output using biomedical sensors.......................................................................................5
2.2.3.1 Amplification..............................................................................................................................5
2.2.3.2 Noise..........................................................................................................................................5
2.3 Digital Signal Processing..................................................................................................................5
2.3.1 Information source.......................................................................................................................6
2.3.2 Source encoder.............................................................................................................................6
2.3.3 Channel encoder...........................................................................................................................6
2.3.4 Digital modulator..........................................................................................................................7
2.3.5 Channel.........................................................................................................................................7
2.3.6 Digital demodulator......................................................................................................................7
2.3.7 Channel decoder...........................................................................................................................7
2.3.8 Source decoder.............................................................................................................................7
2.4 Error detection and correction.........................................................................................................8
2.4.1 Error detection..............................................................................................................................8
2.4.2 Error correction...........................................................................................................................10
2.5 Signal acquisition...........................................................................................................................10
CHAPTER 3: DESIGN AND DEMONSTRATION.......................................................................................11
iv
3.1 Introduction...................................................................................................................................11
3.1.1 ECG signal...................................................................................................................................12
3.1.2 Signal processing and transmission............................................................................................13
3.1.2.1 Signal from Workspace............................................................................................................13
3.1.2.2 Image data type conversion.....................................................................................................14
3.1.2.3 Frame conversion.....................................................................................................................15
3.1.2.4 Convolutional encoder.............................................................................................................15
3.1.2.5 Convolutional interleaver.........................................................................................................15
3.1.2.6 GMSK Modulator band............................................................................................................16
3.1.2.7 Multipath Rayleigh Fading.......................................................................................................16
3.1.2.8 GMSK Demodulator Baseband.................................................................................................17
3.1.2.9 Convolutional deinterleaver.....................................................................................................18
3.1.2.10 Viterbi decoder......................................................................................................................18
3.1.2.11 Error rate calculator...............................................................................................................19
CHAPTER 4: RESULTS AND ANALYSIS...................................................................................................20
4.1 Simulation results..........................................................................................................................20
4.2 Bit error rate calculation results....................................................................................................25
CHAPTER 5...........................................................................................................................................27
5.1 Discussion......................................................................................................................................27
5.2 Conclusion......................................................................................................................................28
5.3 Recommendations.........................................................................................................................28
5.3.1 Bluetooth home patient monitoring device and application.......................................................28
5.3.2 Sensory circuit and EF Com Pro GPRS/GSM module....................................................................28
APPENDIX A.........................................................................................................................................30
MATLAB CODE FOR ECG SIGNAL..........................................................................................................30
APPENDIX B.........................................................................................................................................37
MATLAB SIMULINK SIMULATION BLOCKS............................................................................................37
Bibliography.........................................................................................................................................38
v
List of FiguresFigure 2.1 Typical digital communication systems.
Figure 3.1 Typical ECG signal.
Figure 3.2 Block diagram for home patient monitoring based on GPRS.
Figure 3.3 ECG signal developed from MATLAB.
Figure 3.4 Simulink blocks for ECG signal transmission via GPRS.
Figure 3.5 Signal from workspace on Simulink.
Figure 3.6 Image data type conversion.
Figure 3.7 Interleaved signal.
Figure 3.8 GMSK modulation of ECG signal.
Figure 3.9 Multipath Rayleigh fading channel signal.
Figure 3.10 GMSK Demodulated signal.
Figure 3.11 Output of Viterbi decoder.
Figure 4.1 Signal being transmitted.
Figure 4.2 Comparison of interleaved, deinterleaved, and sampled signal.
Figure 4.3 Transmitted signal in bits.
Figure 4.4 Output of transmitted signal using time scope.
Figure 4.5 Comparison between transmitted and received signal.
Figure 5.1 EF Com Pro GPRS/GSM module.
Figure 6 Simulation blocks for ECG signal transmission.
vi
List of Acronyms2G Second generation
3GPP Third Generation Partnership Project
CMRR Common Mode Rejection Ratio
DSP Digital Signal Processing
ECG Electrocardiogram
ETSI European Telecommunication Standards Institute
GMSK Gaussian Minimum Shift Keying
GPRS General Packet Radio Services
GSM Global System for Mobile communication
ICU Intensive Care Unit
TDMA Time Division Multiple Access
vii
ABSTRACTThis paper illustrates a home patient monitoring device based on GPRS. The patient
monitoring device implements the use of the GPRS network to send vital signs data to a
hospital server. This enables a patient to be monitored in the comfort of his or her home. The
data is sent using the packet transmission method where the signal is broken down into
packets of data for transmission.
viii
CHAPTER 1: INTRODUCTION1.1BackgroundHome patient monitoring is basically the ability of monitoring a patient remotely from his or
her house. Home patient monitoring based on GPRS is the implementation of medical patient
monitoring services incorporated with the telecommunications system.
GSM (Global System for Mobile communication) is a cellular mobile communication
network2. It is an open, digital cellular technology used for transmitting mobile voice and
data services. It is an international standard. Commercial services using the GSM system did
not start until 1991. Instead of using analog service, GSM was developed as a digital system
using TDMA (Time Division Multiple Access). In TDMA the channel capacity in bits/s is
used to the fullest extent possible, and the bit stream is divided into frames and the frames are
divided into time slots that are allocated amongst the users. It operates at frequencies of
between 900MHz and 1800MHz. GSM supports voice calls and data transfer speeds of up to
9.6 kbps, together with the transmission of SMS (Short Message Service).
GPRS (General Packet Radio Service) is a packet based communication service for mobile
devices that allows data to be sent and received across a mobile telephone network. It is a
packet oriented mobile data service on the 2G and 3G cellular communication system’s
global system for mobile communication (GSM). GPRS was originally standardized by
European Telecommunication Standards Institute (ETSI) in response to the earlier packet
switched cellular technologies. It is now maintained by the Third Generation Partnership
Project (3GPP).
In 2G systems, GPRS provides data rates of 56-114 Kbits/second. 2G cellular technology
combined with GPRS is described as described as 2.5G, that is, a technology between the
second and third generations of mobile telephony.
A microcontroller is defined as a small computer on a single integrated circuit containing a
processor core, memory, and programmable input/output peripherals. They are designed for
embedded applications as opposed to microprocessors which are used in personal computers
or other general purpose applications.
Microcontrollers are used in automatically controlled products and devices such as
implantable medical devices, remote controls, power tools and other embedded systems.
ix
They are suitable for long lasting battery applications. Some microcontrollers may be used as
digital signal processors (DSP), with higher clock speeds and power consumption.
1.2 Problem statementPatient monitoring from a hospital has its own limitations. The main one is that there is a
shortage in number of ICU beds in hospitals and a handful of people to be monitored. It is
due to this that this project will seek to demonstrate how patient monitoring based on GPRS
is a can be implemented to try and solve this problem.
1.3Main ObjectivesThis project is composed of two main objectives. The first objective involves the analysis of
the GPRS networks in terms of sending data. The second objective involves the sending of an
ECG signal for analysis by a health care provider via a GPRS network, using MATLAB. This
will entail error correcting coding, modulation, demodulation, encoding and decoding.
1.4 Project ScopeThis project entails the following:
Developing a code using MATLAB to demonstrate an ECG signal.
Demonstrating how the ECG signal is transmitted via GPRS using MATLAB. It will
involve the use of error correcting codes and other channels to show the received
signal.
x
CHAPTER 2: LITERATURE REVIEW2.1 IntroductionThis chapter will seek to describe and discuss the researches from various sources such as
textbooks, articles, journals, thesis papers and the internet. It consists of information which is
vital in the development of this project. The typical home patient monitoring implements the
following components2:
i. A biomedical sensor which in this case is an electrode ECG sensor which will detect
the heart beat of a patient. The sensor gives a maximum output voltage of 10
milivolts.
ii. An instrumentation amplifier which is used to amplify the ECG signal because it is
small. In this case the ECG signal is an analog output.
iii. An active high pass filter
iv. An active low pass filter
v. A microcontroller
vi. A GPRS transceiver
2.2 SensorsA sensor is a device that detects particular external stimuli and responds in a distinctive
manner3. It measures a physical quantity and converts it into a signal which can be read by an
observer or by an instrument. A biomedical sensor also referred to as a biosensor, is an
analytical device used for the detection of an analyte that combines a biological component
with a physiochemical detector.
The sensitive biological element (e. g tissues, enzymes), is a biologically derived material or
biometric component that interacts with the analyte under study.
The detector element transforms the signal resulting from the interaction of the analyte with
the biological element into another signal that can be more easily measured and quantified.
The biosensor reader device is primarily responsible for the display of the results in a user
friendly way. This is the most expensive part of the sensor device.
2.2.1 Factors to consider when choosing a biomedical sensor The sensor should be cost effective to minimize cost of design and production of the
device.
xi
The sensor should have reasonable energy consumption and operation of powering
with batteries should be easily available.
The sensor should be able to function continuously and reliably for long periods of
time to monitor the patient’s vital signs continuously.
2.2.2 Types of biomedical sensorsBiomedical sensors are categorized according the medium used for the transmission of
signals. They are categorized as:
Physical measurements
These are sensors that are solely used for physical measurements such as weight4. Some
of the sensors used for physical measurements include resistance sensors, capacitive
sensors and photoelectric sensors.
Biopotential electrodes
Our bodies’ biological systems have electric activity associated with them. The electric
activity can be a constant dc electric field, constant flux of charge carrying particles or a
time varying electric field3. This bioelectric activity is defined by the phenomenon of the
distribution of ions or charged molecules and the changes resulting from very specific
processes. These changes occur due to biochemical reactions. Biopotential electrodes are
sensors that detect these biochemical reactions and result in a signal that should establish
the stability of a particular biochemical system. The most familiar measurements from
biopotential electrodes include electrocardiogram (which is derived from electrical heart
activity), the electromyogram (which is derived from neuromuscular diseases), and many
others.
Electrochemical sensors
These are sensors that are used for the detection of biomolecules like DNA, proteins, e.t.c
and are mainly used in the analysis of medicine and food5. They are based on
electrochemistry and electrochemical behavior of biomolecules.
xii
Optical sensors
These are sensors that convert light rays into electronic signals. They measure the
physical quantity of light and translate it into a form that can be read by an instrument
which displays the signals.
Bioanalytic sensors
These are sensors that are specifically modified for chemical selectivity in measurements
related to biological systems.
2.2.3 Sensor output using biomedical sensors.The signals generated from a biomedical sensor are small. In the case of biomedical sensors
the used to measure heart rate, the output voltage from the sensor can be as small as 0.5
milivolts3. For this reason it is important that the sensor voltage output is amplified. In the
case of ECG sensor circuit, an instrumentation amplifier is used. The instrumentation
amplifier immunizes the signal from noise and other electromagnetic interference signals.
2.2.3.1 AmplificationTo address the small output voltage from the sensor, a high gain instrumentation amplifier
with a high common mode rejection ratio (CMRR) is used to receive the desired signal.
2.2.3.2 NoiseNoise interrupts the pulse signal from the heart. This is because the electrode leads act as an
antenna which receives unwanted external radiated signals. Power lines and EMFs from
fluorescent lights at a frequency of 50 Hz add a relatively small sinusoidal signal to the pulse.
However, the frequency range of the pulse is from 0.5Hz-5Hz. Since the noise frequency is
higher, the noise will be difficult to filter out due to the fact that it is very small.
A band pass filter is used to remove the noise which is at high frequencies and the desired
signal has a low frequency.
2.3 Digital Signal ProcessingDigital signal processing (DSP) refers to the various techniques used for improving the
accuracy and reliability of digital communications. A digital communication system involves
xiii
the transmission of information, which is in digital form from a source that generates this
information, to one or more destinations. DSP works by clarifying, or standardizing, the
levels or states of a digital signal.
A typical digital communication system consists of several components as illustrated6 in
figure 1 below.
Output
Figure 2.1 showing a typical digital communication system.
2.3.1 Information sourceThe information source is the message or the data that is to be transmitted via the digital
communication system. The information source has an input transducer which converts the
signal from one form to another. The source output may be an analog signal, (video or audio),
or a digital signal, for example a machine that is discrete in time and has a finite a number of
output characters6.
2.3.2 Source encoderThis is the stage where source encoding takes place. The messages produced by the source
are converted into sequential binary digits. Source encoding refers to the process of
converting the output of either an analog or digital source, efficiently, into a sequence of
binary digits6.
2.3.3 Channel encoderThe channel encoder is responsible for introducing some redundancy in the binary
information sequence. The redundancy is introduced in a controlled manner. When this
redundancy is introduced, the binary info sequence can be used at the receiver to overcome
xiv
Information source
Source encoder
Channel encoder
Output transducer
Source decoder
Digital modulator
Channel
Digital demodulator
Channel decoder
the effects of noise and interference encountered during transmission. This makes the data
more reliable6.
2.3.4 Digital modulatorThis serves as the interface to the communication channel. The binary sequence is passed
from the channel encoder to the digital modulator6. The digital modulator serves the purpose
of mapping the binary information sequence into signal waveforms.
2.3.5 ChannelThis is the physical medium that is used to send the signal from the transmitter to the receiver
end. In wireless communication the medium is air. Other media include wire lines, optical
fiber cables, and microwave radio. Regardless of the medium used, the transmitted signal is
usually corrupted by a variety of environmental mechanisms such as thermal noise which
result from electronic devices, manmade noise and atmospheric noise.
2.3.6 Digital demodulatorThis is at the receiving end. The digital demodulator processes channel-corrupted transmitted
waveform and reduces these waveforms to a sequence of numbers which represent estimates
of the transmitted data symbols. These numbers can be represented as binary or M-array.
2.3.7 Channel decoderThe channel decoder works on the reconstruction of the original sequence from the code used
by the channel encoder and the redundancy contained in the received data.
2.3.8 Source decoderThe source decoder accepts the output sequence from the channel decoder, and with
knowledge of the source encoding method used, attempts a reconstruction of the original
signal from the source.
The output of the source decoder is an approximation of the original source. It’s an
approximation because of channel decoding errors and possible distortion introduced by the
source encoder.
xv
2.4 Error detection and correctionError detection and correction refers to the methods used in communication systems to detect
errors in a transmitted signal and correcting it before it reaches the receiver side. The received
information can have errors but the detection process should be able to try and minimize
these errors.
2.4.1 Error detectionThis usually involves sending additional information so that any incorrect data can be
detected and rejected. It is the ability to detect any presence of errors that can be caused by
noise or other factors during transmission to the receiver6.
Error detection schemes popular in telecommunications, use a redundancy check. A
redundancy check refers to any extra data that is added to the message. Error detection codes
transmit more bits than were in the original data. Some of the error detection schemes
include6:
1) Repetition schemes
Given a stream of data that is to be sent, the data is broken up into blocks of bits. When
sending is taking place, each block is sent a predetermined number of times. For example
sending the information 1001 can be sent three times as 1001 1001 1001. The information
is then received say as 1001 1101 1001. When comparing each block of bits, it is seen
that there is an error in the received signal. The error is in the second block. This scheme
is seen to be inefficient as it is susceptible to problems when carrying out comparisons.
2) Parity schemes
This is a scheme that involves the use of parity bits. A parity bit refers to an extra bit that
is transmitted with a data item and is chosen to give the resulting bits as even or odd
parity. Parity refers to the number of bits that are set to 1 in the data. The types of parity
include:
Even parity where the even number of bits are 1.
Odd parity where the odd number of bits are 1.
In the case of the parity bit scheme, the data is broken up into blocks of bits and the
number of 1 bits is counted. A parity bit is then set or cleared depending on if the number
xvi
of bits is odd or even. The disadvantage of parity bit schemes is that it can only be used in
the detection of an odd number of bit errors. When detecting an even number of bits, the
parity then appears to be correct and this can lead to the sending of corrupt information.
3) Check sum
This is the arithmetic sum of message code words of a certain word length. The sum is
usually negated by means of the ones complement and stored or transferred as an extra
code word extending the message. On the receiver side a new check sum may be
calculated from the extension of the message.
4) Hamming distance based checks
The Hamming distance between two bit strings is the number of bits that have to change,
to convert one to other. The error correcting code uses extra bits to make sure the
Hamming distance between any two valid points is greater than 1. If we want to detect d
bits in an n bit word, we can map every n bit word into a bigger n+d+1 bit word so that
the minimum Hamming distance is d+1. Thus if n+d+1 bit word is received and doesn’t
match any word in the mapping, it can successfully be detected as a signal or word with
an error.
If the Hamming distance between valid strings is only one, a single bit error results in
another valid string. This means that an error cannot be detected.
If the Hamming distance is two, then a change in one bit results in an invalid string and
can be detected as an error. If the Hamming distance is four, then a single bit error can be
corrected and a double bit error detected. This form of detection and correction is
frequently referred to as single error correct, double error detect.
5) Cyclic redundancy checks
This is a method of checking for errors in data that has been transmitted on a
communication network. The transmitter applies a 16 or 32 bit polynomial to a block of
data that is to be transmitted and attaches the resulting cyclic redundancy code to the
block. The receiving end then applies the same polynomial to the data and compares the
result with the attached data from the transmitter. If they match, then the data has been
received successfully. However, if they don’t match, then the transmitter is notified to
send the data again due to the detection of errors
xvii
2.4.2 Error correctionSignal correction involves sending additional information so that incorrect signals can be
corrected and accepted. It involves the reconstruction of the original error free data6.
There are two basic ways of designing the channel code for an error correcting system.
These include:
1) Automatic repeat sequence
The transmitter sends the data as well as an error detection code, which the receiver uses
to check for any errors, and make a request for the erroneous data for retransmission. The
receiver, in many cases, sends an acknowledgement of correctly received data and the
transmitter, resends anything that is not acknowledgement within a reasonable period of
time.
2) Forward error correction
The transmitter encodes the data with an error correcting code and sends the coded
message. In this particular case, the receiver never sends any message back to the
transmitter. The receiver decodes the data into an output that can be considered to be
almost accurate. The codes are designed so that it would take a relatively small amount of
noise to make the receiver misinterpret the data.
2.5 Signal acquisitionThe output from the digital signal processing of the information is in symbols per second.
This output is in a digital format. To recover the original information that was sent via the
digital communication network, the signal has to go through digital to analog conversions so
that the output is in a format that can be understood by the person trying to interpret the
information.
xviii
CHAPTER 3: DESIGN AND DEMONSTRATION3.1 IntroductionAs seen from the analysis of sensors used above, for this project, the biopotential sensors
were chosen for the medical condition to be monitored. The condition to be monitored was
the ECG signal which is the electrocardiogram signal which monitors the pulse rate of the
patient. Cardiologists can interpret the stability of a heart patient my monitoring these pulse
signals alongside other vital signs such as blood pressure and body temperature.
Below is a typical ECG signal.
Figure 3.1 showing a typical ECG signal.
As seen in figure 2 above, the ECG signal has two segments and five time intervals. The RR
interval is used for calculation of beats per minute of the pulse to determine the pulse rate of
the patient. Depending on the connection type of the ECG sensors the pulse interval will
vary. The beats per minute are calculated using the RR interval as7:
beats perminute= 60000RR interval
The ECG signal is what will be sent continuously via GPRS. For the ECG signals to be sent
continuously it’ll require that a patient has access to a GPRS ECOMM device and constant
access to packet data. The transmission of this signal will always require that the patient’s
records are readily available and uploaded to a hospital’s server database. The database is
important as it determines what kind of risk the patient being monitored is in.
xix
The design of this project is implemented using MATLAB. The assumptions made are that
the database is already available and that the signal being monitored is generated and ready
for transmission.
Therefore, using MATLAB codes and Simulink blocks, the transmission of the signal via
GPRS will be demonstrated. The project can therefore be summarized using the following
block diagram.
ECG signal
Figure 3.2 showing the block diagram for the home patient monitoring based on GPRS.
3.1.1 ECG signalThe ECG signal was simulated using MATLAB8. The following ECG signal was generated.
The RR interval is at 2 milliseconds.
Figure 3.3 showing ECG signal developed from a MATLAB code.
3.1.2 Signal processing and transmission
xx
ECG sensor Amplification GPRS communication channel
Received ECG signal
This involved the implementation of a digital signal processing section together with a
communication system in order to enable successful transmission of the ECG signal.
The Simulink blocks that were used for the simulation910 were as shown in figure 5 below.
Figure 3.4 showing Simulink blocks for ECG signal transmission via GPRS.
3.1.2.1 Signal from WorkspaceThis is a block that was used for implementing a variable from the MATLAB workspace8. In
this case, the ECG signal was our variable that was used for the ‘Signal from workspace’
block. The ECG variable was a 1*600 matrix. The following was the signal used from the
workspace. This is the signal that was to be transmitted via GPRS.
The signal’s output is in successive sample times. In the case of this experiment, the sample
time was set to 1 second.
xxi
Figure 3.5 showing signal from workspace on Simulink.
3.1.2.2 Image data type conversionThis block is responsible for t he conversion and scaling of the input image into a specific
output data type. The image in this case was converted into a Boolean data type output.
Figure 3.6 showing image data type conversion.
xxii
3.1.2.3 Frame conversionThis is a block that passes the input through to the output and sets the sampling mode output
signal which can be chosen to be either frame based or sample based8. In this case it was
chosen that the sampling mode output would be frame based.
3.1.2.4 Convolutional encoderThis block served the purpose of encoding binary data. A trellis structure was created to
perform this function. The trellis structure was set as:
poly 2trellis (7 [ 171133 ])
3.1.2.5 Convolutional interleaverConvolutional interleaving refers to a method that is used to rearrange a transmitted data
sequence so that it becomes more scattered and rugged to longer sequences of errors.
The Convolutional interleaver block was used to change the order of the input signal (which
is in symbols) using a set of shift registers. This was illustrated using a time scope.
Figure 3.7 showing the interleaved signal using the Convolutional interleaver block.
xxiii
3.1.2.6 GMSK Modulator bandThe Gaussian Minimum Shift Keying is a form is a form of modulation that has no phase
discontinuities used to provide data transmission with an appropriate efficiency for spectrum
usage.
Figure 3.8 showing GMSK modulation of the ECG signal.
3.1.2.7 Multipath Rayleigh FadingRayleigh fading is a statistical model that is used to evaluate the effect of the propagation
environment on a signal such as that used by wireless devices.
This is a block that was chosen to work as the channel for data transmission. It was suitable
as it can be used to implement the air interface as the channel for communication. The
Doppler frequency was set with reference to the sampling period of the signal. The Doppler
frequency was set to 0.9 Hz.
xxiv
Figure 3.9 showing the Multipath Rayleigh fading channel signal.
3.1.2.8 GMSK Demodulator BasebandThis block is used to demodulate the GMSK modulated signal using the viterbi algorithm.
Figure 3.10 showing the GMSK Demodulated signal.
xxv
3.1.2.9 Convolutional deinterleaverThis is the block that restores the interleaved signal using a set of shift registers. This is
illustrated in the figure shown below as seen from the time scope.
Figure 12 showing convolutionally deinterleaved signal.
3.1.2.10 Viterbi decoderThis block was used to decode the convolutionally encoded signal8. The trellis code
that was used was as follows:
poly 2trellis(7 , [ 171 133 ])
The resultant signal from the Viterbi decoder is shown in the diagram below.
xxvi
Figure 3.11 showing the output of the Viterbi decoder.
3.1.2.11 Error rate calculatorThis block was used to compare the number of bits transmitted to the number of bits that
were received on the receiver side.
xxvii
CHAPTER 4: RESULTS AND ANALYSIS4.1 Simulation resultsThe MATLAB simulation was supposed to demonstrate the successful transmission of an
ECG signal via GPRS. The ECG signal went through processes such as:
Sampling
image conversion
convolutional encoding
interleaving
modulation
transmission via a channel
demodulation
deinterleaving
and decoding
The output was given in bits. The transmitted signal was as follows:
Figure 4.1 showing the signal being transmitted.
xxviii
The signal then went through convolution, interleaving and deinterleaving. The table below
summarizes the three processes. This values show the first 60 points.
Table 1
Time signal convintconvdeint
1 1 1 -12 1 1 -13 1 1 14 1 1 -15 1 1 16 1 1 17 1 1 18 1 1 -19 1 1 -1
10 1 1 111 1 1 -112 1 1 113 1 1 114 1 1 115 1 1 116 1 1 -117 1 1 -118 1 1 119 1 1 -120 1 1 -121 1 1 122 1 1 123 1 1 -124 1 1 125 1 1 126 1 1 -127 1 1 128 1 1 129 1 1 130 1 1 131 1 1 132 1 1 133 1 1 134 1 1 135 1 1 136 1 1 137 1 1 -138 1 1 -139 1 1 -1
xxix
40 1 1 141 1 1 -142 1 1 -143 1 1 144 1 1 -145 1 1 146 1 1 147 1 1 148 1 1 -149 1 1 150 1 1 -151 1 1 152 1 1 -153 1 1 -154 1 1 155 1 1 156 1 1 157 1 1 158 1 1 -159 1 1 160 1 1 1
The chart below shows a comparison of the three processes.
1 6 11 16 21 26 31 36 41 46 51 56 61 66 71 76 81 86 91 960
0.5
1
1.5
2
2.5
3
3.5
convdeintconvintsignal
Figure 4.2 showing the comparison of the interleaved, deinterleaved, and the sampled signal.
The diagrams below show the signal that was received on the receiver end. The results were
displayed using a scope and a time scope.
xxx
Figure 4.3 showing the transmitted signal in bits.
xxxi
Figure 4.4 showing the output of the transmitted signal.
The two results were compared to determine if the transmitted signal was the same as the
received signal. This is shown in figure 4.5 below.
xxxii
Figure 4.5 showing the comparison between the transmitted signal and the received signal.
As seen from the figure above the transmitted signal and the received signal are not the same.
This shows that there were some errors that the signal encountered during transmission. The
bit error rate calculated gave the following results.
4.2 Bit error rate calculation results.The simulation was running for 1000 seconds. The total number of bits that were sent in these
1000 seconds was a total of 1001.
Out of the 1001 bits sent in the 1000 seconds, the digital communication system successfully
sent 493 bits.
This then shows that the bits that were not sent successfully were:
unsuccessfully sent bitsdue¿errors=1001−493=508
xxxiii
The bit error rate was then calculated as:
BER= 5081001
=0.5075
This shows that approximately 50% of bits were sent successfully via the constructed GPRS
communication network.
xxxiv
CHAPTER 55.1 DiscussionThe project was undertaken over a period of up to five months. The challenges that were
faced during the course of undertaking this project were mostly attributed to time.
The project simulation faced challenges of its own. The main challenge of the simulation was
ensuring that the parameters of the blocks in Simulink were incorporated and working well
together. The sampling time was a main determinant for ensuring that the simulation would
be working appropriately.
The sampling time was set to a relatively low value of as low as 1 second. The sampling time
determined the functioning of the Multipath Rayleigh fading channel.
The Doppler frequency was set to a value of 0.9 Hz as the assumption made was that the
patient is indoors the whole time and noise interference is contained to a minimum.
Setting the convolutional encoder was also a challenge as well. This was because the
convolutional encoder could only receive data type Boolean. This was however corrected
using the digital signal processing toolbox, where the data type of the Image data type
conversion was set to Boolean.
A challenge was also faced when trying to transmit the ECG signal from the workspace. This
was because the ECG variable had unsuitable matrix dimensions for transmission. This
challenge was met by using the ‘Reshape’ function. After reshaping then the signal was ready
for transmission.
Errors in the received signal can be attributed to encoding and interleaving sections.
xxxv
5.2 ConclusionThe project was successful but with 50% error rate for transmission of the ECG signals via
GPRS. However, with the course of time the BER rate was reduce to 0.5075 from 0.88.
The received signal was not similar to the transmitted signal. However during the simulation
it was noted that there were some bits which were transmitted successfully.
5.3 RecommendationsIf the project were to be implemented, there are two recommendations I would make.
5.3.1 Bluetooth home patient monitoring device and applicationThis particular recommendation would implement the use of the ECG circuit which
incorporates an amplifier, bandpass filter and the PIC16F877A microcontroller. The device
would be able to send continuous vital signs via bluetooth to an android phone. The android
phone will have an application that will be receiving the data. The received data would then
be sent using GPRS by enabling packet data on the mobile phone. The data would then be
sent continuously to a hospital’s server for continuous patient monitoring.
5.3.2 Sensory circuit and EF Com Pro GPRS/GSM moduleThe EF Com Pro GPRS/GSM module is a transceiver has connection pins that can allow the
connection of any sensory circuit and transmit and publish data to a set website.
Figure 5.1 showing the EF Com Pro GPRS/GSM module.
xxxvi
In the case of home patient monitoring the output of the sensory circuit would connected to
these pins. The EF Com Pro GPRS module costs around Kshs.7200. It uses an Arduino board
and the microprocessor used for communication is the ATMega 328. This microprocessor
would be coded to enable the sending of the patient’s vital signs to a specific hospital server
and the transmitted data would be set in a way that the user at the hospital would be able to
interpret.
From the above the above recommendations the bluetooth device together with the
application would be a cheaper option. It would also be less bulky.
xxxvii
APPENDIX AMATLAB CODE FOR ECG SIGNALEcgen.m
a_pwav=0.25;
d_pwav=0.09;
t_pwav=0.16;
a_qwav=0.025;
d_qwav=0.066;
t_qwav=0.166;
a_qrswav=1.6;
d_qrswav=0.11;
a_swav=0.066;
t_swav=0.09;
a_twav=0.35;
d_twav=0.142;
t_twav=0.2;
a_uwav=0.035;
d_uwav=0.0476;
t_uwav=0.433;
else
rate=input('\n\nenter the heart beat rate:');
li=30/rate;
fprintf('\n\np wave specifications\n');
d=input('Enter 1 for default specification else press 2:\n');
if(d==1)
a_pwav=0.25;
d_pwav=0.09;
t_pwav=0.16;
else
xxxviii
a_pwav=input('amplitude=');
d_pwav=input('duration=');
t_pwav=input('p-r interval=');
d=0;
end
fprintf('\n\nq wave specifications\n');
d=input('Enter 1 for default specification else press 2:\n');
if(d==1)
a_qwav=0.025;
d_qwav=0.066;
t_qwav=0.166;
else
a_qwav=input('amplitude=');
d_qwav=input('duration=');
t_qwav=0.1;
d=0;
end
fprintf('\n\nqrs wave specifications\n');
d=input('Enter 1 for default specifications\n');
if(d==1)
a_qrswav=1.6;
d_qrswav=0.11;
else
a_qrswav=input('amplitude=');
d_qrswav=input('duration=');
d=0;
end
fprintf('\n\ns wave specifications\n');
d=input('Enter 1 for default specification else press 2:\n');
xxxix
if(d==1)
a_swav=0.25;
d_swav=0.066;
t_swav=0.125;
else
a_swav=input('amplitude=');
d_swav=input('duration=');
t_swav=0.125;
d=0;
end
fprintf('\n\nt wave specifications\n');
d=input('Enter 1 for default specification else press 2:\n');
if(d==1)
a_twav=0.35;
d_twav=0.142;
t_twav=0.18;
else
a_twav=('amplitude=');
d_twav=('duration=');
t_twav=input('s-t interval=');
d=0;
end
fprintf('\n\nu wave specifications\n');
d=input('Enter 1 for default specification else press 2:\n');
if(d==1)
a_uwav=0.035;
d_uwav=0.0476;
t_uwav=0.433;
else
xl
a_uwav=input('amplitude=');
d_uwav=input('duration=');
t_uwav=0.433;
d=0;
end
end
pwav=p_wav(x);
qwav=q_wav(x);
qrswav=qrs_wav(x);
swav=s_wav(x);
twav=t_wav(x);
uwav=u_wav(x);
ecg=pwav+qrswav+twav+swav+qwav+uwav;
plot(x,ecg);
p_wav.m
function [pwav]=p_wav(x)
l=1;
a=0.25
x=x+(1/1.8);
b=3;
n=100;
p1=1/l
p2=0
for i = 1:n
harm1=(((sin((pi/(2*b))*(b-(2*i))))/(b-(2*i))+(sin((pi/(2*b))*(b+(2*i))))/(b+(2*i)))*(2/pi))*cos((i*pi*x)/l);
p2=p2+harm1
end
pwav1=p1+p2;
xli
pwav=a*pwav1;
q_wav.m
function [qwav]=q_wav(x)
l=1;
x=x+l/6
a=0.025;
b=15;
n=100;
q1=(a/(2*b))*(2-b);
q2=0
for i = 1:n
harm5=(((2*b*a)/(i*i*pi*pi))*(1-cos((i*pi)/b)))*cos((i*pi*x)/l);
q2=q2+harm5;
end
qwav=-1*(q1+q2);
s_wav.m
function [swav]=s_wav(x)
l=1;
x=x-l/6
a=0.25;
b=15;
n=100;
s1=(a/(2*b))*(2-b);
s2=0
for i = 1:n
harm3=(((2*b*a)/(i*i*pi*pi))*(1-cos((i*pi)/b)))*cos((i*pi*x)/l);
s2=s2+harm3;
end
xlii
swav=-1*(s1+s2);
qrs_wav.m
function [qrswav]=qrs_wav(x)
l=1;
a=1;
b=5;
n=100;
qrs1=(a/(2*b))*(2-b);
qrs2=0
for i = 1:n
harm=(((2*b*a)/(i*i*pi*pi))*(1-cos((i*pi)/b)))*cos((i*pi*x)/l);
qrs2=qrs2+harm;
end
qrswav=qrs1+qrs2;
t_wav.m
function [twav]=t_wav(x)
l=1;
a=0.35
x=x-(1/1.8);
b=7;
n=20;
t1=1/l
t2=0
for i = 1:n
harm2=(((sin((pi/(2*b))*(b-(2*i))))/(b-(2*i))+(sin((pi/(2*b))*(b+(2*i))))/(b+(2*i)))*(2/pi))*cos((i*pi*x)/l);
t2=t2+harm2
end
twav1=t1+t2;
xliii
twav=a*twav1;
u_wav.m
function [uwav]=u_wav(x)
l=1;
a=0.03;
x=x-(1/1.1);
b=21;
n=100;
u1=1/l;
u2=0;
for i = 1:n
harm4=(((sin((pi/(2*b))*(b-(2*i))))/(b-(2*i))+(sin((pi/(2*b))*(b+(2*i))))/(b+(2*i)))*(2/pi))*cos((i*pi*x)/l);
u2=u2+harm4;
end
uwav1=u1+u2;
uwav=a*uwav1;
xliv
APPENDIX BMATLAB SIMULINK SIMULATION BLOCKS
Figure 6 showing the simulation blocks for the ECG signal transmission.
xlv
Bibliographyx
[1] (2014) GSMA. [Online]. http://www.gsma.com
[2]Daniel Marr, "ECG application featuring transmission via bluetooth.," University of Queensland, Bachelor of Engineering indivision of Computer systems engineering 2001.
[3]Michael R. Neuman, The Biomedical engineering handbook, 2nd ed.
[4]P. Wang, Biomedical sensors and measurements. Heidelberg, 2011.
[5]Wiley online library. [Online]. onlinelibrary.wiley.com
[6]Allen H. Levesque Arnold M. Michelson, Error control techniques for digital communication.
[7]A. N. M. M Haque, G. Tangim, T. Ahammad and M. R. H Khonokar M. K Islam, "Study and analysis of ECG signal using MATLAB & LABVIEW as effective tools.," vol. IV, no. 3, June 2012.
[8]Mathworks. [Online]. http://www.mathworks.com
[9]Morgan Doyle. (2010) Morgan Doyle limited. [Online]. http://www.morgandoyle.co.uk
[10]V Thulasi Bai and SK Srivatsa, "Design and implementation of mobile telecardiac system," April 2007.
x
xlvi
top related