Chapter 1 I. Introduction a) Background ny processes that happen in the human body have some sort of bioelectricity associated with tem even the heart beats. Each time the heart beats it produces electrical currents. These currents are responsible for the rate and pattern of contraction of the heart. The ECG device capture these currents through the electrodes and record them. The signal consists of five main components: the P, Q, R, S and T wave. The P wave is responsible for depolarization of the left and right atrium. The RS complex is composed of the q, R and S waves and represents left and right ventricular depolarization. At this same time, the QRS complex masks the P wave depolarization. The T wave is responsible for the depolarization of the left and right ventricles. (R H, John, Adlam F, Hampton JR, 2008). In 1d903, The first electrocardiogram measurement device was developed by willem Einthoven when he invented a new instrument called the string galvanometer. (R H, John, Adlam D, Hampton JR, 2008). Using that device, he developed an improved method for measuring the electrical changes that take plae in the human body upon the contractions and electrical changes in the atria of the heart and others from contractions and electrical changes in the ventricles. The string galvanometer made possible the first valid and reliable electrocardiogram, thus giving doctors one of the most valuable tools for the study of heart disease. (R H, John, Adlam D, Hampton JR, 2008). Variations in a patient ECG signal, particularly changes in the size and appearance of the QRS complex and the t/s waves will inform a trained professional what condition the heart is in. Also these changes give the required information to diagnose the patient's aliment. One could apply the knowledge of the professional to an artificial system so that it can make the same insights and diagnosis. This concept has been explored since the early 70's with the use of large computer databases and algorithms but not until recently has it been done with great successes. (Lippincott Williams & wilkins, 2005). There are systems already on the market for use by veterinarians, but how they are implemented has not been disclosed. No such system has been designed yet that is widely used in human healthcare because doctors feel that they can still diagnosis with greater success then the systems. # b) Problem statement Presently, many cardiologists face difficulty in making a continuous and correct diagnosis for heart diseases. An addition to this also, conventional technique of visual analysis is more complicated and requires experienced and time. Thus, the information obtained from an electrocardiogram can be used to discover different types to heart diseases. In order in ensure patients safety this information must be accurate, precise and automatic monitoring. Therefore by doing this project, the patient treatment process can be monitored all the time without the need of an expert cardiologist analysis the signal. # c) Objectives The objectives of this project are: ? To develop the electronic circuitry for the previously developed ECG classifier algorithm. ? To develop the interface between the ECG monitoring system and the developed classifier. ? To evaluate the performance of developed electronic ECG classifier system. # d) Methodology e) Scope of the project The ECG Arrhythmia classifier project ill focus on the requirements for the acquisition of an ECG signal from a patient, amplifying and filtering the signal to follow the medical requirements of an ECG system and classify the signal. The acquisition of the signal component of the project will involve selecting appropriate electrodes and placing them correctly to achieve the best signal possible. It will also include appropriate selection of amplification circuitry to apply gain to the low voltage ECG signal. As the ECG Analyzer is connected to a patient and a computer at the same time there is a need to isolate the patients from the computer so they will not get shocked. Throughout this project the theory will be tested and implement the circuit using breadboards and implement the arrhythmia algorithm in MATLAB software. Then feature extraction of the parameters of the signal and detecting R-Peak in QRS complex. After extracting the parameters of the signal and detecting Heart beats, Neural Network is to be used to compare between the ECG signal acquired form the patient and MIT-BIH Database of ECG waveforms. The Analyzer must be cost effective and inexpensive to create, to market this to third world countries where doctors are in a very short supply. By making it inexpensive does not mean the hardware is allowed to have poor signal reproduction it is the goal of the project to have a high level of signal reproduction and a cardiologist is going to verify the output results of this project. Chapter 2 II. Literature Review a) Electrocardiograph (ECG) Electrocardiogram (ECG) is the recording of the heart's electrical activity over time via skin electrodes. The deviations in the normal electrical patterns indicate various cardiac disorders and abnormalities. Cardiac cells, in the normal state are electrically polarized. Their inner sides are negativity through a process called depolarization, which is the fundamental electrical activity of the heart. This process is propagated current and it can be detected by from cell to cell, producing a wave of depolarization that can be transmitted across the entire heart. This wave of depolarization produces a flow of electric current and it can be detected by keeping the electrodes on the surface of the body (skin). Once the depolarization is complete, the cardiac cells are able to restore their normal polarity by another process named re-plarization. This process also sensed by electrodes 13. (Cromwell & Wibell, 2005) # b) Electrocardiograph Interpretation The ECG records the electrical activity of the heart over time, where each heart beat is displayed as a series of electrical waves characterized by peaks and valleys. Any ECG gives two kinds of information. First, the duration of the electrical activity is normal or slow or irregular while the second is the amount of electrical activity passing through the heart the heart muscle which enables to find whether the parts of the heart are too large or overworked. (Saritha & Sukanya, 2008) Normally, the frequency range of an ECG signal is of 0.05C, 100Hz and its dynamic range of IC, 10mV. (Carlos, Amercas & Cuadalajara, 2010. Where the significant features of the waveform are the P, Q, R, S and T waves, the duration of each wave and certain time intervals such as the P-R, S-T and Q-T intervals. In ECG signal, the heart muscles generate different voltages. The P wave represents the atrium contraction, QRS complex and the T wave represents the ventricles actions. Each time that this signal is present, a heartbeat is generated. For this reason it is important to develop analog and digital signal conditioning. First, it is necessary to amplify the signal and filter the noise and then extract the QRS complex (Carlos, Americas & Guadalajara, 2010) Noise and interference signals acquired in this type of system are caused by the electric installation. The small electrical signal from the heart generates a common-mode voltage and noise in the system. The signals from the heart are too small and it is necessary to amplify the signal and reduce the common-mode voltage on the system. Other aspects that generate noise are muscle contractions, respiration, electromagnetic interference and electromagnetic emissions from electronic components (Carlos, Americas & Guadalajara, 2010). In the normal sinus rhythm (normal state of the heart) the P-R interval is in the range of 0.12 to 0.2 seconds. The QRS interval is from 0.04 to 0.12 seconds. The Q-T interval is less than 0.42 seconds and the normal rate of the heart beat is form 60 to 100 beats per minute. (Saritha & Sukanya, 2008). So, from the recorded shape of the ECG, the author can conclude whether the heart activity is normal or abnormal. The electrocardiogram is a graphic recording or display of the time variant voltages produced by the myocardium during the cardiac cycle. The P, QRS and T waves reflect the rhythmic electrical depolarization and repolarization of the myocardium associated with the contractions of the atria and ventricles and very useful in diagnosing various abnormalities conditions associated with the heart. Table 2.1 shows ECG waveform details and the duration of each segment of the PQRST waves. The horizontal segment of EGG waveform preceding the P-wave is indicate as the baseline or the is potential line. The P-wave represents depolarization of the atrial musculature and the QRS complex si the combined result of the repolarization of the atria and Global Journal of Researches in Engineering ( ) Volume XVI Issue III Version I depolarization of the ventricles, which occur almost simultaneously. The T wave is the wave of ventricular repolarization. Consequently, the duration amplitude and morphology of the QRS complex is useful in diagnosing cardiac arrhythmias, abnormalities, ventricular hypertrophy, myocardial infection and other disease or abnormalities (Li & Zheng, 1995). # c) Electrocardiograph Electrode Electrode is not the same concept as lead. An electrode is a physical patch which connects to the patient. Meanwhile, a lead s a specific vector in which voltage is measured. ECG electrodes are used for sensing bioelectric potential (electrical activity) as caused by cardiac muscle. The electrical activity can be seen as a constant DC electric field or a constant flux of charge -carrying particles or current. The electrodes work as transducers converting ionic current flow from the body into the electron flow of the metallic wire and consequentially ECG signal can be diagnosed after amplified and processed. A high ionic concentration gel is therefore normally used in the skin electrode interface to increase conductivity. The choice of material is important as well because the small electrical charge at the skin-electrode interface varies with different electrode materials. The best currently available materials are gold, platinum, stainless steel, while the most commonly used is the silver chloride electrode. (Aily, 2009). Another sensor that was considered was the piezoelectric sensor. Piezoelectric materials generate an electric potential when mechanically strained. During a heartbeat the pressure in the blood vessels is higher than when the heart is in its resting stage. This higher blood pressure causes a physical deformation in the skin and thus a piezoelectric sensor can produce an eclectic potential during every heartbeat. The principal reason why the piezoelectric sensor is less than ideal is that it is pressure sensitive. (Aily, 2009) In order to pick up a signal the user (elderly, family members, etc) would have to press the sensor hard against the patient which could cause a permanent deformation of the piezoelectric material. Thus, the silver chloride electrode (inert, cheap, biocompatible) is used in this project rather than the piezoelectric electrode to give best performance of ECG waveform and avoid for possible complications occur if the author use the piezoelectric sensor. # d) Electrocardiograph Interference source In order to design an effective wireless electrocardiograph, one needs to consider the possible interferences that might exist when undergoes the data capturing on the patient. The interference sources can be divided into 3 distinct groups: 1) Noise originating from sources external to the patient. 2) Interference originating from the patient. 3) Unwanted Potential as well as interference originating from patient-electrode contact. # e) Heart and Heart-Electrical Activities The heart is the organ responsible for pumping blood throughout the body. It is located in the middle of the thorax, slightly offset to the left and surrounded by the lungs. The heart is composed of four chambers; two atriums and two ventricles. The right atrium receives blood returning to the heart from the whole body. That blood passes through the right ventricle and is pumped to the lungs where it is oxygenated and goes back to the heart through the left atrium., then the blood passes through the left ventricle and is pumped again to be distributed to the entire body through the arteries (Carlos, Americas & Gyadalajara, 2010). Figure 2.4 shows the blood circulation scheme. Electrical heart activity is based on depolarization and re-polarization of myocardial cells. The electrical impulse starts in the senatorial node (natural pacemaker) flowing through the atriums to reach the atrio ventricular node and generating the atrium contraction. The current then flows through the His Bundle reaches the ventricles and flows through them generating the ventricular contractions. Finally, the current reaches the Purkinje fibers and re-polarization of the heart tissue occurs (Carlos, Americas & Guadalajara, 2010). The electrical potentials generated by the heart can be represented as vector quantity. For understanding purposes, the heart is represented as a dipole located in the thorax with a specific polarity at a certain moment and an inverted polarity the next moment. The potential in a specific moment is defined by the amount of charge and the separation between charges. Figure 2.6 show the list of events that occur in the heart on each heart beat. 1) Atrium begins to depolarize 2) Atrium depolarizes 3) Ventricles begin to depolarize at apex. Atrium repolarizes 4) Ventricles depolarize 5) Ventricles begin to repolarize at apex 6) Ventricles repolarize Each pair of electrodes or an electrodes combination is defined as lead. There are three basic leads used for cardiology. Lead I is at 0°, lead II is at 60° and lead III is at 120°. The three basic electrode leads make-up the frontal-plane. Electrodes are placed on the limbs; left arm (LA), right arm (RA) and left leg (LL). Those connections are due to the legs and arms being used as a "wire" to detect the bio-potentials that occur in the chest (Carlos, Americas & Guadalajara, 2010). The graphic representation of each lead is shown in Figure 2.7. Einthoven's triangle is known as the "three lead" ECG, with measurements taken from three points on the Global Journal of Researches in Engineering ( ) Volume XVI Issue III Version I body. If two leads are connected between two points on the body will forming vector between them, electrical voltage observed between the two electrodes is given by the dot product of the two vectors. Another lead connected at the body acting as ground to protect human body. (Patrick et al 2002 ) Figure 2.7 shows the triangle that formed around the heart which refers to as the Einthoven's triangle. The top of triangle is formed by lead I, the left side is formed by lead II and at the right side is formed by lead III (Brenda, Beasley &Michael 2003). Table 2.2 shows the placement of the electrode on the three lead ECG. The most significant among these is lead II because their ability to visualize p wave. The 12-lead electrocardiogram (ECG) is a diagnostic test that helps identify pathologic conditions, especially ischemia and acute myocardial infarction. It provides a more complete view of the heart's electrical activity than a rhythm strip and can be used to assess left ventricular function more effectively. Patients with conditions that affect the heart's electrical system may also benefit from a 12-lead ECG consists of six limb leads and six chest leads. The electrodes to be attached on the limbs are connected to the wrists and the ankles in rest ECG recording.(W M, Peter, Lawrie TD, 1979). During the exercise ECG the electrode positions are at the ends of the collarbone and the ridges of the iliac bone. The locations for the chest electrodes to the recommendation of the American Heart Association are as follows and can be viewed in Figure 2.9: ? V1: Fourth intercostals space, at the right margin of the sternum. ? V2: The same space, at the left margin of the sternum. ? V3: Midway between V2 and V4. ? V4: Intersection of left mid-clavicular line and fifth intercostals space. ? V5: At the intersection of left anterior auxiliary line with a horizontal line through V4. ? V6: At the intersection of left mid-auxilary line with a horizontal line through V4 and V5. This type of ECG will oftern be used as a oneoff recording of an ECG, typically printed out as a paper copy. Chapter 3 # III. Methodology a) Overview An electrocardiograph is a device that can measure the electrical signals produced by the heat. Each event during a cardiac cycle produces a waveform that forms the ECG, physician then can analyze this signal to access the state of the cardiac tissue. The ECG implores surface electrodes to acquire the minuscule voltages produced by the heart during the cardiac cycle. Pairs of electrodes are placed on different parts of the heart to measure the ECG from different angles. Electrodes are required for acquisition of the ECG signal from the body. The body acts like a giant resistor and therefore the ECG signal produced in the heart has a smaller amplitude (0.5~4mV) at the surface of the body as compared to the surface of the heart. This means that the electrodes have to be sensitive enough to pick up the signal produced and ensure that the signal is not lost during transmission to the amplifier. There are certain requirements for the amplifiers so they provide enough amplification to the signal so that it can be analyzed by the other components of the circuit. As well it must have very high input impedance, a large CMRR and low power consumption. There is also a need to remove the line noise out of the signal, as this will be used in a hospital setting where electric current is running. The power supply used in the design of the ECG has to be able to support a current draw of 1.1 mA and needs to be able to supply power to all other components of the ECG, which could require voltage in Global Journal of Researches in Engineering ( ) Volume XVI Issue III Version I the range of +/-5 to 15 volts. There is also a need to protect the patient, as this ECG will need to be attached to a computer so the software can analyze the signal. This can be done successfully by isolating the patient from the computer by imploring an isolation amplifier. After acquiring ECG signal from the patient, the signal will be processed through classifier that classify the signal of Electrocardiogram waveforms with the intention of assisting in the detection of abnormalities and therefore facilitate the early detection of cardiac problems. The algorithm of the classifier based on MIT-BIH database. The signal are examined with Pan-Tompkins algorithm to detect the parameters of the signal and then classification of the signal. # b) Electrode theory In order to measure and record the potentials from the heart it is necessary to provide some interface between the body and the hardware. The electrodes are this interface. Electrodes must have the capability of conducting a current across the interface between the body and the hardware. The electrode has to serve as a transducer to change an ionic current into an electronc current, which greatly complicates the operation of the electrode. (R H, John, Adlam D, Hampton JR, 2008). The type and size of the electrode is determined by the signal being measured, the location on the body and the dimensions of the generator of the signal. In the case of the ECG the signal range is from 0.5~4mV and the frequency range of the signal is from 0.01~250Hz. Given these values modern ECG systems can implore a number of different electrodes. One common electrode implored by most ECG systems is the silver chloride electrode and this electrode has been chosen to be used for the project. The choice of the electrode and how it interacts with the patient's body determines what type of amplification hardware that will be used. The way the electrode interacts with the patients can be shown as an equivalent circuit and can been seen in Figure 3.1. The ECG signal produced by the cardiac tissue loses signal strength because it must travel through bone and muscle and therefore the signal faces an iternal resistance .9R H, John, Adlam D, Hampton JR, 2008). The ECG is only acquired by measuring the difference in half-cell potentials between electrode I and electrode II to give the potential difference (in mV). The dermis and subcutaneous layers are modeled as resistance since they are mainly composed of fat and have no electrical properties. The epidermis specifically the stratum corneum is a membrane that is semipermeable to ions, so if there is a difference in ionic concentration across this membrane, there is a potential difference of Ese created. To minimize the effect of the stratum corneum it must be removed, or least part it, from under the electrode. This can be done by abrading the skin by vigorous rubbing of an alcohol swab in the area that the electrode is being placed. The rest of the epidermal layer is found to have an electric impendence that behaves as a parallel RC circuit. The sweat glands and ducts secrete fluid that contain Na+, K+ and CIions, which create a potential difference between them and subcutaneous layer (Ep). There is also a parallel RC combination in series with the potential, which is acquired from the walls of the sweat glands and ducts. If conductive gel is used it is represented as a resistance and it will improve the conductive properties of the skin. The last part of electrode theory will focus on motion artifacts and how they are created. The silver electrode develops a double layer of charges when it is in contact with the electrolyte. When the electrode/electrolyte contact is disturbed during generates a sudden potential difference between the electrodes, which results in motion artifacts in the ECG signal. When the motion of the electrode stops the double layer is reestablished and the initial half-cell potential is obtained again. But the danger is in the fact that a sudden spike in voltage can saturate the instrumentation amplifiers. Variations in the skin/electrolyte interface can cause motion artifacts as well. To prevent motion artifacts ensure that the skin is prepared properly and the electrodes are placed correctly. # c) Amplification theory An ECG signal has a range of 8x10 -5 about 5x10 -3 V in amplitude which means that this signal must be amplified. (Scanlon VC, 2008). For the system to be able to correctly produce the signal a gain of about 1000 is necessary. To successfully produce the required gain instrumentation amplifiers are the best choice. An instrumentation amplifier is a type of differential amplifier that has been outfitted with input buffers that eliminate the need for input impedance matching and thus make the amplifier particularly suitable for use in measurement and test equipment. Additional characteristics include veyry low DC offset, low drift, low noise, very high openloop gain, very high common-mode rejection ratio and very high input impedances. They also have the benefit of being able to adjust the gain of the amplifier circuit without having to change more than one resistor value. Instrumentation amplifiers are used where great accuracy and stability of the circuit is needed for both short-and long-term. when acquired from the silver electrode the very small ECG signal will be accompanied by a large ac common-mode component (up to 1.5V) and a large variable dc common-mode component (300mV). To deal these components it is imperative that they are met by an amplifier with a High CMRR. The common -mode rejection ratio specified by the Association for the Advancement of Medical Instrumentation (AAMI) is 89 dB minimum for a clinical ECG and 60 dB for an ambulatory ECG. (Scanlon VC, 2008). As stated above the choice of an instrumentation amplifier will allow for a high CMRR and meet or surpass Global Journal of Researches in Engineering ( ) Volume XVI Issue III Version I these requirements. The electrode/skin interface has impedances that can range from 1K to 1M ?. (Scanlon VC, 2008). This impedance is made up of the equivalent impedance of the electrodes, the fat volume underneath the skin which has an impedance associated with it and the resistance of the body. Also there is a dependence on the skin condition. Its preparation will contribute to the impedence and if the system is worn for a long period of time the skin will change and therefore the impedance will also chage. Finally if the signal is in the frequency range of 0.01 Hz to 1 Hz an increase in the electrode/skin impedance is expected as the capacitive component of the skin would be much higher in this range. If the wrong amplifier is chosen a voltage divider will appear between the electrodes and input of the amplifier, which will lead to signal loss. High input impedance on the amplifier would prevent the formation of voltage dividers. # d) Isolation theory As this system will be interfacing with a computer there must be a barrier set up between the computer and the patient. This will keep voltage from the computer that could potential hurt the patient away from them but also endure the safety of the internal components of the computer. This can be done by using an isolation amplifier. Isolation amplifiers are devices that break the ohmic continuity of electric signals between the input and output of amplifier. They usually consist of an instrumentation amplifier at the input followed by a unity gain isolation and a genera model can be seen in Figure 3.3 (Webster JG, Clark JW, 1998). The isolation can occur in three ways transformer isolation, optical isolation or capacitive isolation. Transformer isolation approach uses either a frequency modulated or pulse modulated carrier signal with a small signal bandwidths to carry the signal. The optical method uses a LED on the source side and a photodiode on the output side, which uses the brightness of the LED to deduce the voltage of the signal at that current point of time. Lastly the capacitive method uses digital encoding of the input voltage and frequency modulation to send the signal across a differential ceramic capacifive barrier. (Webster JG, Clark JW, 1998). # e) Soundcard of Laptop A sound card also known as an audio card which has facilitates the input and output of audio signals to and from a computer under control of computer programs. Typical uses of sound cards include providing the audio component for multimedia applications such as music composition, editing video or audio, presentation, education and entertainment (games). Many computers have in built sound capabilities, while others require further soundcard expansion cards to provide for audio potentiality. Sound card has usually functioned of analogue to digital converter (ADC), which converts recorded or generated analogue data into a digital format. The output signal is connected to an amplifier, headphones or external device using standard interconnects. For higher data rates and multiple functions, there is more advanced card commonly include more than one chip. # f) MIT-BIH Arrhythmia Database This project uses the MIT-BIH Database of ECG waveforms, forty seven subjects were studied by the BIH laboratory twenty three recording were picked at random from a set of 4000 and twenty five recording were collected from the same data to include abnormal ECG. 360 samples were digitized per second and each record was independently noted with an explanation, to include background information on the subjects, including their medications. # g) QRS Detection The QRS complex is the most important complex in the ECG. The duration and amplitude sure be measure as accurate as possible. There are two methods for high light the QRS complex. These are the Pan-Tompkins algorithm and he derivation-based method. This project will use the Pan-Tompkins algorithm: because with the derivation based methods the QRS might not always be the highest wave in a cardiac cycle, this is because atrium relaxation wave inside the QRS wave and this would upset the peak search algorithm. # h) Pan-Tompkins algorithm It's the algorithm for detection of QRS complex of ECG signals. It reliably recognizes QRS complexes based upon digital analyses of slope, amplitude and width. Special digital band pass filter reduces false detection caused by various types of noises such as muscle noise, artifacts due to electrodes motion, power line interference, base line wander, T wave with high frequency characters tic similar to QRS complex. This algorithm is implemented for detection of QRS complex on normal database. # i) Neural Network When the ECG waves have been processed, they must be classified into two classes normal or abnormal. In his project the classifier that will be used is the Artificial Neural Network (ANN), AAN is a computer based system based on the Neural Networks in human biology. Neural Networks are useful for pattern recognition and non-linear systems. The function of network depends on the connection between the different elements (neurons). These connections are called weights. The output is compared with the desired target. The weight in the neural network are changed to help achieve the target, these changes are called training a network. ANN will need a lot of training to correctly classify the various features of an ECG wave. # Global # a) Overview The design of the hardware for the ECG analyzer was broken up into three individual sections. These sections are electrode and amplification and finally isolation. Designing and testing of each of these sections will be described in the following sections. It is to be noted when testing the circuit two power sources were used. The first was a +/-15V source from a test board and the second was a +/-5V battery source. # b) Electrode and Amplification The first part of the hardware and probably the most important as they acquire the signal are the electrodes. The electrodes that were used for this project were the 3M TM Red Dot TM Wet Gel Monitoring Electrodes. Red Dot Wet Gel electrode is a round -style 3M TM Micropore TM Surgical Tape-backed electrode designed for long -term use. The electrodes have wet gel conductive columns and 3M TM SureSeal moisture vapour barrier caps to ensure product freshness. Each electrode also has a border adhesive that works well for all types of skin conditions. The electrodes were placed on both the wrists and one on the right ankle. To prepare the skin as outlined in the theory alcohol wipes were used and the skin was rubbed until a slight redness appeared. The lead connected to the right wrist was attached to the positive input of the instrumentation amplifier and the lead connected to the left wrist was attached to the negative input. Lastly the lead connected to the left ankle was connected to ground. This set-up allowed us to view the heart at two different angles. The ECG signal has a range of 0.5~4mV which is a very low voltage signal. With this signal being such a low voltage it needed to be amplified by a gain of 1000 to provide good signal reproduction. The INA126 is precision instrumentation amplifier for accurate, low noise differential signal acquisition. Their two op-amp design provides excellent performance with very low quiescent current (175µA/Channel). This, combined with a wide operating voltage range of ±1.35V to ±18V, makes them ideal for portable instrumentation and data acquisition systems. Gain can be set from 5V/V to 10000V/V with a single external resistor. Laser trimmed input circuitry provides low offset voltage (250µV max), low offset voltage drift (3 µV/ °C max) and excellent common-mode rejection. # c) Isolation Amplifier When the ECG hardware connect to a computer there is a need to isolate the patient from the computer to ensure patient safety. To perform this task I implored the use of an isolation amplifier, which performs the required task with ease. The isolation amplifier I chose to use was the ISo124 by Texas instruments. This isolation amplifier was a high precision low cost version, which again helps me maintain our goal of creating a precise low cost ECG analyzer. It is 100% tested for high voltage breakdown and is rated for upto 1500Vrms, which is more then enough to protect the patient. This isolation amplifier uses the capacitive method of isolation that was described in the theory section. By imploring the use of this isolation amplifier, patient safety can be ensured. # d) Microphone Pin Configuration Figure 4.1 illustrates how to configure a standard stereo microphone plug. The tip of the pin is the left channel, the ring type metal protion is the right channel and the rest of the rest of the pin is the ground. There is one plastic ring between two channel s which separates the channel and ground. Use a multi meter or continuity tester to determine the channel identifications of the solder logs. The next step is derivative filter, helps in identifying a change in direction in the slope of the signal which is indicative of a peak in the signal. The next step is simple Squaring function which makes all the signal values positive but also amplifies the output of the previous stage in a nonlinear manner thus emphasizing the R peaks in the signal. In next step Thresholding of the obtained signal is done which identifies threshold peaks in the ECG signal under the threshold value signal will be zero. If a peak exceeds threshold 1 during the first step of analysis, it is classified as a QRS peak. In next step moving window summation of the previous N samples of the output of the previous stage is done. N is decided based on the sampling rate of the signal being analyzed. It performs smoothing of output of the preceding operatins through a moving -window integration filter. For a single QRS a window width of N=30 was found to be suitable for fs = 500Hz. The choice of the window width N is to be made with the following considerations: too large a value will result in the outputs due to the QRS and T waves being merged, whereas too small a value could yield several peaks. In next step again the sholding of obtained signal is done. Peak should be above threshold2 to be called a QRS. In next step peak detection at rising edge of waveform is done. Final step is QRS peak detection which is implemented on main ECG signal to be analyzed for arrhythmia. In this step horizontal window of +20 samples from peak of previous step and -20 samples from peak of previous step is selected and for that horizontal window maximum amplitude is find out which indicated as QRS peak. # e) Neural Network classification In the classification phase MLP neural network have been used. The best architecture of the MLP NN is usually obtained using a trial-and-error process. Therefore, after running many simulations, MLP NN with Global Journal of Researches in Engineering ( ) Volume XVI Issue III Version I 24 input neurons, one hidden layer and one output neurons. The performance of the proposed MLP NN was tested using the Mean-Squared Error (MSE) parameter. This error is computed using the differences between the actual outputs and the outputs obtained by the trained by the trained NN. Training performance: Given by variation of mean square error with number of epochs. It can be observed that the mean square error decreases till epoch 300. A total number of 300 epochs are shown in the above figure. Mean squared error plot shows the achieved error value. Lower value means the less probability of false predictions. Here network has achieved quite low error probability. Fewer epochs mean network learns in small repetitions. Less time means network achieved goal easily and shortly. Performance indicates the final MSE achieved. Lower value is associated with higher network accuracy. Other performance parameters and training state the following training state parameters are also obtained during the Neural Network analysis. # Chapter 5 V. Conclusion and Recommendations a) Conclusion The ECG analyzer has been successful in achieving the major objectives set out at the beginning of the project. The circuit design gave successful results. The signal is amplified to a useful range and it's going to be used in software to analyze it. The results obtained using MATLAB for ECG analysis and detection of arrhythmial is very fast and useful, as the ECG can be easily read, saved in a fle and the filtering, derivation , squaring, thresholding, applying the moving window integration, peak detection can be done accurately. The peak detection is very important in diagnosis arrhythmia Using minimal amount of parts and ensuring they were low cost allowed for the ECG Analyzer to be affordable for any country. This was done without lowering the standards for correct ECG signal reproduction. # b) Recommendations As with most projects undertaken there is always room for improvement. The first improvement that can be suggested is to eliminate the need for a computer to run the software. The other improvement for the ECG signal and the classification to appear on a small LED screen. Lastly the patient must be still when attached to the analyzer. ![Journal of Researches in Engineering ( ) Volume XVI Issue III Version I Chapter 4 IV. Design Procedure and Results](image-2.png "") 21 : EGG waveform(Saritha & Sukanya ,2008)AmplitudeDurationsP-wave-0.25 mVP-R interval: 0.12 to 0.20R-wave-1.60Q-T interval: 0.35 to 0.44 sQ-wave-25%R waveS-T interval:0.05 to 0.15 sT-wave-0.1 to 0.5 mVP-wave interval: 0.11sQRS interval: 0.09s 2.2 : The placement of the electrode on the threelead ECGLeadsPositive ElectrodeNegative ElectrodeILeft armRight armIILeft legRight armIIILeft legLeft armf) ArrhythmiasAn arrhythmia is disturbance of the normalrhythm of the heart, Arrhythmias are very common andaffect over 7,00,000 people in the worlds today.Arrhythmia may occur naturally, or be due to heartdisease or other causes, such as reaction to medicine.An arrhythmia may occur continuously or justoccasionally. The heart rate can become abnormallyrapid, slow and/or irregular.i. Types of ArrhythmiasThere are a number of different types ofarrhythmia including those listed below(Brenda, Beasley& Michale, 2003):i. Atrial fibrillation (AF)ii. Atrial tachycardia (AT)iii. Ventricular tachycardia (VT)iv. Ventricular fibrillation (VF)v. Heart blockii. SymptomsIf someone does have symptoms, it will dependon the type of arrhythmia he/she have and how severe itis. Symptoms mat include:i. Palpitationsii. Dizzinessiii. Fainting or collapsingiv. Breathlessnessv. Chest painvi. Angina Paing) Standard 12 lead ECG F © 2016 Global Journals Inc. (US) ECG Arryhthmia Classifier © 2016 Global Journals Inc. (US)ECG Arryhthmia Classifier * Neural networks in heathcare: potential and challenges RBegg JKamruzzaman RSarkar 2006 Idea Group Pub Hershey, PA * DCG interpretation made incredibly easy LippincottWilliams &Wilkins 2005 Lippincott Williams & Wilkins 3 Ambler, PA * The ECG in practice R HJohn DAdlam JRHampton 2008 Churchill Livingstone Elsevier 5 New York th ed. Edinburgh * Essentials of anatomy and physiology VCScanlon TSanders Philadelphia: F.A. Davis Co 2007 5 * An introduction to automated electrocardiogram interpretation W MPeter TDLawrie 1974 London: Butterworth * Medical instrumentation: application and design. 3 rd ed JGWebster JWClark 1998 Wiley New York * Applications of Artificial Neural Networks for ECG Signal Detection and Classification Yu HenHu Global Journal of Researches in Engineering XVI III Version I