Вы находитесь на странице: 1из 76

ECG Data Acquisition Using Lab VIEW

1. INTRODUCTION

In order to carry various functions, the heart generates its own


monitoring signals which convey useful information about the
functions that it represents. These signals are the bio-electric
potentials associated with the heart activity. Bio-electric potentials are
actually ionic voltages produced as a result of the electrochemical
activity of certain special types of cells. Through the use of the
transducers capable of converting ionic potentials in to electrical
voltages, these natural monitoring signals can be measured and
results displayed in a meaningful way to aid the physician in the
diagnosis and treatment of heart diseases.

Our project is based on acquiring ECG signals using ELVIS


KIT and LabVIEW software. The National Instruments Educational
Laboratory Virtual Instrumentation Suite (NI ELVIS) is a LabVIEW-
based design and prototyping environment for university science and
engineering laboratories. NI ELVIS consists of LabVIEW-based virtual
instruments, a multifunction data acquisition device and a custom-
designed bench top workstation and prototyping board. This
combination provides a ready-to-use suite of instruments found in all
educational laboratories. Because it is based on LabVIEW and
provides complete data acquisition and prototyping capabilities, the
system is ideal for academic coursework from lower-division classes to
advanced project-based curriculum.

1
ECG Data Acquisition Using Lab VIEW

2. ELECTROCARDIOGRAM

The electrocardiogram (ECG or EKG) is a graphic recording or


display of the time variant voltages produced by the myocardium
during the cardiac cycle.

To understand the origin of the ECG, it is necessary to have


some familiarity with the anatomy of the heart. Fig 1 shows a cross
sectional view of the heart. The heart is divided into four chambers.
The two upper chambers, the left and right atria, are synchronized to
act together. Similarly, the two lower chambers, the ventricles operate
together the right atrium receives blood from the veins of the body and
pumps it into the right ventricle. The right ventricle pumps the blood
through the lungs, where it is oxygenated. The oxygen – enriched
blood then enters the left atrium, from which it is pumped into the left
ventricle. The left ventricle pumps the blood into the arteries to
circulate throughout the body. Because the ventricles actually pump
the blood through the vessels, the ventricular muscles are much
larger and more important than the muscles of the atria.

Figure1: Cross sectional view of human heart

2
ECG Data Acquisition Using Lab VIEW

The action potential in the heart originates near the top of the
right atrium at a point called the pacemaker or sinoatrial (SA) mode.
The pacemaker is a group of specialized cells that spontaneously
generate action potentials at regular rate. To initiate the heart beat,
the action potentials generated by the pacemaker propagate in all
directions along the surface of both atria.

The wave front of activation travels parallel to the surface of the


atria toward the junction of atria and the ventricles. The wave
terminates at a point near the center of the heart called AV node. At
this point some special fibers act as a ―delay line‖ to provide proper
timing between the action of the atria and ventricles. Once the
electrical excitation has passed through the delay line it rapidly
spread to all parts of both ventricles by the bundle of hiss. The fibers
in this bundle called purkinje fibers divided into two branches to
initiate action potentials. Simultaneously in the powerful musculature
of the two ventricles. The wave front in the ventricles dose not follow
along the surface but in perpendicular to it and moves from inside to
outside of the ventricular wall terminating at the tip of the heart.

The theoretical waveform of the ECG taken from the surface of


the body is shown in fig 2. Alphabetic designations have been given to
each of the prominent features. These can be identified with events
related to the action potential. To facilitate analysis, the horizontal
segment of this waveform preceding P wave is designated as the
baseline or the atrial musculature. The QRS complex is the combined
result of the repolarization of the atria and depolarization of ventricles,
which occur almost simultaneously. T wave is the wave of ventricular
repolarization.

Some of the normal values for amplitudes and duration‘s are as


follows:

3
ECG Data Acquisition Using Lab VIEW

Wave type Amplitude


P wave 0.25mV
R wave 1.60mV
Q wave 25% of R-wave
T wave 0.1 to 0.5mV

Duration
P-R interval : 0.12 -0.20sec
Q-T interval : 0.35 -0.44sec
S-T interval : 0.05 – 0.15sec
P wave : 0.11sec
QRS complex : 0.09sec

Normal ECG waveform

Figure2: normal ECG wave pattern

TYPES OF ELECTRODES:

1. LIMBS ELECTRODES
2. FLOATING ELECTRODES
3. PREGELLED DISPOSABLE ELECTRODES
4. PASTELESS ELECTRODES

4
ECG Data Acquisition Using Lab VIEW

1. LIMBS ELECTRODES:
The most common type of electrodes routinely used for
recording ECG is rectangular or circular surface electrode. The
material used is german silver, nickel silver or nickel plated steel.
They are applied to the surface of the body with electrode jelly. The
typical value of the contact impedance of these electrodes, which are
of normal size, is nearly 2 to 5 KΩ when measured at 10 Hz. The
electrodes are held in position by elastic straps. The size of the limb
electrodes is usually 3*5cm and they are generally made of german
silver, an alloy of zinc, cooper and nickel. They are reusable and last
several years. Limb ectrodes are generally preferred for use during
surgery because the patient‘s limbs are relatively immobile. Moreover,
chest electrodes cannot be used as they would interface with the
surgery.

Limb electrodes are not suitable for use in long term patient
monitoring because the long flowing leads are convenient to the
patient. Suction cup electrode is commonly used to record the
unipolar chest leads. It has high contact impedance as only the rim of
electrode is in contact with the skin. The electrode is popular for it‘s
practically, being easily attachable to fleshy parts of the body.
Electrode jelly forms the vacuum seal.

2. FLOATING ELECTRODES:
Limbs electrodes generally suffer from what is known as motion
artifacts caused due to the relative motion at the interface between the
metal electrode and the adjacent layer of electrode jelly. The interface
can be stabilized by the use of floating electrodes in which the metal
electrode does not make direct contact with the skin. The electrode
consist of a light weight metalled screen or plate held away from the
subject by a flat washer which is connected to the skin. Floating
electrodes can be recharged, i.e. the jelly in the electrodes can be
replenished if desired.

5
ECG Data Acquisition Using Lab VIEW

Connection with the instrument is established with silver plated


copper wires fixed in the conducting adhesive. The type of electrodes
are extremely light weight and do not make use of electrode jelly. This
makes them ideal for use in monitoring the ECG of exercising subjects
and aeroplane pilots as they give rise to minimal motion artifacts. The
contact impedance shown by these electrodes is of the order of 50 KΩ.
Completely flexible ECG electrodes for the long term monitoring
of ECG during space flight. These electrodes were made of silver
impregnated silastic rubber and were found to be comfortable to wear.
They were also evaluated for use during exercise or prolonged
monitoring as may be necessary in an intensive care or coronary care
unit.

3. PREGELLED DISPOSABLE ELECTRODES:


Electrodes which are employed in stress testing or long term
monitoring, present additional problems because of the severe
stresses, perspiration and major body movement encountered in such
studies. Both design considerations and application techniques of
electrodes used in electrocardiography are necessary to prevent
random noise on the baseline, baseline wandering and skin contact
over extended periods causing a loss of signal. To overcome problems
due to prolonged application, special disposable electrodes have been
developed. Figures (a) illustrate the principle of a pregelled electrode
while figure (b) shows a cross section of such an electrode. The main
design features of these electrodes which helps in reducing the
possibility of artifacts, drift and baseline wandering is the provision of
a high absorbency buffer layer with isotonic electrolyte. This layer
absorbs the effect of movement of the electrode in relationship to the
skin, and attempts to maintain the polarization associated with the
half cell potential constant. Since perspiration is the most common
cause of electrode displacement, the use of an additional porous
overlay disc resists perspiration and ensures secure placement of the
electrode on the skin even under stress conditions.

6
ECG Data Acquisition Using Lab VIEW

4. PASTELESS ELECTRODES:
ECG monitoring electrodes, in a majority of the cases, are metal
plates applied to the skin after cleaning and application of a coupling
electrolyte in the form of an electrode paste or jelly. Such preliminary
preparation can be sometimes irritating and time consuming. Also, it
is often not done satisfactorily, resulting in problems like poor quality
signals and baseline drift, etc. Another disadvantage of using electrode
jelly is that during long term monitoring there is likely to be patient
skin reactions as the electrode skin interface dries out in a matter of a
few hours. The electrodes need to be periodically removed for jelly
replenishments, thus causing further discomfort due to repetitive skin
preparation. In addition, bacterial and fungal growth can take place
under electrodes worn over long periods. Also, in conductive
electrodes, shifts in electrode position at the electrode skin interface
appear as baseline drift, particularly when the subject moves.
Therefore, any attempt of using a dry electrode that may dispense with
the practice of skin preparation would look attractive.
(3) LIMBS ELECTRODES (4) FLOATING ELECTRODES

(5) PREGELLED DISPOSABLE ELECTRODES


(6) PASTELESS ELECTRODES

Fig 3, 4, 5 & 6: Different Types of ECG Electrod

7
ECG Data Acquisition Using Lab VIEW

3.BLOCK DIAGRAM

Fig 7: Block Diagram

As shown in the figure 7, it consists of ECG Acquisition card,


ELVIS kit, DAQ M-series, LabVIEW software in which we have digital
filtering units and using this software we represent our ECG signals.

Signals obtained from patient‘s body from Lead 1/2/3


configuration are given to the ECG acquisition card which consists of
amplifier circuit with a gain of 2500 as shown in the circuit diagram of
ECG acquisition card in figure. As the acquired signals are of very low
range that is in milivolt range. Then this amplified signals are passed
through the filtering units Low pass (100Hz), High pass (0.05Hz) and
Notch filter (50Hz) to remove the noise and base line wandering.

8
ECG Data Acquisition Using Lab VIEW

This whole system is mounted on ELVIS kit for the purpose of


interfacing with software in the PC. It uses LabVIEW based software
instruments. It also includes LabVIEW Express VI and signal Express
steps to process the biomedical signals.

This system is interfaced with the PC using DAQ M-series card.


This DAQ device installed in the computer connected to the ELVIS
hardware meets the following requirements:
 16 AI channels, minimum sample rate of 200 s/sec
 2 AO channels
 8 DIO line
 2 Counter/Timers

The ECG signal acquired from the card is further processed


using LabVIEW software. This processing is done by the block
diagram built using the software as shown in the figure 25 & 28. Here
the signals acquired are again processed using the digital filters. As
the biomedical signals are very low frequency and they may get
distorted due to difference in the analog circuits (temperature,
voltage). Hence digital filters are used because they are highly immune
to noise, accurate (which can be determined by designer) and its
performance factor does not depend upon the temperature variation
supply voltage.

Finally the acquired ECG signals and the filtered ECG signals
are represented on the graph in front panel.

9
ECG Data Acquisition Using Lab VIEW

ECG Acquisition Card:


The AD625 is a precision instrumentation amplifier specifically
designed to fulfill two major areas of application:

1) Circuits requiring nonstandard gains (i.e., gains not easily


achievable with devices such as the AD524 and AD624).

2) Circuits requiring a low cost, precision software programmable gain


amplifier.
For low noise, high CMRR, and low drift the AD625JN is the
most cost effective instrumentation amplifier solution available. An
additional three resistors allow the user to set any gain from1 to
10,000. The error contribution of the AD625JN is less than 0.05%
gain error and less than 5 ppm/C gain TC; performance limitations
are primarily determined by the external resistors. Common-mode
rejection is independent of the feedback resistor matching.
The AD625 is available in three accuracy grades (A, B, C) for
industrial (–40C to +85C) temperature range, two grades (J, K) for
commercial (0C to +70C) temperature range, and one (S) grade
rated over the extended (–55C to +125C) temperature range.

FUNCTIONAL BLOCK DIAGRAM

Fig8: Functional Block Diagram of AD625

10
ECG Data Acquisition Using Lab VIEW

PRODUCT HIGHLIGHTS
1. The AD625 affords up to 16-bit precision for user selected fixed
gains from 1 to 10,000. Any gain in this range can be
programmed by 3 external resistors.
2. A 12-bit software programmable gain amplifier can be
configured using the AD625, a CMOS multiplexer and a resistor
network. Unlike previous instrumentation amplifier designs, the
ON resistance of a CMOS switch does not affect the gain
accuracy.
3. The gain accuracy and gain temperature coefficient of the
amplifier circuit are primarily dependent on the user selected
external resistors.
4. The AD625 provides totally independent input and output offset
nulling terminals for high precision applications. This minimizes
the effects of offset voltage in gain-ranging applications.
5. The proprietary design of the AD625 provides input voltage
noise of 4 nV/√Hz at 1 kHz.
6. External resistor matching is not required to maintain high
common-mode rejection.

AD625

The AD625 is a monolithic instrumentation amplifier based on a


modification of the classic three-op-amp approach. Monolithic
construction and laser-wafer-trimming allow the tight matching and
tracking of circuit components. This insures the high level of
performance inherent in this circuit architecture.

A preamp section (Q1–Q4) provides additional gain to A1 and


A2. Feedback from the outputs of A1 and A2 forces the collector
currents of Q1–Q4 to be constant, thereby, impressing the input
voltage across RG. This creates a differential voltage at the outputs of
A1 and A2 which is given by the gain (2RF/RG + 1) times the
differential portion of the input voltage. The unity gain subtracter, A3,

11
ECG Data Acquisition Using Lab VIEW

removes any common-mode signal from the output voltage yielding a


single ended output, VOUT, referred to the potential at the reference
pin.

Fig9: Simplified circuit of AD625

The value of RG is the determining factor of the


transconductance of the input preamp stage. As RG is reduced for
larger gains the transconductance increases. This has three important
advantages. First, this approach allows the circuit to achieve a very
high open-loop gain of (3 ラ 108 at programmed gains ≥ 500) thus
reducing gain related errors. Second, the gain-bandwidth product,
which is determined by C3, C4, and the input transconductance,
increases with gain, thereby, optimizing frequency response. Third,
the input voltage noise is reduced to a value determined by the
collector current of the input transistors (4 nV/√Hz).

Selecting Resistor Values


As previously stated each RF provides feedback to the input
stage and sets the unity gain transconductance. These feedback
resistors are provided by the user. The AD625 is tested and specified

12
ECG Data Acquisition Using Lab VIEW

with a value of 20 k for RF. Since the magnitude of RTO errors


increases with increasing feedback resistance, values much above 20
k are not recommended (values below 10 k or RF may lead to
instability). Refer to the graph of RTO noise, offset, drift, and
bandwidth (Figure 28) when selecting the feedback resistors. The gain
resistor (RG) is determined by the formula RG = 2 RF/(G – l).

Circuit Diagram of ECG Data Acquisition using Lab VIEW


(using AD625)

Fig 10: Circuit Diagram using AD625

13
ECG Data Acquisition Using Lab VIEW

Fig 11: Circuit Diagram using IC741

14
ECG Data Acquisition Using Lab VIEW

15
ECG Data Acquisition Using Lab VIEW

LM741 Operational Amplifier


An operational amplifier IC is a solid-state integrated circuit
that uses external feedback to control its functions. It is one of the
most versatile devices in all of electronics. The term 'op-amp' was
originally used to describe a chain of high performance dc amplifiers
that was used as a basis for the analog type computers of long ago.
The very high gain op-amp IC's our days uses external feedback
networks to control responses. The op-amp without any external
devices is called 'open-loop' mode, referring actually to the so-called
'ideal' operational amplifier with infinite open-loop gain, input
resistance, bandwidth and a zero output resistance. However, in
practice no op-amp can meet these ideal characteristics. 741 is a
frequency compensated device and although still widely used, the Bi-
polar types are low-noise and replacing the old-style op-amps.LM741
series are general purpose operational amplifier which feature
improved performance over industry standards like the LM709. They
are direct, plug-in replacements for the 709C, LM201, MC1439 and
748 in most applications. The amplifiers offer many features which
make their application nearly foolproof: overload protection on the
input and output, no latch-up when the common mode range is
exceeded, as well as freedom from oscillations.

Summed-up Features:
 Internal Frequency Compensation
 Short Circuit Protection
 Offset voltage null capability
 Excellent temperature stability
 High input voltage range
 NO latch-up

16
ECG Data Acquisition Using Lab VIEW

Definition of 741-pin functions:

Pin 1 & 5 (Offset Null): Since the op-amp is the differential type, input
offset voltage must be controlled so as to minimize offset. Offset
voltage is nulled by application of a voltage of opposite polarity to the
offset. An offset null-adjustment potentiometer may be used to
compensate for offset voltage. The null-offset potentiometer also
compensates for irregularities in the operational amplifier
manufacturing process which may cause an offset. Consequently, the
null potentiometer is recommended for critical applications.

Pin 2 (Inverted Input): All input signals at this pin will be inverted at
output pin 6. Pins 2 and 3 are very important (obviously) to get the
correct input signals or the op amp can not do its work.

Pin 3 (Non-Inverted Input): All input signals at this pin will be


processed normally without inversion. The rest is the same as pin 2.

Pin 4 (-V): The V- pin (also referred to as Vss) is the negative supply
voltage terminal. Supply-voltage operating range for the 741 is -4.5
volts (minimum) to -18 volts (max), and it is specified for operation
between -5 and -15 Vdc. The device will operate essentially the same
over this range of voltages without change in timing period. Sensitivity
of time interval to supply voltage change is low, typically 0.1% per
volt. (Note: Do not confuse the -V with ground).

Pin 6 (Output): Output signal's polarity will be the opposite of the


input's when this signal is applied to the op-amp's inverting input. For
example, a sine-wave at the inverting input will output a square-wave
in the case of an inverting comparator circuit.

Pin 7 (posV): The V+ pin (also referred to as Vcc) is the positive supply
voltage terminal of the 741 Op-Amp IC. Supply-voltage operating

17
ECG Data Acquisition Using Lab VIEW

range for the 741 is +4.5 volts (minimum) to +18 volts (maximum),
and it is specified for operation between +5 and +15 Vdc. The device
will operate essentially the same over this range of voltages without
change in timing period. Actually, the most significant operational
difference is the output drive capability, which increases for both
current and voltage range as the supply voltage is increased.
Sensitivity of time interval to supply voltage change is low, typically
0.1% per volt.

Pin 8 (N/C): The 'N/C' stands for 'Not Connected'. There is no other
explanation. There is nothing connected to this pin, it is just there to
make it a standard 8-pin package.

Fig 12: (a) Internal ckt of IC741

(a)

18
ECG Data Acquisition Using Lab VIEW

(b) Pin Diagram of IC741

(b)

Filter Design: -

A filter is a circuit that is designed to pass a specified band of


frequency while attenuating all the signals outside that band. It is
frequency selective circuit.

The filter are basically classified as


 Active filter
 Passive filter

* The Passive Filter:


Passive filter networks use only passive element such as
resistors, inductors and capacitors.

* Active Filter:
Active filter circuit use the active elements such as Op-amp,
transistor, along with the resistors ,inductors and capacitor. Modern
active filter do not use inductors as the inductors are bulky, heavy
and non-linear. The indicator generates the stray magnetic fields. The
indicators dissipates considerable amount of power.

19
ECG Data Acquisition Using Lab VIEW

* Advantages of Active Filter: -

The active filter has following advantages over passive filter.

1) All the element along with op-amp can be used in integrated


form. Hence there is reduction is size and weight.
2) In large quantities the cost of integrated circuit can be much
lower than its equivalent passive network.
3) Due to availability of modern IC‘s, variety at cheaper op-amps
are available.
4) The op-amp gain can be easily controlled in closed loop fashion.
Hence active filter I/P signal is not attenuated.
5) Due to flexibility in gain and frequency adjustment the active
filter can be easily tuned.
6) The op-amp has a high I/P impedances and low I/P impedance
hence the active filter using O/P do not cause loading of the
sources (or) load.
7) The Inductors are absent in the active filters. Hence the modern
active filters are more economical.
8) Active filter can be realized under number of class of function
such as Butterworth , Thomson, Chebyshev, Cauer etc.,
9) The response is improved as compared to passive filter due to
readily availability of high quality components.
10) The design procedure is simpler than that for the passive
filter.

Disadvantages:
1) The finite bandwidth the active devices places limit on highest
frequency at operation.
2) The active elements are much more sensitive to environmental
& temperature changes then the passive element.

20
ECG Data Acquisition Using Lab VIEW

The most commonly used filter are: -

1. Low pass (LP) filter


2. High pass (HP) filter
3. Band pass (BP) filter
4. Band Reject (BR) filter (or) Band stop (or) Band eliminated filter
5. All pass filter

Frequency Response Characteristics of Filters:


Low Pass filter: -
Below fig (13.b) shows the frequency response of low pass filter.
A low pass filter has a constant gain from 0 HZ to high cut –off
frequency, fH. Hence, the bandwidth of this filter is also fH. The ideal
characteristic is shown in fig (13.a).

Fig 13: Frequency Response of Low Pass Filter

The circuit allows the range of frequencies from 0 to fH. This


range is known as the pass band. The range of frequency beyond fH is
completely attenuated and hence called as Stop band.
Practically, the gain of the filter decreases as the frequency
increases and at f=fH, the gain is down by 3dB and after fH, it

21
ECG Data Acquisition Using Lab VIEW

decreases at a higher rate. After the end of transition band, the gain
becomes zero.
Using proper design techniques, precision component values
and high speed op-amps, the practical response can be obtained very
close to ideal response.
High pass Filter:
Below fig. Shows frequency response of high pass filter for a
high pass filter, fL is low cut-off frequency. The range of frequency 0
< f < fL is stop band where f is the operating frequency. While range at
frequency f > fL is the pass band. The fig (14.a) shows ideal high
pass filter characteristics while fig (14.b) shows the practical high pass
filter characteristics.

Fig 14: Frequency Response of High Pass Filter

The transition band is practically not shown in the


characteristic as it is very small. Hence, practically, also range upto fL
is called as stop band and f>fL as pass band. The range upto fL is
completely attenuated by high pass filter.

22
ECG Data Acquisition Using Lab VIEW

Band Pass filter: -

Below fig shows characteristics of band pass filter. The band pass
filter has two stop bands. The range of frequency 0< f< fL and the
range of frequency fH < f<  are two stop bands while the range fL <
f< fH is the pass band. The bandwidth is thus fH-fL and the fig. 15(a)
shows the ideal characteristics while 15(b) shows practical character.

Fig 15: Frequency Response of Band Pass Filter

The low pass filter passes only lower frequency range, the high
pass filter passes only higher frequency range while the band pass
filter only passes a band of frequency between the low and high
frequency limits difference by fH and fL.

Band Elimination filter:


The band eliminated filter is also called band rejection filter (or)
band stop filter. Its characteristics is exactly opposite to that of band
pass filter. There are two pass bands while one stop band. The stop
band is between the two frequencies fL and fH.

23
ECG Data Acquisition Using Lab VIEW

The two range 0<f< fL and fH < f<  are two pass bands. The
frequency response characteristic of band elimination filter is shown
in fig 16(a) shows the ideal response whole in fig 16(b) shows practical
response.

Fig 16: Frequency response of band elimination filter

At frequency f= fc, the practical characteristics shows a notch &


hence, this filter is also called Notch filter.

The frequency fc is both bandpass & band elimination filter is


called centre frequency as it is approximately at centre of the pass
band and stop band respectively for the two filters.

All Pass filter:


The all pass filter passes all the frequencies but it produces the
phase shift between the i/p and o/p. The o/p and i/p voltage are
equal in amplitude for all the frequencies but with the phase shift
between the two. The frequency upto which the input–output
amplitude remains same is decided by the unity gain bandwidth of the
24
ECG Data Acquisition Using Lab VIEW

op-amp used. The characteristics showing phase shift between input


and output shown in fig .17

Fig 17: Characteristic of All pass filter

The various types of filter used in practice which approximately


produces the ideal response are
1) Butterworth filter
2) Chebyshev filter
3) Cauer filter

Second order High Pass Butter worth filters:


The second order high pass Butter worth filter produces a gain
roll off at the rate of +40dB/decade in the stop band. This filter also
can be realized by interchanging the positions of resistors and
capacitors in second order low pass Butterworth filter. The fig 18 (a)
shows second order high pass Butterworth filter.

The analysis, design and the scaling procedure for this filter is
exactly same as that of second order low pass Butterworth filter.

25
ECG Data Acquisition Using Lab VIEW

(a)
Fig 18: (a) Second order high pass Butterworth filter

The resulting expression is given here for the conveniences of


reader. The voltage gain magnitude equation for second order high
pass filter is

f= Input frequency in Hz
fL = lower cut-off frequency in Hz = 1/ 2 (R2R3C2C3)
For R2= R3=R and C2=C3=C, fc = 1/2RC
AF = Pass band gain
The frequency response of this filter is shown in fig 18(b).

26
ECG Data Acquisition Using Lab VIEW

(b)
Fig 18: (b) Frequency response of 2nd order high pass Butterworth
filter

* We required High Pass filter fL= 0.05 Hz


fL = 1/ 2RC
Chose capacitor value C= 1µf
0.05 = 1 / 2X R X 1 X 10-6
R= 3MΩ

(c)
Fig 18: (c) Ckt. Diagram of required high pass filter

27
ECG Data Acquisition Using Lab VIEW

NOTCH FILTER DESIGN: -

The name of the filter i.e. Notch filter is due to the


characteristics shape of its frequency response curve. The stop band
of this letter is very narrow. The typical application of notch filter is
the rejection of a single frequency. Such as 50Hz power lines
frequency. It‘s also used in biomedical instrumentations and also
blanking of control tones for telephone lines. Thus particular
unwanted frequency can be eliminated using this filter.
The notch out frequency is frequency at which the maximum
alteration occurs. This is given by
FN = 1/ 2RC

Active Notch filters design:

Fig 19(a): Notch filter

We require notch filter of frequency

F=50 Hz choose c=0.1µf


50=1/ (2π×R×1×10-6)
R=33KΩ

28
ECG Data Acquisition Using Lab VIEW

Fig 19(b): Notch filter

Second Order Low pass Butterworth filter

The practical response of the filter must be very close to an ideal


one. In case of low pass filter, it is always desirable that the gain rolls
off very fast after the cut off frequency, in the stop band. In the case of
first order filter, it rolls off at a rate of 20 dB/decade. In case of second
order filter, the gain rolls off at a rate of 40 dB/decade. Thus, the
slope of the frequency response after f=fH is –40 dB/decade, for a
second order low pass filter.
A first order filter can be converted to second order type by
using an additional RC network as shown in fig 20.

(a)
Fig 20: (a) 2nd order low pass Butterworth filter

29
ECG Data Acquisition Using Lab VIEW

The cut-off frequency fH for the filter is now decided by R2,


C2, R3 and C3. The gain of the filter is as usual decided by op-amp
i.e. the resistance R1 & Rf.

The Voltage gain magnitude equations for Second order Low-


Pass filter is

AF Gain of filter in phase band


f= input frequency in Hz
fH = High cut-off frequency in Hz.

The frequency response is shown in below fig 20 (b)

(b)

Fig 20: (b) frequency response of low pass filter

30
ECG Data Acquisition Using Lab VIEW

At the cut-off frequency, fH, the gain is 0.707 AF i.e. 3 dB down


from its 0 HZ level. After, fH (f> fH), the gain rolls at a rate of 40
dB/decade. Hence, slope of the response after fH is -40 dB/decade.

We required frequency fH = 100Hz


fH =1/ (2πRC)
100=1/ (2π×R×0.1×10-6)
R= 15kΩ

(c)
Fig 20: (c) Required low pass filter design

31
ECG Data Acquisition Using Lab VIEW

4. NI ELVIS OVERVIEW

NI ELVIS combines hardware and software into one complete


laboratory Suite

NI ELVIS Benchtop Workstation


Together, the benchtop workstation and the DAQ device create a
complete laboratory system. The workstation provides connectivity
and functionality. The workstation control panel provides easy-to-
operate Knobs for the function generator and variable power supplies
and it offers convenient connectivity in the form of BNC and banana-
style connectors to the NI ELVIS - Scope and NI ELVIS - DMM. The NI
ELVIS software routes signals in the NI ELVIS Benchtop Workstation
between the SFP instruments. For example, you can route the output
of the function generator to a specific channel of the DAQ device and
ultimately acquire data on a desired channel of the NI ELVIS - Scope.
The benchtop workstation also contains a protection board that
protects the DAQ device from possible damage resulting from
laboratory errors.

(a)

32
ECG Data Acquisition Using Lab VIEW

(b)
Fig 21(a&b): Shows the NI ELVIS Bench top workstation &
Prototyping Board

NI ELVIS Prototyping Board


The NI ELVIS Prototyping Board connects to the benchtop
workstation.

The prototyping board provides an area for building electronic


circuitry and allows the connections necessary to access signals for
common applications. You can use multiple prototyping boards
interchangeably with the NI ELVIS Benchtop Workstation.

NI ELVIS Traditional Software


The NI ELVIS Traditional software, created in Lab VIEW, takes
advantage of the capabilities of virtual instrumentation. The software
includes SFP instruments and the Lab VIEW API for programming the
NI ELVIS hardware.

SFP Instruments
NI ELVIS Traditional ships with the SFP instruments, created in
Lab VIEW and the source code for the instruments. You cannot

33
ECG Data Acquisition Using Lab VIEW

directly modify the executable files, but you can modify or enhance
the functionality of these instruments by modifying the LabVIEW
code. The instruments are virtual instruments (VIs) that are necessary
in typical laboratory applications.

Instrument Launcher
The NI ELVIS Instrument Launcher provides access to the NI
ELVIS Traditional SFP instruments. Launch the NI ELVIS Traditional
Instrument Launcher by double-clicking the NI ELVIS desktop icon or
navigate to Start»All Program Files»National Instruments»NI ELVIS 3.0»
NI ELVIS. After initializing, the suite of LabVIEW SFP instruments
opens. To launch an instrument, click the button corresponding to the
desired instrument. If the NI ELVIS Traditional software is properly
configured and the benchtop workstation is cabled to the appropriate
DAQ device, all buttons should be enabled.

If there is a problem with your configuration, such as when


the NI ELVIS Benchtop Workstation is powered off or disconnected
from the configured DAQ device, all instrument buttons are dimmed,
and the only available option is to click the Configure button.

Some instruments perform similar operations using the same


resources of the NI ELVIS hardware and the DAQ device, and
therefore

34
ECG Data Acquisition Using Lab VIEW

Fig 22: Shows Instrument Launcher

cannot run at the same time. If you launch two instruments


with overlapping functionality that cannot run at the same time, the
NI ELVIS Traditional software generates an error dialog describing the
conflict. The instrument with the error is disabled and will not
function until the conflict is resolved.

Arbitrary Waveform Generator (ARB)


This advanced-level SFP instrument uses the AO capabilities of
the DAQ device. You can create a variety of signal types using the
Waveform Editor software, which is included with the NI ELVIS
Traditional software. You can load waveforms created with the NI

35
ECG Data Acquisition Using Lab VIEW

Waveform Editor into the ARB SFP to generate stored waveforms.


Refer to the NI ELVIS Traditional Help for more information about the
Waveform Editor.

Because a typical DAQ device has two AO channels, two


waveforms may be simultaneously generated. You can choose
continuous output or a single output. The maximum output rate of
the NI ELVIS Traditional - ARB SFP is determined by the maximum
update rate of the DAQ device connected to the NI ELVIS hardware.

Bode Analyzer
By combining the frequency sweep feature of the function
generator and the AI capability of the DAQ device, a full-function.
Bode Analyzer is available with NI ELVIS Traditional. You can set the
frequency range of the instrument and choose between linear and
logarithmic display scales.

Digital Bus Reader


This instrument reads digital data from the NI ELVIS digital
input (DI) bus. You can either continuously read from the bus or you
can take a single reading.

Digital Bus Writer


This instrument updates the NI ELVIS digital output (DO) bus
with user-specified digital patterns. You can manually create a pattern
or select predefined patterns, such as ramp, toggle, or walking 1s.
This instrument can either continually output a pattern or just
perform a single write. The output of the NI ELVIS Traditional - Digital
Bus Writer SFP stays latched until the instrument is stopped or
another pattern is output. Output voltage levels of the NI ELVIS DO
bus are TTL compatible.

36
ECG Data Acquisition Using Lab VIEW

Digital Multimeter (DMM)


This commonly used instrument can perform the following types
of measurements:

• DC voltage
• AC voltage
• Current (DC and AC)
• Resistance
• Capacitance
• Inductance
• Diode test
• Audible continuity

You can connect to the DMM from the NI ELVIS Prototyping


Board or from the banana-style connectors on the front panel of the
benchtop workstation.

Dynamic Signal Analyzer (DSA)


This instrument is especially useful in advanced electrical
engineering and physics classes. This instrument uses the analog
input of the DAQ device to make measurements, and can either
continuously make measurements or make a single scan. You can
also apply various window and filtering options to the signal.

Function Generator (FGEN)


This instrument provides you with choices for the type of output
waveform (sine, square, or triangle), amplitude selection, and
frequency settings. In addition, the instrument offers DC offset
setting, frequency sweep capabilities, and amplitude and frequency
modulation.

37
ECG Data Acquisition Using Lab VIEW

Impedance Analyzer
This instrument is a basic impedance analyzer that is capable of
measuring the resistance and reactance for passive two-wire elements
at a given frequency.

Oscilloscope (Scope)
This instrument provides the functionality of the standard
desktop oscilloscope found in typical undergraduate laboratories. The
NI ELVIS Traditional - Scope SFP has two channels and provides
scaling and position adjustment knobs along with a modifiable time
base. You can also choose trigger source and mode settings. The auto
scale feature allows you to adjust the voltage display scale based on
the peak-to-peak voltage of the AC signal for the best display of the
signal. Depending on the DAQ device cabled to the NI ELVIS
hardware, you can choose between digital or analog hardware
triggering. You can connect to the NI ELVIS Traditional - Scope SFP
from the NI ELVIS Prototyping Board or from the BNC connectors on
the front panel of the benchtop workstation.

The FGEN or DMM signals can be internally routed to this


instrument. In addition, this computer-based scope display has the
ability to use cursors for accurate screen measurements. The
sampling rate of the Oscilloscope is determined by the maximum
sampling speed of the DAQ device installed in the computer attached
to the NI ELVIS hardware.

38
ECG Data Acquisition Using Lab VIEW

Fig 22: Shows Oscilloscope of NI ELVIS

Two-Wire and Three-Wire Current-Voltage Analyzers


These instruments allow you to conduct diode and transistor
parametric testing and view current-voltage curves. The two-wire
instrument offers full flexibility in setting parameters such as voltage
and current ranges, and can save data to a file. In addition, the three-
wire instrument offers base current settings for measurements of NPN
transistors.

NI ELVIS in Academic Disciplines


You can use NI ELVIS in engineering, physical sciences, and
biological sciences laboratories. NI ELVIS is suitable not only in terms
of the included software, but also because of the custom signal
conditioning hardware you can create with NI ELVIS. Instructors can
implement the NI ELVIS curriculum with beginning to advanced
classes to provide hands-on experience to students.

39
ECG Data Acquisition Using Lab VIEW

NI ELVIS in Engineering
NI ELVIS is suited for teaching basic electronics and circuit
design to students in electrical engineering, mechanical engineering,
and biomedical engineering. The suite offers full testing,
measurement, and data-saving capabilities needed for such training.
Students can use the removable prototyping board at home to build
circuits, thus using laboratory time more effectively.

NI ELVIS Traditional SFP instruments, such as the Bode


Analyzer, offer instructors an opportunity to teach advanced courses
in signal analysis and processing. Students can construct software
filters in Lab VIEW and hardware filters on the prototyping board and
compare the performance of those two types of filters.

Mechanical engineering students can learn sensor and


transducer measurements in addition to basic circuit design by
building custom signal conditioning. Students can install custom
sensor adapters on the prototyping board. For example, installing a
thermocouple jack on the prototyping board allows robust
thermocouple connections. The programmable power supply can
provide excitation for strain gauges used in strain measurements.

NI ELVIS in Biological Sciences


Biomedical engineering departments have challenges that are
similar to those of mechanical departments. Students typically learn
basic electronics and build instruments such as an electrocardiogram
(ECG) monitor. The prototyping board offers signal conditioning
capability for ECG sensors, and the NI ELVIS Traditional SFP
instruments are ideal for testing the circuits as students build the
signal conditioning circuits.

40
ECG Data Acquisition Using Lab VIEW

NI ELVIS in Physical Sciences


Physics students typically learn electronics and circuit design
theory. NI ELVIS provides these students with the opportunity to
implement these concepts. Physics students sometimes need signal
conditioning for common sensors such as photoelectric multipliers or
light detector sensors. Students can build high-gain, low-noise
circuits on the removable printed circuit board (PCB) and study them
in modern physics labs.

41
ECG Data Acquisition Using Lab VIEW

5. DAQ System Overview

DAQ systems capture, measure, and analyze physical


phenomena from the real world. Light, temperature, pressure, and
torque are examples of the different types of signals that a DAQ
system can measure. Data acquisition is the process of collecting and
measuring electrical signals from transducers and test probes or
fixtures, and sending them to a computer for processing. Data
acquisition can also include the output of analog or digital control
signals.

The building blocks of a DAQ system include the following items:

• Transducer—A device that converts a physical phenomenon such as


light, temperature, pressure, or sound into a measurable electrical
signal such as voltage or current.

• Signal—The output of the DAQ system transducer.

• Signal conditioning—Hardware that you can connect to the DAQ


device to make the signal suitable for measurement or to improve
accuracy or reduce noise. The most common types of signal
conditioning include amplification, excitation, linearization, isolation,
and filtering.

• DAQ hardware—Hardware used to acquire, measure, and analyze


data.

• Software—NI application software is designed to help you easily


design and program measurement and control applications.

42
ECG Data Acquisition Using Lab VIEW

DAQ Hardware
The NI ELVIS workstation is designed to work with National
Instruments M Series DAQ devices, which are high-performance,
multifunction analog, digital, and timing I/O devices for PCI bus
computers. Supported functions on DAQ devices include AI, AO, DIO,
and timing I/O (TIO).

Recommended DAQ Devices


NI ELVIS Traditional software version 3.0 and later is
recommended for use with the following DAQ devices:

• NI PCI-6251 M Series DAQ device

• NI USB-6251 Mass Termination M Series DAQ device

Use one of the following cables to connect the NI ELVIS workstation:

• PCI M Series DAQ device:

– SHC68-68-EPM

– SHC68-68

– RC68-68

• NI USB 6251 mass termination device:

– SH68-68-EP

NI-DAQ Software
National Instruments measurement devices are packaged with
NI-DAQ driver software, an extensive library of VIs and ANSI C
functions you can call from your application software, such as Lab
VIEW or Lab Windows™/CVI™, to program your NI measurement
devices, such as the M Series multifunction I/O (MIO) DAQ devices,
signal conditioning modules, and switch modules. Driver software has
an application programming interface (API), which is a library of VIs,
functions, classes, attributes, and properties for creating applications

43
ECG Data Acquisition Using Lab VIEW

for your device. NI-DAQ 7.x and later includes two NI-DAQ drivers,
each with its own APIs, hardware configuration, and software
configuration. NI-DAQmx is the latest NI-DAQ driver with the following
advantages over Traditional NI-DAQ (Legacy).

• DAQ Assistant—a graphical way to configure virtual channels and


measurement tasks for your device, and to generate NI-DAQmx code
based on your virtual channels and tasks, for use in LabVIEW, Lab
Windows/CVI, Measurement Studio, and VI Logger
• Increased performance, including faster single-point analog I/O and
multithreading
• NI-DAQmx simulation for most supported devices for testing and
modifying applications without plugging in hardware; refer to the NI-
DAQ Read me for NI-DAQmx-supported devices that do not have NI-
DAQmx simulated device capability
• Simpler, more intuitive APIs for creating DAQ applications using
fewer functions and VIs than earlier versions of NI-DAQ Traditional
NI-DAQ (Legacy) is an older driver with outdated APIs for developing
data acquisition, instrumentation, and control applications for older
National Instruments DAQ devices.
 You should use Traditional NI-DAQ (Legacy) only in certain
circumstances. Refer to the NI-DAQ Read me for more information
about when to use Traditional NI-DAQ (Legacy), including a
complete list of supported devices, operating systems, and
application software and language versions.

44
ECG Data Acquisition Using Lab VIEW

6. INTRODUCTION TO LABVIEW

LabVIEW (Laboratory Virtual Instrument Engineering


Workbench) is a graphical programming language that uses icons
instead of lines of text to create applications. In contrast to text-based
programming languages, where instructions determine the order of
program execution, LabVIEW uses dataflow programming, where the
flow of data through the nodes on the block diagram determines the
execution order of the VIs and functions. VIs, or virtual instruments,
are Lab VIEW programs that imitate physical instruments.

In LabVIEW, you build a user interface by using a set of tools


and objects. The user interface is known as the front panel. You then
add code using graphical representations of functions to control the
front panel objects.

Introduction to Virtual Instruments


LabVIEW programs are called virtual instruments, or VIs,
because their appearance and operation imitate physical instruments,
such as oscilloscopes and multimeters.Every VI uses functions that
manipulate input from the user interface or other sources and display
that information or move it to other files or other computers. A VI
contains the following three components:

 Front panel – Serves as the user interface.


 Block diagram – Contains the graphical source code that defines
the functionality of the VI.
 Icon and connector pane – Identifies the interface to the VI so
that you can use the VI in another VI. A VI within another VI is
called a subVI. A subVI corresponds to a subroutine in text-based
programming languages.

45
ECG Data Acquisition Using Lab VIEW

Front Panel
You build the front panel using controls and indicators, which
are the interactive input and output terminals of the VI, respectively.
Controls are knobs, push buttons, dials, and other input
mechanisms. Indicators are graphs, LEDs, and other displays.
Controls simulate instrument input mechanisms and supply data to
the block diagram of the VI. Indicators simulate instruments output
mechanisms and display data the block diagram acquires or generate

Fig 23: Indicates Front Panel

Controls and Indicators

You build the front panel with controls and indicators, which
are the interactive input and output terminals of the VI, respectively.
Controls are knobs, push buttons, dials, and other input devices.
Indicators are graphs, LEDs, and other displays. Controls simulate
instrument input devices and supply data to the block diagram of the

46
ECG Data Acquisition Using Lab VIEW

VI. Indicators simulate instrument output devices and display data


the block diagram acquires or generates.

Block Diagram
After you build the front panel, you add code using graphical
representations of functions to control the front panel objects. The
block diagram contains this graphical source code, also known as G
code or block diagram code. Front panel objects appear as terminals
on the block diagram. Block diagram objects include terminals,
subVIs, functions, constants, structures, and wires, which transfer
data among other block diagram objects.

Fig 24: Indicates Block Diagram

Functions Palette

The Functions palette is available only on the block diagram.


The Functions palette contains the VIs and functions you use to build
the block diagram. Select Window>>Show Functions Palette or right-
click the block diagram workspace to display the Functions palette.

47
ECG Data Acquisition Using Lab VIEW

Tack down the Functions palette by clicking the thumbtack on the top
left corner of the palette. By default, the Functions palette starts in
the Express view.

Icon and Connecter Pane

After you build a VI front panel and block diagram, build the
icon and the connecter pane so you can use the VI as a sub VI. The
icon and connecter pane correspond to the function prototype in text -
based programming languages. Every VI displays an icon, such as the
one shown as follows, in the upper right corner of the front panel and
block diagram windows. An icon is a graphical representation of a VI.
It can contain text, images, or a combination of both. If you use a VI
as a subVI, the icon identifies the subVI on the block diagram of the
VI. You can double-click the icon to customize or edit it.

The connecter pane is a set of terminals that corresponds to the


controls and indicators of that VI, similar to the parameter list of a
function call in text-based programming languages. The connecter
pane defines the inputs and the outputs you can wire to the VI so you
can use it as a sub VI. A connecter pane receives data at its input
terminals and passes the data to the block diagram code through the
front panel controls and receives the results at its output terminals
from the front panel indicators.

48
ECG Data Acquisition Using Lab VIEW

Digital filters:
The function of a digital filter is the same as its analog counter
part, but its implementation is very difficult. Analog filters are
implemented using either active or passive electronics circuits, and
they operate on continuous waveforms. Digital filter, on the other
hand are implemented using either a digital logic circuit or a computer
program and they operate on a sequence of numbers that are obtained
by sampling the continuous waveform. The use of digital filters is
widespread today because of the easy availability of computers. The
computer program can be written to implement almost any kind of
digital filter as shown in figure (25) in Lab VIEW.

There are several advantages of digital filters over analog filters.


A digital filter is highly immune to noise because of the way it is
implemented. Accuracy is dependent only on round-off error, which is
directly determined by the number of bits that are designer chooses
for representing the variables in the filter. It is generally easy and
inexpensive to change a filter‘s operating characteristics.

49
ECG Data Acquisition Using Lab VIEW

7. PROCEDURE FOR BUILDING BLOCK DIAGRAM


IN LabVIEW

Procedure For Building Block Diagram For Real Time


Monitoring
Functions>> express >> input >> DAQ assistant
DAQ assistant properties >>analog input>> voltage>> select
channels>> finish (fig 25)

Then we should select terminal configuration, customs scaling,


acquisition mode then clock setting.
Front panel: controls>> graph>> waveform graph
Refer Fig 30 & 31 for Functions & Controls Pallet

Fig 25: Block Diagram of Real Time Monitoring System

50
ECG Data Acquisition Using Lab VIEW

Fig 26: DAQ Assistant

51
ECG Data Acquisition Using Lab VIEW

Fig 27: Acquired & Filtered ECG signals obtained by real time
monitoring

52
ECG Data Acquisition Using Lab VIEW

Procedure for building block diagram for Reading the


Stored Data:

Functions>>file I/O>> read measurement file>>


Function>>signal processing>> waveform condition>> filter (as per
required).
Front panel: controls>> graph>> waveform graph
Refer Fig 30 & 31 for Functions & Controls Pallet

Fig 28: Block Diagram of Reading the Stored Data

53
ECG Data Acquisition Using Lab VIEW

Fig 29: Acquired & Filtered ECG signals obtained by reading the
stored data

54
ECG Data Acquisition Using Lab VIEW

Fig 30: Functions Pallet used in Lab VIEW (Block Diagram)

55
ECG Data Acquisition Using Lab VIEW

Fig 31: Controls Pallet used in Lab View (Front Panel)

56
ECG Data Acquisition Using Lab VIEW

Fig 32: Controls Pallet indicating the procedure for selection of


Graphs.

57
ECG Data Acquisition Using Lab VIEW

8. FUTURE ASPECTS

In future we can also design pc software to analyze received

signals and generate the report. After generating the report. This can

be sent back to the doctor using the GPRS mobile technology. We can

also interface the RTC (real time clock) and configure the device to

send the data in the set time. So using this project any doctor can

configure his phone number in this device and can monitor his

patients ECG report through the telephone line. In future we can

make this device as a remote telephone doctor.

58
ECG Data Acquisition Using Lab VIEW

9. CONCLUSION

Virtual instrumentation is the technology by which we

successfully designed the virtual cardiograph and further

modifications may be :

• Simultaneous monitoring of 12 lead system.

• Some more functions may be added for blocks interval like QT,

PQ etc.

• Auto diagnosis

• Remote monitoring

59
ECG Data Acquisition Using Lab VIEW

REFERNCES

[1] Khandpur R. S, ―A Handbook of Biomedical


Instrumentation, Tata McGraw Hill pub; India, 1993.

[2] IEEE Instrumentation and Measurement Magazine


―What is Virtual Instrumentation ―Dec 2000.

[3] Gupta Sanjay, Joseph John ‗Virtual instrumentation using


LabVIEW‖, Electrical Engineering Series, Tata McGraw Hill
pub. India, 2006.

[4] Data Acquisition manual of National instrument, USA.

[5] Linear ICs and Applications, A.P.Godse , Tech. publications


India , 2008.

60
ECG Data Acquisition Using Lab VIEW

APPENDIX

61
ECG Data Acquisition Using Lab VIEW

62
ECG Data Acquisition Using Lab VIEW

63
ECG Data Acquisition Using Lab VIEW

64
ECG Data Acquisition Using Lab VIEW

65
ECG Data Acquisition Using Lab VIEW

66
ECG Data Acquisition Using Lab VIEW

67
ECG Data Acquisition Using Lab VIEW

68
ECG Data Acquisition Using Lab VIEW

69
ECG Data Acquisition Using Lab VIEW

70
ECG Data Acquisition Using Lab VIEW

71
ECG Data Acquisition Using Lab VIEW

72
ECG Data Acquisition Using Lab VIEW

73
ECG Data Acquisition Using Lab VIEW

74
ECG Data Acquisition Using Lab VIEW

75
ECG Data Acquisition Using Lab VIEW

76

Вам также может понравиться