Complex Engineering Problem
Communication System (University of Sargodha)
Scan to open on Studocu
Studocu is not sponsored or endorsed by any college or university
Downloaded by Mohsin Raza
Complex Engineering Problem
Semester: 5th
Session: 2020-24
Subject:
Communication Systems
Course Instructor:
Engr. Erum Rehman
Group Members:
Sawera Akhtar(ELEN51F20R002)
Muzzamil Sajjad(ELEN51F20R012)
Usama Tanveer(BEEF19M010)
M Omer(BEEF19M018)
Department of Electrical Engineering
College of Engineering and
Technology University of Sargodha
Downloaded by Mohsin Raza
TOPIC: ECG SIGNAL PROCESSING
Introduction:
Electrocardiogram (ECG) represents electrical activity of human heart. ECG is composite from
5 waves - P, Q, R, S and T. This signal could be measured by electrodes from human body in
typical engagement. Signals from these electrodes are brought to simple electrical circuits with
amplifiers and analogue to digital converters. The main problem of digitalized signal is
interfer- ence with other noisy signals like power supply network 50 Hz frequency and breathing
muscle
artefacts These noisy elements have to be removed before the signal is used for next data process-
ing like heart rate frequency detection. Digital filters and signal processing should be designed
very effective for next real-time applications in embedded devices. Heart rate frequency is very
important health status information. The frequency measurement is used in many medical or sport
applications like stress tests or life treating situation prediction. One of possible ways how to get
heart rate frequency is compute it from the ECG signal. Heart rate frequency can be detected from
ECG signal by many methods and algorithms. Many algorithms for heart rate detection are based
on QRS complex detection and hear rate is computed like distance between QRS complexes. QRS
complex can be detected using for example algorithms from the field of artificial neural networks,
genetic algorithms, wavelet transforms or filterbanks. Moreover the next way how to detect QRS
complex is to use adaptive threshold.
The direct methods for heart rate detection are ECG signal spectral analyze and Short-Term
Auto-correlation method. Disadvantage of all these methods is their complicated
implementation to microprocessor unit for real time heart rate frequency detection. Real time
QRS detector and heart rate computing algorithm from resting 24 hours ECG signal for 8-bit
microcontroller is described in. This algorithm is not designed for physical stress test with
artefacts. The designed digital filters and heart rate frequency detection algorithms are very
simple but robust. They can
be used for ECG signal processing during physical stress test with muscle artefacts. They are suit-
able for easy implementation in C language to microprocessor unit in embedded device. Design of
these methods has been very easy with Matlab tools and functions.
Electrical Activity of Heart:
The cardiac cycle is initialised in the pacemaker cells of the heart which fire an electrical impulse
instantaneously. The pacemaker cells are also known as sinoatrial (SA) node and are present in
the upper right atrium. The propagation of the electrical impulse or the electrical wave front takes
place through a series of atrial and ventricular contraction and relaxation (as shown in Figure 1).
After the left and right atria electrical activation, the atrioventricular (AV) node collects and de-
lays the impulse before it reaches the ventricles (Hall, 2006). This delay helps to increase the vol-
ume of the blood in the ventricles through a prolonged atrial contraction, before the ventricular
contraction takes place. The delay is the result of low conductivity of the muscle tissue present.
Bundle of His, is located between the two ventricles, is a location which connects the atria and
the AV node electrically. The electrical impulse enters the bundle of His and then it spans rapidly
into various bundles and branches in the left and right ventricles. Further, the impulse spreads
across a network of conduction fibres also known as Purkinje Fibres. The impulse propagates
rapidly and initiates a unified contraction (Hall, 2006) (Sörnmo, 2006)
Downloaded by Mohsin Raza
Figure 1 ([Link]
There are four entities of a normal rhythm- P wave, QRS complex, T wave, U wave, each one of
which has a unique pattern.
P wave- atrial depolarization
QRS complex- ventricular depolarization
T wave- ventricular repolarization
U wave- papillary muscle repolarization
These patterns exhibit a change with any change in the structure of the heart or its surroundings
([Link],2016).
Clinical Important Description Duration
Parameters
The interval between an R
RR-Interval wave and the next R wave; 0.6 to 1.2s
normal resting heart rate is
between 60 and 100 bpm.
The interval between an R
P-Wave wave and the next R wave; 80 ms
normal resting heart rate is
between 60 and 100 bpm.
The interval measured from
PR- Interval the start of the Pwave to the 120-200ms
start of QRS complex.
The segment connects the
PR-Segment P-wave and the QRS complex.
The electrical vector path is 50-120ms
AV node to Bundle of His to
Downloaded by Mohsin Raza
branches to Purkinje Fibres.
Rapid depolarization of
QRS Complex right and left ventricles. 80-120ms
The segment connects QRS
ST-Segment complex and the Twave. It 80-120ms
represents ventricular depolar-
ization
The interval from the Jpoint
ST-Interval to the end of T-wave. 320ms
The interval from the start of
QT-Interval QRS complex till the end of Upto 420ms
T-wave.
Methods:
1. Proposed System:
ECG signal get from patient by electrodes and give to the controller. Then it process by
image processing. Butterworth Notch filter is also used to remove power-line interference
of 50 and 100 Hz .Take FFT (Fast Fourier Transform) for frequency domain conversion
from time domain to calculate the spectrum of our signal. Developed coding for threshold,
peak detection, heart rate and get result shown in fig 1.
Figure 1. Block diagram of proposed system
This example shows (Fig 2) how to detect the QRS complex of electrocardiogram (ECG) signal
in real-time. Model based design is used to assist in the development, testing and deployment of
the algorithm. The electrocardiogram (ECG) is a recording of body surface potentials generated
by the electrical activity of the heart. Clinicians can evaluate an individual's cardiac condition and
overall health from the ECG recording and perform further diagnosis. A normal ECG waveform
is illustrated in the following figure. Because of the physiological variability of the QRS complex
Downloaded by Mohsin Raza
and various types of noise present in the real ECG signal, it is challenging to accurately detect the
QRS complex.
Fig 2. Block diagram for real time QRS detection
2. ECG Signal Source
The ECG signals used in the development and testing of the biomedical signal processing
algorithms are mainly from three sources: 1) Biomedical databases (e.g., MIT-BIH
Arrhythmia Database) or other pre-recorded ECG data; 2) ECG simulator; 3) Real-time
ECG data acquisition. In this example, the following pre-recorded and simulated ECG
signals are used. The signals all have sampling frequencies of [Link] set of recorded
real ECG data sampled from a healthy volunteer with a mean heart rate of 82 beats per
minute (bpm). This ECG data was pre-filtered and amplified by the analog front end
before
feeding it to the 12 bit ADC. four sets of synthesized ECG signals with different mean
heart rates ranging from 45 bpm to 220 bpm. ECGSYN is used to generate synthetic ECG
signals in MATLAB.
Fig 3. ECG signal source
Downloaded by Mohsin Raza
A real-time QRS detection algorithm, which references developed in Simulink with the
assumption that the sampling frequency of the input ECG signal is always 200 Hz (or 200
samples/s). However the recorded real ECG data may have different sampling frequencies
ranging from 200 Hz to 1000 Hz, e.g., 360 Hz . To bridge the different sampling
frequencies, a sample rate converter block is used to convert the sample rate to 200 Hz. A
buffer block is inserted to ensure the length of the input ECG signal is a multiple of the
calculated decimation factor of the sample-rate converter block.
Real-Time QRS Detection of ECG Signal
The QRS detection block detects peaks of the filtered ECG signal in real-time. The
detection threshold is automatically adjusted based on the mean estimate of the average
QRS peak and the average noise peak. The detected peak is classified as a QRS complex
or as noise, depending on whether it is above the threshold. The following QRS detection
rules reference the PIC-based QRS detector implemented in.
Rule 1: Ignore all peaks that precede or follow larger peaks by less than 196ms (306bpm).
Rule 2: If a peak occurs, check to see whether the raw signal contains both positive and
negative slopes. If true, report a peak being found. Otherwise, the peak represents a
baseline shift.
Rule 3: If the peak is larger than the detection threshold, classify it as a QRS complex.
Otherwise classify it as noise.
Rule 4: If no QRS has been detected within 1.5 R-to-R intervals, but there is a peak that
was larger than half the detection threshold, and that peak followed the preceding
detection
by at least 360ms, classify that peak as a QRS complex.
Simulate and Deploy
1. Open the example model.
2. On the model tool strip, click Run to start the simulation. Observe the Heart Rate
display and the raw and filtered ECG signal in the scope, which also illustrates
the updating of peaks, threshold and estimated mean heartrate.
3. Open the dialog of ECG Signal Selector block. Select the ECG signal mean heart rate
in the drop down menu. Click Apply and observe the real-time detection results in
the scopes and Heart Rate display.
4. Click Stop to end simulation.
5. After selecting target hardware, you can generate code from the ECG
Signal Processing subsystem and deploy it to the target.
Downloaded by Mohsin Raza