Intelligent Cardiac Monitoring System Using Vir- tual Instrumentation Techniques

This paper describes the design of a portable, cheap and easy to handle microcontroller-based heart monitoring system using a Atmega32 model-based microcontroller and GLCD. The project is capable of detecting and distinguishing the normal heart signal from an abnormal one. A circuit was designed to convert the sound signals from the heart into electrical signals. The signal so obtained was then processed and conditioned to get a Phonocardiogram (PCG). The design considerations of this project are influenced by its target users. Its major application lies with medical practitioners in remote areas and army units in warzones where technical help is usually difficult. This project will facilitate a PCG read in such areas resulting in preventive timely measures being taken. This paper also gives solution to display the graphs and results on a GLCD which would further enhance the portability of this system.

INTRODUCTION Cardiovascular diseases are among those seriously threatening human health. Heart sound analysis provides important information of these diseases, which is significant for diagnosing different kinds of cardiovascular diseases. So heart sound analysis has been a basic requirement for every doctor and medical student. In cardiac auscultation, an examiner uses a stethoscope to listen for these sounds, which provide important information about the condition of the heart.
Heart Failure is one of the leading causes of death in developing nations like India. Unlike many other life threatening diseases this does not usually provide prior warning. Many such problems occur suddenly, especially at the time of physical exercise. If minor, the problem causes temporary discomfort and disappears for some time until it comes back with vengeance.
For such cases and more, it is always useful to wear a portable monitoring device that keeps track of the heart rhythm of the patient. In case of abnormal heart condition, the monitor should detect all unusual heart signals, and store it in its memory for future diagnosis and treatment of the problem.
At the time of occurrence of a heart problem, the device should also alert the patient about the occurrence of this unfortunate event [1]. Thus the patient may have sufficient time to call for help or take suitable steps to stop further aggravation of the heart problem. Our research work aims to develop the same. Cardiac Murmurs: Murmurs are vibrations caused by turbulence in the blood as it flows through some narrow orifice or tube. A murmur is one of the more common abnormal phenomena that can be detected with a stethoscope -a somewhat prolonged 'whoosh' that can be described as blowing, rumbling, soft, harsh, and so on [2]. Murmurs are sounds related to the non-laminar flow of blood in the heart and the great vessels. They are distinguished from basic heart sounds in that they are noisy and have a longer duration. While heart sounds have a low frequency range and lie mainly below 200 Hz, murmurs are composed of higher frequency components extending up to 1000 Hz [3]. Most heart murmurs can readily be explained on the basis of high velocity flow or abrupt changes in the calibre of the vascular channels. Typical conditions in the cardiovascular system, which cause blood flow turbulence, are local obstructions, shunts, abrupt changes in diameter, and valve insufficiency.
A Phonocardiogram or PCG is a plot of high fidelity recording of the sounds and murmurs made by the heart with the help of audio, or recording of the sounds made by the heart during a cardiac cycle. The sounds are thought to result from vibrations created by closure of the heart valve [7]. There are at least two: the first when the atrio ventricular valves close at the beginning of systole and the second when the aortic valve closes at the end of systole. It allows the detection of sub audible sounds and murmurs, and makes a permanent record of these events. In contrast, the ordinary stethoscope cannot detect such sounds or murmurs, and provides no record of their occur-PAPER INTELLIGENT CARDIAC MONITORING SYSTEM USING VIRTUAL INSTRUMENTATION TECHNIQUES rence [4]. The ability to quantitate the sounds made by the heart provides information not readily available from more sophisticated tests, and provides vital information about the effects of certain cardiac drugs upon the heart. It is also an effective method for tracking the progress of the patient's disease [5,6]].
IV. SIGNAL CONDITIONING The sound signal of the heart beat was acquired using a good quality stethoscope. A micro-phone is connected at the other end of the stethoscope to convert sound signal into electrical signal for processing. Now we have electrical signal in terms of capacitance change i.e. output of micro-phone. To analyze the signal we need to convert it into voltage signal. The following circuit has been developed for this purpose.
The output of this circuit is very small in amplitude. So we need to amplify the signal and also clamp it to a positive voltage as negative voltage can't be processed by ADC. Clamping is shown in Fig. 3 by adding a dc voltage of 2V to the signal. Now this processed signal is given to the ADC of the micro-controller.
The data is stored in microcontroller memory for analysis, and important events are stored for future reference.
This micro-controller is connected to a GLCD which shows the phonocardiogram and the processed data and results.  V. GRAPHICAL LCD The graphical LCD or GLCD is required for applications which require presenting more data to the user in a better way. The character LCD which is normally used has a limited block of memory and can thus be used to display limited characters. In applications such as the cardiac monitoring system, the graphical data to be displayed can be very complex and might not be very repetitive as well.
The graphic library is a piece of software that has complex algorithms to render graphic primitives like line, rectangles, circles, images and more. It also helps to load fonts and render text and numbers on screen. So it provides high level access to the LCD screen and applications can be written much more easily.Figures and tables must be centered in the column. Large figures and tables may span across both columns. Any table or figure that takes up more than 1 column width must be positioned either at the top or at the bottom of the page.
The use of GLCD would greatly enhance the portability of the entire device. The screen of a normal mobile handset can also be used as a GLCD provided the code for the particular model is available.
The specification of this LCD is as follows.
 128 horizontal pixel and 64 vertical pixel resolution.  Controlled based on KS0108B  Parallel 8bit interface  On board graphic memory.  Available in Green backlight with dark green pixels.  Also available in Blue backlight with light blue pixels.  LED backlight. Fig. 5 is a detailed description of the circuitry necessary to interface the GLCD with ATMega-32 Micro-Controller. Building the circuitry will involve soldering all the components on a PCB and then make the necessary connections. The circuit is clocked with a 16 MHz crystal to obtain maximum speed.

VI. LABVIEW
LabVIEW (short for Laboratory Virtual Instrumentation Engineering Workbench) is a platform and development environment for a visual programming language from National Instruments. The graphical language is named "G". LabVIEW is commonly used for data acquisition, instrument control, and industrial automation on a variety of platforms. This tool is used to develop sophisticated measurement, test, and control systems using intuitive graphical icons and wires that resemble a flowchart. It offers unrivalled integration with thousands of hardware devices and provides hundreds of built-in libraries for advanced analysis and data visualizationall for creating virtual instrumentation. LabVIEW 8.6 was used in interfacing the systems.
Execution is determined by the structure of a graphical block diagram (the LV-source code) on which the programmer connects different function-nodes by drawing wires. These wires propagate variables and any node can execute as soon as all its input data become available. Since this might be the case for multiple nodes simultaneously, G is inherently capable of parallel execution. Multiprocessing and multithreading hardware is automatically exploited by the built-in scheduler, which multiplexes multiple OS threads over the nodes ready for execution.
VII. DATA ACQUISITION Data acquisition is the process of real world physical conditions and conversion of the resulting samples into digital numeric values that can be manipulated by a computer. Data acquisition and data acquisition systems (abbreviated with the acronym DAS) typically involves the conversion of analog waveforms into digital values for processing. The components of data acquisition systems include:  Sensors that convert physical parameters to electrical signals.  Signal conditioning circuitry to convert sensor signals into a form that can be converted to digital values.  Analog-to-digital converters, which convert conditioned sensor signals to digital values.  The DAQ used in the device was NI USB-6009 [8,9].

VIII. IMPLEMENTATION
The output signal is fed to the ADC of the microcontroller where it is being sampled at a sampling frequency Fs decided by the crystal used in the circuit. Here the samples are stored in an array on which FFT is performed to find the main frequency component in the heart murmur and also the heart beat rate is found out and all the obtained data is displayed on GLCD.For detailed analysis the output of the signal conditioning circuit is fed to the DAQ which then transfers the data into LabVIEW. The DAQ assistant in LabVIEW is used to interface the DAQ signal with the software. The signal so obtained is then transmitted to the LabVIEW tool 'Waveform Chart'. The waveform can then be seen on the front panel of LabVIEW[12].

IX. BENEFITS
 Portability: It's quite a ready device and its usage can reach the remotest of places.

PAPER INTELLIGENT CARDIAC MONITORING SYSTEM USING VIRTUAL INSTRUMENTATION TECHNIQUES
 Low-power consumption: The power load associated with it is minimal.  Reliable: The circuitry used is simple and hence the reliability of the device is very high.  Accessible: It can be accessed by army-men in warzones and other areas which are devoid of technological assistance (no access to complex equipments and machinery). So its application ranges far and wide [11].  Usage: Housewives and athletes can wear it to monitor their heart rates after physical activity and take relevant action in time  User-friendly: The device is very simple to operate.
There is no complex expertise involved. Anyone and everyone can use it.  Time-invariant: The circuitry is unaffected by the ambient conditions and purely confirms only your heart-rate.
X. RESULTS The electrical signal coming from the sound to electrical signal conversion circuit is very weak with a peak to peak voltage of 20 mV. This signal was then amplified nearly 1000 times using an operational amplifier and other circuit components. To cancel the high frequency noise components, the signal is made to pass through a low pass filter. Fig. 8 shows the circuit diagram for the signal amplifying and conditioning circuit. After the entire signal conditioning, the waveform obtained had a peak to peak voltage of 1.9V with the noise signal between 0.05V to 0.09V.
FFT results shows the main frequency component at .005*Fs i.e. 220 Hz. Normal Signal range is 100-1KHz A Database is stored for the heart rate and heart murmur frequency components to determine the condition of the patient.
XI. CONCLUSION Several different circuitries for signal conditioning were implemented and analyzed. The optimized circuit with highest sensitivity was chosen. The noise level in the waveforms obtained is due to the electro-magnetic signals and stray magnetic fields originating from the various electrical equipments being used in the lab. This shortcoming can be overcome by enclosing the entire device into a radiation insulated capsule.
A better resolution can be obtained by using microcontroller with a higher bit ADC. This will greatly enhance the quality of waveforms obtained. Better results can be obtained if a higher order low-pass filter like Butterworth filter is used.
The programme can further be extended to identify several diseases according to the frequency content of heart murmur and heart rate. A database in terms of heart rate, murmur frequency and corresponding heart problems will help in easy analysis for common people.
The output transferred to DAQ and LabVIEW will be for better detailed analysis for doctors. The sound obtained can easily used by a doctor to detect diseases instead of using stethoscope.