Anda di halaman 1dari 8

Journal of Medical and Biological Engineering, 30(4): 253-259

253
Low-cost ECG Wireless with Embedded Fuzzy
Diagnosis System
Marius Nicolae Roman
1,*
Stefan Gergely
2
Flaviu Roman
3
Radu Vasile Ciupa
1

1
Biomedical Engineering Department, Technical University of Cluj-Napoca, Cluj-Napoca 400020, Romania
2
National Institute for Research and Development of Isotopic and Molecular Technologies, Cluj-Napoca 400293, Romania
3
Ecole Polytechnique Federale de Lausanne (EPFL), Lausanne 1015, Switzerland
Received 27 Feb 2010; Accepted 9 Jul 2010

Abstract
A normal patient monitoring system gives us only the feedback about crossings of some vital low or high
threshold levels, without comprising specific diagnosis content. In a life-threatening situation, the physicians required
reaction time can be reduced by preparing proper equipment in advance for some specific processing, which may
significantly increase the patients chances of surviving. This is a major advantage in the field of remote exploration.
Therefore, it is important to have a low power consumption system that can give early diagnostic data in health
monitoring. This feature might be critical in case of an eventual data transmission failure between the patient and the
monitoring host PC. Our experiments did establish that in case of the ECG signals, it is possible to take a diagnostic
decision even at a local low-power embedded system.

Keywords: Wireless unit, Local diagnosis, Fuzzy, Microcontroller
1. Wireless link for ECG
Low power consumption requirements are well
accomplished by using as an acquisition unit the
MSP430F5419 microcontroller, which is based on an
embedded 12-bit ADC. The multi I/O architecture and very low
power consumption allows directly on the chip the input of all
12 analog signal channels without external multiplexing. The
12 external and 4 internal analog signals are selected to be the
channel for conversion by the analog input multiplexer. The
input multiplexer is of break-before-make type to reduce
input-to-input noise injection resulting from channel switching.
The assigned transceiver is programmed using the serial data
output from the CC1000 transceiver. The block diagram of the
acquisition interface is shown in Figure 1.
At startup, the host is programmed for the desired number
of channels, transmission rate and data resolution as a number
of bits/samples. The microcontrollers ports are programmed
for data exchange with the host-transceiver, using a very simple
routine. During transmission, data is embedded in a structure
that allows the correct per channel distribution in the
PC-running application. The structure in our case is presented
in Figure 2.

* Corresponding author: Marius Nicolae Roman
Tel: +40-364105626; Fax: +40-364105626
Mob: +40-744393049
E-mail: marius_n_roman@yahoo.com

Figure 1. Block diagram of the acquisition interface.

Automatically lock 32 preamble bite
Noise
DC balanced
preamble
NRZ
data
Noise
E
n
d

d
a
t
a
Packet Start-ID
code
4-bit
channal ID
{0 to 15}
12 bits/channel
Programmable number of packets
max 256 bits/packet
16 bits/channel * [1 to 12 channels]

Figure 2. CC1000 transmission protocol.

J. Med. Biol. Eng., Vol. 30. No. 4 2010

254

Figure 3. Simplified block diagram of CC1000 transceiver.

The acquired data is transmitted using the Texas
Instruments CC1000 transceiver to a closely located base
station for further data analysis. CC1000 is a true single-chip
UHF transceiver designed for very-low-power and
very-low-voltage wireless applications. The circuit is mainly
intended for the Industrial, Scientific and Medical (ISM) and
Short Range Device (SRD) frequency bands at 315, 433, 868
and 915 MHz, with a duplex serial protocol transmission. The
simplified block diagram is shown in Figure 3. The End-Data
section from the data transmission structure contains a
computed cyclic redundancy check (CRC) value at the end of
each transmission sequence. The CRC module provides a
signature for a given data sequence. The signature is generated
through a feedback path from data bits 0, 4, 11, and 15. It is
based on the polynomial given in the CRC-CCITT-BR
polynomial shown in Eq. (1) [1]:
1 ) (
5 12 16
+ + + = x x x x f (1)
In send mode, the voltage-controlled oscillator (VCO)
output signal is fed directly to the power amplifier (PA). The
RF output is frequency shift-keyed (FSK) by the digital bit
stream fed to the DIO pin. The internal T/R switch circuitry
makes the antenna interface and matching very easy. The
frequency synthesizer generates the local oscillator signal,
which is fed to the MIXER in receive mode and to the PA in
transmit mode. It is programmed to achieve the desired
transmission and reception frequency. The device is
programmed through the 3-wire digital serial interface
(CONTROL) at a very fast rate, up to 10 MHz. Throughout
the data transmission, the registers of both transceivers are
programmed according to the desired transmission manner.
We prefer the synchronous NRZ transmission mode, to be able
to operate within a limited bandwidth. There are 28 8-bit
configuration registers, each addressed by a 7-bit address. A
read/write bit initiates a read or write operation. A full
configuration of the CC1000 requires sending 22 data frames
of 16 bits each (7 address bits, R/W bit and 8 data bits). At
reception, data is detected through a digital demodulator
which is contained in the CC1000 transceiver. The signal is
sampled, and its instantaneous frequency is detected. The
result is decimated and filtered. In the data slicer, the data
filter output is compared to the average filter output to
generate the data output [2]. The averaging filter is used to
find the average value of the incoming data. While the
averaging filter is running and acquiring samples, it is
important that the number of high and low bits received is
equal. Therefore all modes, including the synchronous NRZ
mode, need a DC balanced preamble for the internal data slicer
to acquire correct comparison levels from the averaging filter.
The used preamble is a 010101 bit pattern. This is
necessary for the bit synchronizer to synchronize correctly.
The averaging filter must be locked before any NRZ data can
be received. If the averaging filter is locked (MODEM
1.LOCK_AVG_MODE= 1), the acquired value will be kept
also after Power Down or Transmit mode. After a modem
reset (MODEM1.MODEM_RESET_N), or a main reset (using
any of the standard reset sources), the averaging filter is also
reset. In a polled receiver system, the automatic locking can be
used.
The programming of the CC1000 requires an initializing
routine which consist of all registers programming, starting
with addresses 00H to 46H, followed by the PLL and VCO
calibration routines. Finally the TX/RX-routine allows data
transmission. Due to bandwidth requirement, the programmed
baud rate is set to the maximum value, which is 76.8 KBaud in
NRZ synchronous mode.
2. ECG signal preconditioning by denoising and
synchronization
From the Fourier transform of human ECG signal, it has
been found that P- and T-wave frequency generally lie between
0.5 and 10 Hz, and QRS complex frequency ranges between 4
and 20 Hz. The P- or T-wave sometimes coincides with the
baseline noise having a low frequency range of 0-0.8 Hz.
Hence, it is essential to eliminate the baseline noise from ECG
signals. In order to attenuate noise, the signal is passed through
a band pass filter composed of cascaded high-pass and
low-pass integer filters. The band pass filter is designed from a
special class of digital filters that require only integer
coefficients. This allows the software to do the signal
processing using only integer arithmetic and thereby permits
Low-cost ECG Wireless Diagnosis

255
real-time processing. The design actually consists of cascaded
low-pass and high-pass filter sections. For removing the base
line wander and the AC power noise, a non-recursive finite
impulse response (NRFIR) filter has been used with reduced
number of data. The basic principle behind this filtering
process is that the designed frequency response has been
defined with small stop band notches at 0 Hz to remove base
line wander, as well as 50 Hz and its higher harmonics to
remove power line interference. In this algorithm, in order to
reduce the long computational time caused by the large number
of multiplications involved in the filtering in the time domain,
the property of the discrete Fourier transform and symmetrical
nature of the impulse response has been used. This is achieved
by the property that the phase is the linear function of
frequency that corresponds with an exact delay time. As a first
trial we started with a discrete convolution sum for the NRFIR
[3] is presented in Eq. (2):

=
+ + + =
2
3
1
)) ) ) 1 ( (( ) ) (( ) ( ( ) (
M
i
t ki M k n x t ki n ikt h nt y

and |

\
|
|

\
|
= t
M
k n kt
M
h
2
) 1 (
2
) 1 (

(2)
where t: sampling interval of input and output signal, kt: time
interval between successive impulse response coefficients,
x(nt): aquisitioned signal stored in the input signal buffer,
y(nt): filtered signal stored in the output buffer, h(ikt): filter
impulse response coefficients stored in coeficient table,
M: number of filter coefficients.
The computation of this convolution is an intensive
time-consuming task. Thus, for the real-time transmission, a
much faster, 25 point moving average routine is used. The
moving average filter operates by averaging a number of points
from the input signal to produce each point in the output signal.
In equation form, this is written in Eq. (3):
( )

=

=
12
12 i
i i
d
y c
i f
(3)
where c
i
are the known smoothing coefficients for symmetric
averaging and d is the index of the coefficient in the memory
table. The only limitation to such a filter is that it is not suitable
for the frequency domain because the moving average filter
cannot separate one band of frequencies from another [4].
An improvement in computational efficiency can be
achieved if we perform the calculation of the mean in a
recursive fashion. A recursive solution is one which depends on
a previously calculated value. Suppose that at any instant k, the
average of the latest n samples of a data sequence x
i
is given by
Eq. (4):

+ =
=
k
n k i
i
k x
n
x
1
1
(4)
Similarly, at the previous time instant, k-1, the average of the
latest n samples is:
(

=


= + =

1
1
1
1
k
n k i
i
k
n k i
i
k k x x
n
x x
(5)
Rearranged, Eq. (5) gives Eq. (6):
| |
n k k
k k x x
n
x x

=
1
1
(6)
This routine uses fewer operations and therefore is much faster
than the convolution for NRFIR [3]. The NRFIR convolution is
used for a delayed, posterior acquisition analysis, and the
moving average routine is used for real-time transmission.
All the required features for ECG are extracted from the
filtered ECG signal, as shown in the flowchart presented in
Figure 4. The basic and essential component for feature
extraction is the detection of the QRS complex, i.e. locating the
R point for each beat of the signal. Once the R point is
determined, all other characteristic points on the wave are
determined with reference to the R point. The extraction of the
QRS complexes is based on analysis of the slope, amplitude
and width [3]. In order to isolate the portion of the wave where
QRS energy is predominant, the signal is passed through a
band-pass filter composed of cascaded high-pass and low-pass
integer filters [4]. Then the signal is subjected to
differentiation, squaring and time averaging, and finally, the
peak is detected by applying threshold [5]. The next processing
step is differentiation, a usual technique for finding the high
slopes that normally distinguish the QRS complexes from other
ECG waves [6]. To this point in the algorithm, all the processes
are accomplished by linear digital filters. The nonlinear
transformation involves point-by-point squaring of the signal
samples. This transformation serves to make the entire data set
positive prior to subsequent integration. Each heart rate interval
is synchronized to the R point after the threshold setup during
the calibration in the normalization routine [7].

Figure 4. P-, R- and T-wave extraction algorithm.

J. Med. Biol. Eng., Vol. 30. No. 4 2010

256
3. Fuzzy rules for the definition of the pathology
Among the numerous cardiac disorders in comparison
with a normal sinus rhythm presented in Figure 5, we
successfully discriminated between the next following signals
which are considered as pathological:
(1) Sick sinus syndrome (SSS) ECG.
(2) Atrial fibrillation (AF) ECG.
(3) Ventricular fibrillation (VF) ECG.
A
m
p
l
i
t
u
d
e

(a)
A
m
p
l
i
t
u
d
e

(b)
A
m
p
l
i
t
u
d
e

(c)
A
m
p
l
i
t
u
d
e

(d)
Figure 5. (a) Normal sinus rhythm. (b) Sick sinus syndrome (SSS).
(c) Atrial fibrillation (AF). (d) Ventricular fibrillation (VF).

Common practice is to use the end of the QRS complex as
a reference point (the so-called J point) and to measure ST
displacement at constant time intervals after the J point
(typically 40, 60, and 80 ms). Mathematically, the J point is
defined as the point following the QRS complex where a
sensitive decrease of ECG slope is observed.
First of all, we have an algorithm which searches for the
maxima in the acquired signal. That maximum always
represents the R point. After the identification of the R point,
each heart rate is divided into small epochs. The epochs are
vertically delimited by the minimum values of the signal better
than the zero crossing, because of the unipolar characteristic of
the ECG signal. The ECG signal with all three signal epochs is
shown in Figure 6.

Figure 6. Epoch divided heart rate.

Each epoch is characterized by the height of the signal and
its position regarding the two minimal values situated at the
broadside of each analyzed peak. In the ECG signal having a
normal sine rhythm, the R point has the highest amplitude. The
fuzzy rules are always applied to a software normalized signal,
regarding the overall minimum and respective maximum of the
signal. The searching algorithm computes the second derivative
of the signal, and starting from the R point to the left, we find
the minima of the QRS complex and the ending point of the P
wave. If we continue the algorithm, we find the maxima of the
P wave and finally its starting point. This point is also the
starting point of the whole heart rate. At the right side of the R
point, we find the T-wave along with the linked minima points.
These epochs are precisely delimited by the minimum values of
the signal. In our application, each epoch is analyzed through a
set of fuzzy rules, which are embedded in the microcontrollers
memory. A set of fuzzy rules for one epoch is shown in
Figure 7.

Figure 7. Epoch Fuzzy rules.

We have two linguistic variables, Amplitude of the
maxima and Distance of the minima. The linguistic values
given for the variables are: low, normal, high, negative far (NF)
close and positive far (PF). If we have n linguistic variables and
the number of membership functions [6] for variable I is N
i
,
then the total number of rules is shown in Eq. (7):
Low-cost ECG Wireless Diagnosis

257

= =
= = = =
n
i i
i R
N N N N
1
2
1
2 1
9 3 3
(7)
Therefore the total number of rules for one epoch is three.
The only requirement for the complete fuzzy rules set is to
define all the possible ranges for each epoch. From this
knowledge, these basic rules can be defined as follows [6]:
1 , : 1 C y THEN NF is D AND LOW is A IF R
MIN MAX
=

2 , : 2 C y THEN CLOSE is D AND LOW is A IF R
MIN MAX
=

3 , : 3 C y THEN PF is D AND LOW is A IF R
MIN MAX
=

4 , : 4 C y THEN NF is D AND normal is A IF R
MIN MAX
=

5 , : 5 C y THEN CLOSE is D AND normal is A IF R
MIN MAX
=

6 , : 6 C y THEN PF is D AND normal is A IF R
MIN MAX
=

7 , : 7 C y THEN NF is D AND HIGH is A IF R
MIN MAX
=

8 , : 8 C y THEN CLOSE is D AND HIGH is A IF R
MIN MAX
=

9 , : 9 C y THEN PF is D AND HIGH is A IF R
MIN MAX
=

The signal is described by three epochs. Therefore with the
help of the 27 rules, the whole signal can be described. In many
cases it is not necessary to use all the rules. The membership
function for a rule is calculated as a minimum of the
memberships of individual conditions as shown in Eq. (8):
( ) { } ) ( ), ( min ,
) 1 (
MIN CLOSE MAX NORMAL MIN MAX R
D A D A =
(8)
The membership functions for rules R
(1)
through R
(36)
can be
similarly established according to their corresponding rules.
The output conclusions from the inference engine are combined
in a proper way to obtain continuous output signal. That is the
defuzzification process which yields a crisp set from a fuzzy
set. The implied membership value
ij
is interpreted as the
degree of certainty that the output is C
ij
as stated in the rules
data base. The defuzzification method is the centre of the
maximum. This method takes the weighted mean of the output
membership peak position with respect to the implied
membership value produced by R rules, which is shown in
Eq. (9) [6,8]:

=
=

=
) (
1
) (
1
n R
j
ij
n R
i
ij ij
i
C
y

(9)

where y
i
is the output value for each analyzed epoch.
The computation of the fuzzy rules is fast, at 15 s,
because of the very simple operations involved. At the end,
each membership rule generates a related symbol which is
represented by a certain number, and finally, the signal is
described by a string of symbols defined by y
i
. Using the
valuable knowledge of a physician regarding the pathology of
each cardiac disorder, the symbol strings are stored in the
microcontroller. After the signal analysis, when the pathology
pattern is established, the microcontroller transmits the
diagnostic to the host. Also, the last full filtered ECG signal,
which consists of 1024 bytes, is transmitted to the host through
the USB interface connected between the receiving unit and the
host PC.
4. Results
The core of the written software is represented by the
fuzzy rules definition. It is a huge task to embed the personal
knowledge of a physician in a decision-taking software. Our
objective was to be able to determine at least the most
threatening situations which could take place during the
monitoring of a patient. A normal sinus rhythm ECG serves as
a measuring reference. During tests, the reference was
obtained directly from the acquisitioned signal. After each
acquisition iteration, the measured values (duration and
amplitude) of the R-, P-, and T-waves are stored. The
measured values serve as calibration points for the middle
variables of the fuzzy rules, which describe each epoch.
The K(S
R
) and +K(S
R
) variables shown in Figure 7 are
automatically chosen as 30% of the calibration values. The
total amount of RAM memory used for acquisition is 1 Kb.
One acquisition sequence has 500 points at a sampling rate of
100 Hz, therefore there are two iterations where each takes
5 seconds to complete. If the R-wave is detected during the
first iteration, the program enters into the fuzzy rules and the
diagnostic is generated after 5 seconds. The program for the
microcontroller was written and simulated in CrossWorks for
MSP430 a C compiler. In real-time acquisition, the fuzzy core
was tested using LabWindows CVI platform along with an NI
PCI-6220 board. For tests purposes the microcontroller is
driving four LEDs to indicate the recognition of the applied
signals. Figure 8(a) shows the fuzzy rules testing program in
the calibration mode. As a starting point with this method, we
were able to automatically discriminate between four types of
ECG signals by considering the measured values for the signal
epochs. Under testing with real acquired signals, the fuzzy
system was capable of discriminating between these
pathological conditions:
(1) Sick sinus syndrome (SSS) ECG.
(2) Atrial fibrillation (AF) ECG.
(3) Ventricular fibrillation (VF) ECG.
5. Conclusions
After a set of preliminary tests, it was obvious that the
system was naturally stable, but the computing time was
critically high, even with the use of simplified calculations
with routine optimized to integer variables. Therefore, after the
optimization of the rules, the program was rewritten for
another set of 24 rules. There are two main drawbacks of using
the fuzzy rules as a decision machine. One is that the number
J. Med. Biol. Eng., Vol. 30. No. 4 2010

258
(a)

(b)

(c)

(d)

Figure 8. (a) Fuzzy rules testing program in the calibration mode. (b) Recognized sick sinus syndrome condition (SSS). (c) Recognized atrial
fibrillation (AF). (d) Recognized ventricular fibrillation (VF).

Low-cost ECG Wireless Diagnosis

259
of rules tends to grow with the increase of the pathology
complexity. The second drawback is the lack of the
mathematical model for a computer simulation of the designed
set of rules. Hence, the system is used only as a preliminary
diagnosing tool. If necessary, the rest of signal investigation is
done by the physician with the help of the host PC which
contains all the transmitted data. The unit is programmable to
send all data to the host PC or to make self-decisional
diagnosis with human supervision.
As a future development of this wireless link, we intend
to add a wavelet set of routines for the rejection of power
supply noise and a better base line wander removal. Also, a
multi address wireless network may monitor more patients
using a single host computer along with a more refined fuzzy
set of rules able to recognize more complex pathologies.
Acknowledgment
We would like to thank Texas Instruments for their
electronic samples and software which we used to be able to
produce the experimental model.
References
[1] Texas Instruments, Mixed Signal Microcontrollers, available:
http://www.ti.com/
[2] Texas Instruments, Chicon Products, Single Chip Very Low
Power RF Transceiver, available:
http://focus.ti.com/analog/docs/enggresdetail.tsp?familyId=367
&genContentId=3573
[3] R. U. Acharya, J. S. Suri, J. A. E. Spaan and S. M. Krishnan,
Advances in Cardiac Signal Processing, Berlin, Heidelberg:
Springer, ISBN-13: 978-3540366744, 2009.
[4] J. G. Proakis and D. K. Manolakis, Digital Signal Processing
Principles, Algorithms and Applications (4
th
Ed.), Prentice-Hall,
ISBN-13: 978-0131873742, 2006.
[5] R. Oshana, DSP Software Development Techniques for Embeded
and Real Time Systems, Newnes, ISBN-13: 978-0750677592,
2005.
[6] G. Chen and T. T. Pham, Introduction to Fuzzy Sets, Fuzzy Logic
and Fuzzy Control (1
st
Ed.), CRC Press, ISBN-10: 0849316588,
2000.
[7] R. Tadeusiewicz and P. Augustyniak, Ubiquitous Cardiology:
Emerging Wireless Telemedical Applications, Medical
Information Science Reference, ISBN-13: 978-1605660806,
2009.
[8] S. K. Mitra, Digital Signal Processing: A Computer-based
Approach, McGraw-Hill Education (ISE Ed.), ISBN-13:
978-0071157933, 1997.
J. Med. Biol. Eng., Vol. 30. No. 4 2010

260

Anda mungkin juga menyukai