You are on page 1of 56

FPGA BASED DIGITAL FILTER DESIGN FOR

BIOMEDICAL SIGNAL PROCESSING

Supervisor

Engr. M. Usman

Submitted By

Bilal Ahmed 16-ECT-05


Furqan Shafiq 15-ECT-59
Awais Mehmood 15-ECT-86

DEPARTMENT OF ELECTRONICS ENGINEERING

UNIVERSITY OF ENGINEERING AND TECHNOLOGY


TAXILA SUB CAMPUS CHAKWAL

August 2020

1
FPGA BASED DIGITAL FILTER DESIGN FOR
BIOMEDICAL SIGNAL PROCESSING

Supervisor

Engr. M. Usman

Submitted By

Bilal Ahmed 16-ECT-05


Furqan Shafiq 15-ECT-59
Awais Mehmood 15-ECT-86

Chairman Signature: __________________________________________________

Project Supervisor Signature: ___________________________________________

DEPARTMENT OF ELECTRONICS ENGINEERING

UNIVERSITY OF ENGINEERING AND TECHNOLOGY


TAXILA SUB CAMPUS CHAKWAL

August 2020

2
CERTIFICATE

This is to certify that Bilal Ahmed, Furqan Shafiq and Awais mehmood have successfully

accomplished their final year project. This project “FPGA based Digital Filter design for

Biomedical Signal Processing” was assigned to them to meet the partial requirements for the

Bachelor Degree of Electronics Engineering.

Engr. M. Usman

Project Supervisor

Dr. Muhammad Abdul Basit

Chairman

3
Declaration

We hereby declare that the contents of thesis, “FPGA base Digital Filter Design for

Biomedical signal Processing” is product of our own research and no part has been copied

from any published source (except the references, standard mathematical and generic formulas

and equations). We further declare that this work has not been submitted in support of another

award or qualification either at this institution or elsewhere. The material used from other

sources has been properly acknowledged / referred.

Signature

Bilal Ahmed

16-ECT-05

Signature

Furqan Shafiq

16-ECT-59

Signature

Awais Mehmood

16-ECT-86

4
DEDICATED

TO
Our beloved parents and supervisor
Engr. M. Usman
For their affections, prayers and
support
&
To our beloved siblings for their
endless support, encouragement and
corporation.

5
Acknowledgements

All praises are for Allah almighty; the most beneficent and the merciful. His blessings have

given us the ability to complete our project, without that it is impossible to complete our work.

Secondly, we would offer our heartiest thanks to the last messenger of Allah almighty; the Holy

Prophet Muhammad (PBUH) whose enlightening message always brighten our heart. His

guidance encourages us at every difficult step of our life.

We feel highly privileged to express our heartiest gratitude to our honorable supervisor

Engr. Muhmmad Usman Under whose kind, sympathetic attitude, guidance, motivation

through study and insightful supervision our project and thesis is accomplished. We would like

to thanks our external supervisor Engr. Muhammad Tahir khan for his cooperation and

support to bring this project to completion.

We would also like to thanks our families and friends for their

continuous encouragement, moral support, prayers and affections at all levels.

6
Abstract

The project describes the implementation, processing and analysis of Biomedical signal. This

project include processing of ECG signal through IIR, FIR, band-pass, low-pass and high pass

filters (digital). Designed model can be use for field programmability. It will provide the

leverage of application based working, one can change its working through programmability

of FPGA kit. The sampling frequency for our project is 8khz considering the components. A

16 bit analog to digital convertor is used in this project to keep the resolution high. The FIR

filtering technique is use for linear phase response. This project provides better speed because

of gate logics and can process a lot of data at single Processing time. We are using MATLAB,

ISE design Software to perform the simulations for desired results. It is efficient and provides

better results in the field of biomedical. It is a low power Digital signal processing kit with

multiple functions, so it very well may be use in numerous different fields like EEG or ECO

signal handling.

7
Table of Contents
Declaration 4
Acknowledgements 6
Abstract 7

Chapter 1 12

Introduction
1.1 BACKGROUND
1.2 Non-invasive ECG technique
.3 Problem Statement
1.4 Objective
1.5 Deliverable
1.6 Thesis Outline

Chapter 2 17
Literature review
2.1 Techniques for digital filtering
2.1.1 FIR filtering
2.1.2 IIR Notch filtering
2.1.3Adaptive filtering
Chapter 3 22

Noises and Disturbances


3.1 Types of noises
3.1.1 Power line interference
3.1.2 EMG noise
3.1.3 Base line Wander noise
3.1.4 Channel noise
3.1.5 Electrode contact noise
3.1.6 Motion Artifacts

Chapter 4 27

Selection, Designing and response of digital filters

4.1 Selection of digital filter


4.2 Designing and Responses of digital filters
4.2.1 Low pass Filter
4.2.1.1 Filter specifications
4.2.2 High pass Filter
4.2.2.1 Filter specifications
4.2.3 Notch Filters
4.2.3.1 Filter specifications

Chapter 5 40

Implementation of project
5.1 Data acquisition
5.2 Signal processing
5.3 Implementation

8
Chapter 6 44
Social Impact and recommendations
6.1 Social Impact
6.2 Recommendation and future work
Chapter 7 47
Conclusion
7.1 Conclusion
Chapter 8 49
References
8.1 References

Chapter 9 52
Appendix
9.1 Appendix
9.1.1 Codes
9.2 Hardware components
9.2.1 Detail of hardware
9.2.2 Gantt Chart

9
List of Figures

Figure 1 – Normal ECG sinus Rhythm


Figure 2 – Non invasive ECG
Figure 3 – Adaptive filter
Figure 4 – PLI grounding
Figure 5 – PLI signal flow graph
Figure 6 – Effect of EMG noise in ECG
Figure 7 – Effect of baseline wander
Figure 8 – Effect of motion artifact in ECG
Figure 9 – Filters types block diagram
Figure 10 – Magnitude response of FIR low pass filter
Figure 11 – Phase response of FIR low pass filter
Figure 12 – Mag vs Phase response of FIR low pass filter
Figure 13 – Impulse response of FIR low pass filter
Figure 14 – Phase delay of FIR low pass filter
Figure 15 – Group delay of FIR low pass filter
Figure 16 – PZ-map of FIR low pass filter
Figure 17 – Magnitude response of IIR high pass filter
Figure 18 – Phase response of IIR high pass filter
Figure 19 – Magnitude vs phase response of IIR high pass filter
Figure 20 – Impulse response of IIR high pass filter
Figure 21 – Phase delay of IIR high pass filter
Figure 22 – Group delay of IIR high pass filter
Figure 23 – PZ-map of IIR high pass filter
Figure 24 –Magnitude response of notch filter
Figure 25 – Phase response of notch filter
Figure 26 – Mag vs phase response of notch filter
Figure 27 – Impulse response of notch filter
Figure 28 – Group delay of notch filter
Figure 29 – ECG signal at 38400 baud rate
Figure 30 – ECG signal at 19200 baud rate
Figure 31 – ECG signal at 9600 baud rate
Figure 32 – Spartan 6
Figure 33 – ECG sensor(ad8232)
Figure 34 – ADC (ads1194)
Figure 35 – Arduino UNO

10
List of Abbreviations

IIR: Infinite impulse response


FIR: Finite impulse response
PLI: Power line Interference
EMG: Electromyogram
FPGA: Field Programmable Gate Array
ADC: Analog to digital communication
VGA: Visual graphic Array
ECG: Electrocardiography

11
Chapter 1

Introduction

12
Chapter 1

Introduction

1.1 BACKGROUND

Electrocardiography (ECG) is a procedure that produces a signaled graph. This graph


contains voltage on its one axis and cardio activity on the other side. The graph can be obtained
using electrodes that are placed on skin of patient. These electrode terminals recognizes the
little electrical changes that are an outcome of cardiovascular muscle depolarization followed
by repolarization in every cardiac cycle. Abnormality in ECG pattern of any patient shows the
abnormality in multiple cardiac malfunctioning, which includes disturbance in cardiac rhythm,
problem in flow of blood or can occur because of the improper implementation of electrodes
on the body. So, while placing the electrode it must be make sure that the electrodes are placed
well and have firm position over the places position.

Fig 1.Normal ECG sinus rhythm

The old conventional ECG technique consists of 12 leads, from which 10 of them are placed
on the patient’s limb and chest surface. The general magnitude of heart’s electric potential is

13
then estimated from 12 unique leads use for electrocardiography and then it is recorded for a
specific time to analyze it. Generally, it is recorded for 10sec. In this way the overall behavior
of heart working can be analyzed. It records the bio-potential that is produced by cardiac
activity. We had used modern ECG technique in which 3 electrodes are use to record the cardio
signals. The main reason of ECG is to check for following reasons.

 Verification of respiratory failure.


 To predict the failure in respiratory system.
 Monitor changes in heartbeat.

1.2 Non-Invasive ECG:

It is the technique in which there establishes no connection between electrodes


and human body. It is a clinical strategy that is characterized as non-instructive technique in
which none of the surgical component breaks in the skin.

Fig 2.Non-invasive ECG


It is modern method use for electrocardiography in which 3 electrodes are use to analyze
activity of heat. QRS complex is the major peak which contains major information of cardiac
activity.

1.3 Problem Statement:

‘‘FPGA-based Digital Filter Design for Biomedical Signals. Equipment that are already

present are much expensive and have efficiency of up to 80%. The devices use for ECG

14
are application specific but this project will provide the leverage of field programmability,

which will makes it able to perform multiple function just by changing the programming of

board’’.

1.4 Objective:

The objective is to achieve efficiency, flexibility in field and high processing speed

for biomedical signal processing. This project aims to eliminate the limitation of field

specified chips.

1.5 Deliverables:

This project is about designing of the Digital filter designing of digital filters for

electrocardiogrpahy on FPGA kit. The main motive behind using the FPGA kit is shifting

the things to flexibility and modernability. The deliverables include the filter designs, their

responses and their simulations. The techniquse use for this purpose are FIR, IIR, Lowpass,

Highpass and bandpass filtering. The circuitry includes Spartan6(FGPA kit) , heartbeat

sensor(ad8232) , vga cable and few other connection cables.

1.5 Thesis outline:

The outline of thesis is as follow.

Chapter 2: This chapter gives an overview of literature review, the work that had previously

been and progress of different techniques used to achieve results.

Chapter 3: This chapter presents the noises and disturbances in Electrocardiographic signal.

Chapter 4: This chapter presents the selection, designing and responses of filters.

15
Chapter 5: This chapter evaluates the project, discusses its design, and draw the results.

Chapter 6: The social impacts of the project come under discussion in this chapter and

recommendations are proposed to avoid the things that can hurdle in progress and weaknesses

of the project are discussed.

Chapter 7: This chapter gives the conclusion of the work.

Chapter 8: This chapter provides the references used.

Chapter 8: This chapter provides appendix.

16
Chapter 2

Literature Review

17
Chapter 2

Literature Review

Various methods have been used by researchers and engineers for designing of digital filters
on various boards. But every technique has its own pros and cons.

2.1. Techniques for digital filtering


There are various techniques used previously and are being used today for the
processing of biomedical signals. Commonly used techniques are FIR, IIR filtering.

2.1.1 FIR filtering:

There are basically two types of filters, one of them is finite impulse response
and other is infinite impulse response filter(recursive and non-recursive filters). Finite impulse
response filter is mostly chosen because of its stability and simplicity. Before choosing between
recursive and non-recursive filter few things must be considered

 Computational property.
 Storage capacity required for implementation.

Window method is the simplest method in designing of FIR filter. It consist of an array of a[n]
which consist of coefficients satisfying the requirement of proposed filter. In window method
designing of FIR filter it is specified which window will be used. The frequencies that are
below the cut off range of frequency are allowed to pass with unity amplitude, while higher
frequencies are blocked. We can acquire our desired response by taking inverse fourier
transform.

These type of filters are stable and have linear phase. In z-plane the frequency response
and magnitude characteristics of FIR filters is determined by zeros.

Z-transform of N-point FIR filter can be calculated by

18
𝑁−1
𝐻 (𝑧 ) = ∑ ℎ(𝑛)𝑧 −𝑛
𝑛 =0

This type of filter is useful in those applications where we require exact linear phase. Non-
recursive techniques are generally implemented to achieve the stability. For ease in designing
and simplicity FIR filters using different windows are preffered.

 Rectangular Window

W(m)= 1, 0≤m≤K-1

=0 otherwise
 Hanning window
W(m)= 0.5- 0.5* cos(2πm/K-1), 0 ≤ m ≤ K-1

=0 otherwise

 Hamming Window

W(m)= 0.54- 0.46* cos(2πm/K-1), 0 ≤ m ≤ K-1

=0 otherwise

 Blackman Window

W(m)= 0.42- 0.5* cos(2πm/K-1), 0 ≤ m ≤ K-1

=0 otherwise

In stop band pulsation and sharp loss(attenuation) was clear. Filter is stable in case of pass band.
In case of hanning, hamming and blackman window, we can not achieve sharp cut off.

19
2.1.2 IIR Notch filtering:
Power line interferences and baseline wander are removed by IIR filters by
different researchers. IIR filters are only used where we require lower order of filter. IIR is also
bit simpler in design. Stationary power line interference are removed by using notch filters. Its
amplitude, frequency and phase do not vary with time. There cause distortion in ECG spectrum
In the absence proper information about power line interference noise.

Q=f / 𝛻f

From the equation it is clear that quality factor will decrease with the increase in bandwidth
and vice versa. Whereas increase in the quality factor causes a decrease in attenuation level.
To remove PLI noise up to a higher amount from our ECG signal the notch filter must have a
higher attenuation level.

There are few drawbacks in using IIR notch filter.

 As, we know PLI noise can be removed by increase in level of attenuation but this
causes an increase in bandwidth of notch filter. Thus disturbs the nearby spectrum.
 After using IIR notch filter, further filtering is required.
 Such filters require more memory.

2.1.3 Adaptive filtering:


It is a filter which has a property of self adjustment of its transfer function in
accordance to the algorithm which is driven by an error signal. Because of its complexity they
are mostly digital filters. In ECG signal we take the mean squared value of signal between
primary and reference input. Adaptive filters reduces the error generated by that. PLI can also
be removed using this technique but the high frequency noises can be removed using notch
rejection filter.
It has also an advantage of usage, where we have no information about the
parameters of required operation. It uses the feedback strategy in form of error signal to refrain
the parameters according to desired requirements. The working of filter is to remove noise,
extraction of information signal and separation of two or more signals. The word adaptive
makes it clear that it adapts the situation, which means it will adjust its parameters that depends

20
upon the other system behavior and its surrounding. Terminology of filter makes it clear that it
will process any input signal and will generate the desired signal at the output.

Fig 3. Adaptive filter

 d(n) is not only the desired signal but it also contains some unnecessary noise.

d(n)=s(n)+n(n)

 n(n) is undesired noise and the desired signal can be obtained by subtracting noise
signal from the d(n).

Desired signal = d(n)-n(n)

There are two classification of adaptive filters. One of them is digital filter and other one is
adaptive algorithm. Proper filtering coefficients are made by adaptive filters but its coefficients
are also changed by surrounding (input signal, characteristics of output signal etc).
Advantage of adaptive filtering are as follow.

 Response of filtering is faster.


 Maximum reduction in error.
Drawbacks of using adaptive filters are as follow
 For the process of effective filtering this type of filter requires the reference
signal(characteristic of noise or signal).

21
Chapter 3

Noises and Disturbances

22
Chapter 3

Noises and Disturbances

In this chapter we will discuss about the hurdles in acquiring our desired signal. In ECG signal
different type of noises are present and they cause disturbances in our desire signal.

3.1 Type of noises:


The major types of noises that have been seen so far in the ECG signal are as follow.

 PLI (power line interference)


 EMG (Electromyogram)
 Baseline Wander
 Channel noise
 Electrode contact noise
 Motion artifacts

3.1.1 Power line interference:


These pickup and harmonics are of 50Hz and 60Hz. The major cause of this
type of noise id Electromagnetic interference, filed lines from nearby machines. Due to loops
in the cable stray effect of alternating current field are produced. It is also created because of
improper grounding of ECG machine or patient.

Fig 4.PLI grounding

23
In Pakistan we use 50Hz frequency, the devices like Ac, X-ray unit or elevators induces 50Hz
signal in the ECG machine input circuit.

Fig 5. PLI signal flow graph


Powerline interferences must be removed from the ECG signal because the low frequency
components are completely superimposed like P wave and T wave.

3.1.2 EMG noise:


This type of noise is generated because of electrical activity of the muscle of
patients body. The maximum frequency in ECG is 10kHZ. This type of noise interfere with
sections of ECG which causes problems in analyzing and data processing. It causes difficulties
in few ECG applications, mainly in recording of ECG signal during exercise. Low amplitude
signal components may be eliminated because of EMG noise.

Fig6. Effect of EMG noise in ECG

24
This type of noise overlaps with PQRST complex. ECG repeats itself, so different methods can
be use to reduce noise. Success of noise reduction through averaging is limited to one QRS
signal at a time. Hence there is still need of another technique for ECG signal processing.

3.1.3 Baseline Wander noise:


In ECG signal low frequency noise components are present. It occurs because
of respiration or movement in body. In signal, its components have low frequency. This noise
creates problem while detecting the peak of the signal. It is the drift effect where the signal
appears to be wander on the base axis(x-axis). This effect causes the whole signal to shift away
from normal position. The baseline wander occurs because of improper placement of electrodes
on skin, which causes skin-electrode impedance. Its frequency components ranges round about
0.5Hz.

Fig7.Effect of Baseline wander

Baseline wander increases with the body movement during exercise or stress test. Since an FIR
high pass filter with cut off frequency of 0.5Hz can remove this noise.

3.1.4 Channel noise:


It is introduced in the system when signal is transmitted over the channel. Poor
condition of channel is the only reason for this type of noise. It is similar to white Gaussian
noise consisting of all components of frequency.

25
3.1.5 Electrode contact noise:
This type of noise is occurred because of the loos of contact between skin and
the electrodes. The duration of noise is 0.1sec. Measurement system from the subject is
effectively disconnected as electrodes loses its contact with the skin.

3.1.6 Motion Artifacts:


The main reason behind the electrode motion artifacts is skin stretching due to
which change in impedance of skin around electrode occurs. This noise has characteristics just
like baseline wander. Their spectral contents overlap with PQRST, since they are more
problematic and complex. Their frequency range is from 1 to 10Hz.

Fig8. Effect of Motion artifact in ECG

They have mostly high amplitude. So, mostly they cause confusion of QRS complex because
of similarity between both of them. As this impedance changes, the ECG intensifier sees an
alternate source impedance which structures a voltage divider with the enhancer input
impedance in this manner the intensifier input voltage relies on the source impedance which
changes as the electrode position changes.

26
Chapter 4

Selection, Designing &


response of digital filters

27
Chapter 4

Selection, Designing & response of


digital filters

We had observed numerous types of noises in our signals in the last chapter. To acquire the
desired and correct ECG signal we must remove these types of noises from our signal. The
selection of filters and their designing must be based on few factors like constant phase, order
of filter and availability of resources. By considering all the situations we have to design
required filter. We have used FIR and IIR filters to denoise our noisy ECG signal. MATLAB
and Xilinx are used to design filters.

4.1 Selection of digital filter:


For selecting filters, we need to compromise between order, cutoff and passband ripples
and stopband attenuation. If we want sharp cutoff from passband to stopband transition band,
we need to increase the order of the filter but by increasing the order of the filter the system
becomes computationally complex. Similarly, if we want very little ripples in the passband, we
also need to increase the order of the filter again same problem arises. Lastly if we want very
high attenuation in stopband we have to again use a filter with large order.

Another problem that arises in selecting these filters is their phase response in passband.
We need linear phase in passband. If a filter has a non linear phase response, it will distort the
signal very badly. FIR filters can give us linear phase but the order of these filters is huge. And
IIR filters can give us sharp cutoff with very low order but they have non linear phase response
and have stability issues.

So, there is a trade off between linear phase, sharp cutoff and order.

As discussed in the previous chapter, ECG signal contains different types of noises, which can
be removed by different techniques. We have used FIR low pass filter and used equiripple
technique because of maintaining a constant level of passband gain. This filter will remove

28
high frequency noise from the signal. And a property of FIR filters is that they have a linear
phase response in passband which is desired in this case.
Secondly, for removing power line interference noise we need a sharp cutoff to supress 50 Hz
frequency component. We can use IIR notch filter because they have a sharp cutoff with very
low order compared with the FIR filter which can give us our desired frequency response but
the order becomes so large that using an FIR filter in this case is not feasible.
For removing baseline wander noise, we will use IIR high pass filter that has a cutoff at 0.5 Hz
and passband from 1Hz and above. Again we have used IIR filter in this case because we need
a sharp cutoff and low order filter. If we use FIR filter, again the same problem arises that these
filters have a very large order for a sharp cutoff which increases the computational complexity.

4.2 Designing & Responses of digital filter:


We had designed Low pass, High pass, Band stop(FIR and IIR) filters.

Fig9. Filters types used

4.2.1 Low pass Filter:


As, we have to design a low pass filter for specific signal. So, the condition to
be followed for digital filter are as under.

29
4.2.1.1 Filter specifications:

 The dominant frequency in ECG signal are up to 150Hz. So, We have to set our cut
off at 150Hz.

Fig 10. Magnitude response of FIR low pass filter

 We had designed it through FIR filtering technique because it covers the whole
required frequency band and secondly the requirement of linear phase is accomplished
because of it. Order in FIR is higher than IIR but due to linear phase requirement we
have to make a tradeoff in between order and phase.

Fig 11. Phase response of FIR low pass filter

 If we design it through IIR filtering technique then we are unable to achieve the linear
phase. The order achieved with IIR is lower but the important condition of linear phase
is not accomplished. So, we prefer to use FIR filtering techniques.

30
 This technique causes the ripples to a constant attenuation in stop band.

 FIR filtering using equiripple technique have finite transient and stable.

 If we compare both the magnitude and phase response then we can see that we have
achieved our linear phase requirement.

Fig 12. Mag vs Phase response of FIR low pass filter

 Impulse response of our designed filter is as under.

Fig 13. Impulse response of FIR low pass filter

31
 It gives the constant phase delay in frequency just like delay in time.

Fig 14. Phase delay of FIR low pass filter

 Group delay is the delay of filter from input to output. It is a function of frequency.
The delay from input to output is also required to be constant and the response of our
filter as under.

Fig 15. Group delay of FIR low pass filter

 Pole-Zero plot shows the stability of our designed system.

32
Fig 16. Pole zero map of FIR low pass filter

4.2.2 High pass Filter:

As, we have to design a high pass filter for specific signal. So, the condition to be
followed for digital filter are as under.

4.2.2.1 Filter specifications:

 The cut off frequency required for this signal is 0.5Hz and pass band is above 1Hz.
The sharp cut off can be observed.

Fig 17. Magnitude response of IIR high pass filter

33
 We had selected IIR filter here because we needed a sharp cut off with lower order.

FIR can also give us sharp cut off but its order is very much increased and is difficult
to make it realizable.
 The response of our designed filter is linear in pass band and nonlinear in stop band.

So, it meets our requirements and can be use for our application.

Fig 18. Phase response of IIR high pass filter

 If we compare magnitude response and phase response then we can see after 5Hz it
becomes linear as required.

Fig 19. Phase vs Magnitude response of IIR high pass filter

34
 Impulse response of our designed filter is as under.

Fig 20. Impulse response of IIR high pass filter

 Phase delay is non linear in stop band and after 5Hz it becomes constant. So, We can
achieve our filteration according to our requirement.

Fig 21. Phase delay of IIR high pass filter

 In stop band group delay is higher but when it comes inside the pass band group delay
reduces to zero, which is very good.

35
Fig 22. Group delay of IIR high pass filter

 Pole zero plot shows that poles are on the unit circle. Which means critically damped
system. This is the drawback of IIR filtering.

Fig 23. PZ map of IIR high pass filter

4.2.3 Notch Filter:

As, we have to design a notch filter for specific signal. So, the condition to be followed
for digital filter are as under.

36
4.2.3.1 Filter specifications:

 It is 50Hz Notch filter for reducing power line interference. This filter will eliminate
the effect of the 50Hz electric interferences.

Fig 24. Magnitude response of notch filter

 In pass band the repose is approximately near to the desired value. We can verify it with
the help of its graph.

Fig 25. Phase response of notch filter

 It has constant phase in our specified range. So, the response in stop band will not
produce any impact. The desired conditions are almost fulfilled.

37
Fig 26. Magnitude vs phase response of notch filter

 Impulse response of our designed filter is as under.

Fig 27. Impulse response of notch filter

 The group delay of our filter is zero as it comes to our pass band and the delay in stop
band dose not produces any impact on our filter performance.

38
Fig 28. Group delay of notch filter

39
Chapter 5

Implementation of Project

40
Chapter 5

Implementation of Project

Our project implementation is divided into three major steps. The first part is to acquire the
Electrocardiographic signal. This is the signal which we are taking as input and then we are
going for further processing. It is the second step of our project implementation in which firstly
we will acquire an ECG signal through a controller and then we are further processing it by the
help of ADC and then passing it through our designed filters. The last step is its implementation
on FPGA kit and then connecting kit to the PC or Laptop with the help of VGA cable.

5.1 Data acquisition:

The first step in the project is data acquisition. We had acquired ECG signal
with the help of ad8232 (ECG) sensor and controller. The noisy signal is achieved by the help
of it. We had observed the waveform at different baud rates. Let us analyze few of them.

Fig 29. ECG signal at 38400 baud rate

41
Fig 30. ECG signal at 19200 baud rate

Fig 31. ECG signal at 9600 baud rate

As we can see that the signal is very noisy. As , from the result we can see different type of
noises in the signal that are discussed in the previous chapters. We can see that the baseline
wander has shifted the level of the signal from 0 to an arbitrary value.

By analyzing the signal, we can also see that the high frequency noise is also present in the
signal, like electromyogram noise, muscle artifacts and noise generated by the movement of
the patient.

42
5.2 Signal processing:

As discussed in the previous chapter, these types of noises can be removed using
filters with desired responses.

 For base line wander we have used a high pass filter with cutoff of 0.5 Hz and a
passband from 1 Hz and above. Since, baseline wander is a low frequency noise.
 For electromyogram noise we have used a low pass filter with cutoff from 150 Hz. This
will remove the high frequency noise components in the signal. Usually high frequency
noise has dominant components from 150 Hz and above.
 Power line interference is embedded in our signal at 50 Hz and for removing this we
have used a notch filter.

5.3 Implementation:

The final stage of our project is implementation of digitally designed filter. To remove
the errors from our incoming ECG signal these filter perform efficient working. The data is
taken from ECG sensor and then taken to ADC, further the digital data is to process on FPGA
kit and at the output there is a VGA cable that connects the kit with the laptop. But due to
pandemic situation and unavailability of kit, components and labs we were unable to observe
the results after implementation on FPGA. We were only able to perform software simulations.

43
Chapter 6

Social Impact &


recommendations

44
Chapter 6

Social Impact & recommendations

The chapter includes the social impact that the “FPGA based digital filter design for biomedical
signal processing” project will have great importance in the whole world and this technology
is overcoming many fields. So, it will have great worth in future.

6.1 Social Impact:

This project is developed with the aim in mind that it will be economical for hospitals
to buy. ECG machines are very costly and can cost up-to 200,000 Rs per unit. Heart diseases
are the leading cause of deaths in the world. With 17.9 million deaths per year that are caused
by heart related diseases. This makes the diagnostic of these diseases very crucial. But most
people are unaware that they may have a heart related issue due to unavailability of ECG
machines because of their cost. We are aiming to reduce the price of these machines by half of
its current value. This will save countless lives by diagnosing the disease in the early stages
and taking necessary steps to reduce the risk.

Secondly, we are designing our system on FPGA. They are relatively cheap and can be
programmed for different situations. ECGs of people vary from place to place and at different
places different form of noises may be added to the signal. From this perspective we have the
advantage of field programmability of FPGA. We can design our desired filter that can cancel
the noise depending on the place we are at. Conventional ECG machines are built for certain
places. They don’t have this advantage that FPGA based ECG machines have. We have used
digital filters. They have advantages over analog filters, in a sense that we can achieve sharp
cutoff. They have really small drift factor, meaning that the circuitry will change very slightly
as time passes. By contrast, analog filter components like resistors, capacitors, inductors values
change as time passes due to heating and other environmental effects.

In short, we have combined low cost, FPGA and digital filters to attain maximum efficiency.

45
6.2 Recommendation and future work:

The project will manage to instantiate the rules of filtering so far but there exist some
limiting factors that hinders the system designed to be perfect as there is always room for
improvement. The FGPA will not be able to give 100% perfect results where IIR filters are
used. IIR filters distorts a bit whereas in FIR delays are increased. So, here we use IIR filter
because of their lower order and are bearing a bit of distortion. IIR have natural instability
because all of its poles lie on unit circle. This is the biggest limitation while designing the filter
for noises. A small effect like heating or any of the other surrounding factor will make it
unstable.
In future better equipment must be use to obtain better results and high performance. High bit
ADC should be use for better resolutions. It is recommended to use a built in ADC of FPGA
kit in which they are available. Use any of the technique in future which makes order of FIR
filter low. At this stage no such technique exist.

46
Chapter 7

Conclusion

47
Chapter 7

Conclusion

7.1 Conclusion:

This thesis demonstrates our work relating FPGA based biomedical signal processing and
digital filters. FIR and IIR filtering techniques are use to remove the noise from the signal. The
project was not just the test of academic accomplishments and abilities. It was more than that
as it tested qualities exhibited of teamwork, leading capabilities, management of finances and
time. It taught and tested the project management capabilities and tactics required. Rather than
the achievements we gathered, there were fewer drawbacks that took place because of certain
reasons.

 Firstly, it was certainly due to the fact that we did not have over hands on the high-tech

equipment and due to insufficiency of specific knowledge and skills needed, and
monetary limitations.
 Secondly, it was due to corona pandemic that we are unable to perform last step of our
project implementation. There was unavailability of FPGA kit and vertex7 at home.
Also, the groupmates were not able to gather and work with the pace and passion
because of lock down.

48
Chapter 8

Reference

49
Chapter 8

References

8.1 Reference:

[1] Snehal Thalkar, Prof. Dhananjay Upasani “ Various Techniques for Removal of Power Line
Interference From ECG Signal” International Journal of Scientific & Engineering Research,
Volume 4, Issue 12, December-2013 12 ISSN 2229-5518.

[2] P. Raphisak, S.C. Schuckers, A.J. Curry, An algorithm for EMG noise detection in large
ECG data, Comput. Cardiol, 31 (2004) 369– 372.

[3] Gary M,Friesen Thomas C. Jannett, Manal Afify Jadallah,Standford L. Yates, Stephen
R.Quint, H.Troy N Nagle,1990,“A Comparision of the Noise Sensitivity of Nine QRS
Detection Algorithms”, IEEE Transactions on Biomedical Engineering,Vol,37, No. 1, March
1990.

[4] Chinmay Chandrakar, M.K. Kowar, “DENOISING ECG SIGNALS USING ADAPTIVE
FILTER ALGORITHM”, International Journal of Soft Computing and Engineering (IJSCE)
ISSN: 2231-2307, Volume-2,Issue-1, March 2012

[5] Omid Sayadi , Mohammad Bagher Shamsollahi, “ECG Denoising with Adaptive Bionic
Wavelet Transform” , in Proceedings of the 28th IEEE EMBS Annual International Conference
New York City, USA, Aug 30- Sept 3, 2006

[6] S. Iravanian, L. Tung, A novel algorithm for cardiac biosignal filtering based on filtered
residue method, IEEE Trans. Biomed. Eng. 49 (11) (2002) 1310–1317.

50
[7] B. Weng, M. B. Velasco, and K. E. Barner, “ECG denoising based on the empirical mode
decomposition,” in Proceedings of the 28th IEEE EMBS Annual International Conference New
York City, USA, Sept.2006, pp. 1–4.

[8] Sonali, Omkar Singh, Ramesh Kumar Sunkaria- ECG Signal Denoising Based on Empirical
Mode Decomposition and Moving Average Filter, 2013 IEEE

[9]Availablefrom:https://www.researchgate.net/publication/224326734_Estimation_of_noise
_in_ECG_signals_using_wavelets/figures?lo=1

[10]. A. Jayant, T. Singh and M. Kaur (2013): Different Techniques to Remove Baseline
Wander from ECG Signal, Int. J. of Emerging Research in Management & Technology,

[11] Leif Sornmo and Pablo Laguna. (2005) Bioelectric Signal Processing in Cardiac and
Neurological Processing. 1st Ed., Elsevier Academic Press, ISBN: 9780124375529.

[12] Rangraj M. Rangayyan. (2002) Biomedical Signal Analysis: A case study approach. John
Wiley & Sons, Inc., ISBN: 0-471- 20811-6. 6. J. L. Talmon, J. A. Kors, and J. H. van Bemmel
(1986): Adaptive Gaussian filtering in routine ECG/VCG analysis, IEEE Trans. Acoust.
Speech Sig. Proc. 34: 527-534.

51
Chapter 8

Appendix

52
Chapter 9

Appendix

9.1 Appendix:

9.1.1 Codes:

Low pass filter:

 Notepad files of code and testbench are as under

filter_tb.v filter.v

High pass filter:

 Notepad files of code and testbench are as under

high_pass_tb.v high_pass.v

Notch filter:

 Notepad files of code and testbench are as under

notch.v notch_tb.v

9.2 Hardware components:

The major hardware components used in our project are given below.

 FPGA kit (spartan6 Kit).


 ad8232 (Heart beat sensor)

53
 ads1194 (ADC)
 VGA cable
 Arduino

9.2.1 Detail of hardware:

FPGA kit (spartan6 Kit)

Fig 32. Spartan6

ECG sensor (ad8232):

Fig 32. Ad8232

54
ADC (ads1194):

Fig 34. ADC

Arduino uno:

Fig 35. Arduino UNO

55
9.2.2 Gantt chart:
Table 10.2: Gantt Chart
Activity Sep 2019 Oct 2019 Nov- Dec Jan-Feb March- July– Aug 2020
2019 2020 April 2020

Collection of Literature 2
Weeks

Study of Literature 2
Weeks

Analysis of Proposed Scheme 3 Weeks

Preparation of Schemes 3 Weeks

Designing 6 Weeks

Analysis & Simulation 6 Weeks

Result Formulation 3
Weeks

Final Write-up & Thesis 3


Submission Weeks

56

You might also like