You are on page 1of 7

I E E E TRANSACTI ONS ON BI OME DI CAL E NGI NE E RI NG, VOL. BME - 3 2 , NO.

3 , MARCH 1 9 8 5
A Re a l - Ti m e QRS De t e c t i o n Al g o r i t h m
JI APU PAN AND WI LLI S J. TOMPKI NS, SE NI OR ME MBE R, I E E E
Ab s t r a c t - We h a v e d e v e l o p e d a r e a l - t i m e a l g o r i t h m f o r d e t e c t i o n o f
t h e QRS c o m p l e x e s o f E CG s i g n a l s . I t r e l i a b l y r e c o g n i z e s QRS c o m -
p l e x e s b a s e d u p o n d i g i t a l a n a l y s e s o f s l o p e , a m p l i t u d e , a n d w i d t h . A
s p e c i a l d i g i t a l b a n d p a s s f i l t e r r e d u c e s f a l s e d e t e c t i o n s c a u s e d b y t h e v a r -
i o u s t y p e s o f i n t e r f e r e n c e p r e s e n t i n E CG s i g n a l s . Th i s f i l t e r i n g p e r m i t s
u s e o f l o w t h r e s h o l d s , t h e r e b y i n c r e a s i n g d e t e c t i o n s e n s i t i v i t y . Th e a l g o -
r i t h m a u t o m a t i c a l l y a d j u s t s t h r e s h o l d s a n d p a r a m e t e r s p e r i o d i c a l l y t o
a d a p t t o s u c h E CG c h a n g e s a s QRS m o r p h o l o g y a n d h e a r t r a t e . F o r
t h e s t a n d a r d 2 4 h MI T/ BI H a r r h y t h m i a d a t a b a s e , t h i s a l g o r i t h m c o r -
r e c t l y d e t e c t s 9 9 .3 p e r c e n t o f t h e QRS c o m p l e x e s .
I NTRODUCTI ON
THE RE a r e m a n y u s e s f o r a r e l i a b l e QRS r e c o g n i t i o n a l g o -
r i t h m . Co m p u t e r i n t e r p r e t a t i o n o f t h e 1 2 - l e a d E CG i s a
p o p u l a r t e c h n i q u e . Co r o n a r y c a r e u n i t s n o w u s e a r r h y t h m i a
m o n i t o r s e x t e n s i v e l y . Wi d e l y u s e d Ho l t e r t a p e r e c o r d i n g r e -
q u i r e s a Ho l t e r s c a n n i n g d e v i c e t h a t i n c l u d e s a QRS d e t e c t o r
t o a n a l y z e t h e t a p e s m u c h f a s t e r t h a n r e a l t i m e . Cu r r e n t l y
u n d e r d e v e l o p m e n t a r e a r r h y t h m i a m o n i t o r s f o r a m b u l a t o r y
p a t i e n t s w h i c h a n a l y z e t h e E CG i n r e a l t i m e [ 1 ] - [ 3 1 . Wh e n
a n a r r h y t h m i a a p p e a r s , s u c h a m o n i t o r c a n b e p r o g r a m m e d t o
i m m e d i a t e l y s t o r e a n i n t e r v a l o f t h e a b n o r m a l E CG f o r s u b -
s e q u e n t t r a n s m i s s i o n t o a c e n t r a l s t a t i o n w h e r e a p h y s i c i a n c a n
i n t e r p r e t i t . Su c h a d e v i c e r e q u i r e s a v e r y a c c u r a t e QRS r e c o g -
n i t i o n c a p a b i l i t y . F a l s e d e t e c t i o n r e s u l t s i n u n n e c e s s a r y t r a n s -
m i s s i o n o f d a t a t o t h e c e n t r a l s t a t i o n o r r e q u i r e s a n e x c e s s i v e l y
l a r g e m e m o r y t o s t o r e a n y E CG s e g m e n t s t h a t a r e u n n e c e s s a r i l y
c a p t u r e d . Th u s , a n a c c u r a t e QRS d e t e c t o r i s a n i m p o r t a n t p a r t
o f m a n y E CG i n s t r u m e n t s .
QRS d e t e c t i o n i s d i f f i c u l t , n o t o n l y b e c a u s e o f t h e p h y s i o -
l o g i c a l v a r i a b i l i t y o f t h e QRS c o m p l e x e s , b u t a l s o b e c a u s e o f
t h e v a r i o u s t y p e s o f n o i s e t h a t c a n b e p r e s e n t i n t h e E CG s i g n a l .
No i s e s o u r c e s i n c l u d e m u s c l e n o i s e , a r t i f a c t s d u e t o e l e c t r o d e
m o t i o n , p o w e r - l i n e i n t e r f e r e n c e , b a s e l i n e w a n d e r , a n d T w a v e s
w i t h h i g h - f r e q u e n c y c h a r a c t e r i s t i c s s i m i l a r t o QRS c o m p l e x e s .
I n o u r a p p r o a c h , d i g i t a l f i l t e r s r e d u c e t h e i n f l u e n c e o f t h e s e
n o i s e s o u r c e s , a n d t h e r e b y i m p r o v e t h e s i g n a l - t o - n o i s e r a t i o . Of
t h e m a n y QRS d e t e c t o r s p r o p o s e d i n t h e l i t e r a t u r e , f e w g i v e
s e r i o u s e n o u g h a t t e n t i o n t o n o i s e r e d u c t i o n .
So f t w a r e QRS d e t e c t o r s t y p i c a l l y i n c l u d e o n e o r m o r e o f
t h r e e d i f f e r e n t t y p e s o f p r o c e s s i n g s t e p s : l i n e a r d i g i t a l f i l t e r i n g ,
n o n l i n e a r t r a n s f o r m a t i o n , a n d d e c i s i o n r u l e a l g o r i t h m s [ 4 ] . We
u s e a l l t h r e e t y p e s . Li n e a r p r o c e s s e s i n c l u d e a b a n d p a s s f i l t e r ,
Ma n u s c r i p t r e c e i v e d Ju l y 2 7 , 1 9 8 4 ; r e v i s e d Oc t o b e r 2 4 , 1 9 8 4 . Th i s
w o r k w a s s u p p o r t e d i n p a r t b y t h e Na t i o n a l I n s t i t u t e s o f He a l t h u n d e r
Gr a n t HL0 0 7 6 5 .
J. Pa n i s w i t h t h e De p a r t m e n t o f Bi o p h y s i c s , Sh a n g h a i Se c o n d Me d i c a l
Co l l e g e , Sh a n g h a i , Pe o p l e ' s Re p u b l i c o f Ch i n a .
W. J. To m p k i n s i s w i t h t h e De p a r t m e n t o f E l e c t r i c a l a n d Co m p u t e r
E n g i n e e r i n g , Un i v e r s i t y o f Wi s c o n s i n , Ma d i s o n , WI 5 3 7 0 6 .
a d e r i v a t i v e , a n d a m o v i n g w i n d o w i n t e g r a t o r . Th e n o n l i n e a r
t r a n s f o r m a t i o n t h a t w e u s e i s s i g n a l a m p l i t u d e s q u a r i n g .
Ad a p t i v e t h r e s h o l d s a n d T- w a v e d i s c r i m i n a t i o n t e c h n i q u e s p r o -
v i d e p a r t o f t h e d e c i s i o n r u l e a l g o r i t h m .
Th e s l o p e o f t h e R w a v e i s a p o p u l a r s i g n a l f e a t u r e u s e d t o
l o c a t e t h e QRS c o m p l e x i n m a n y QRS d e t e c t o r s [ 5 ] .
An
a n a l o g c i r c u i t o r a r e a l - t i m e d e r i v a t i v e a l g o r i t h m t h a t p r o v i d e s
s l o p e i n f o r m a t i o n i s s t r a i g h t f o r w a r d t o i m p l e m e n t . Ho w e v e r ,
b y i t s v e r y n a t u r e , a d e r i v a t i v e a m p l i f i e s t h e u n d e s i r a b l e h i g h e r
f r e q u e n c y n o i s e c o m p o n e n t s . Al s o , m a n y a b n o r m a l QRS c o m -
p l e x e s w i t h l a r g e a m p l i t u d e s a n d l o n g d u r a t i o n s a r e m i s s e d i n
a p u r e l y d e r i v a t i v e a p p r o a c h b e c a u s e o f t h e i r r e l a t i v e l y l o w R-
w a v e s l o p e s . Th u s , R- w a v e s l o p e a l o n e i s i n s u f f i c i e n t f o r p r o p e r
QRS d e t e c t i o n . To a c h i e v e r e l i a b l e p e r f o r m a n c e , w e m u s t e x -
t r a c t o t h e r p a r a m e t e r s f r o m t h e s i g n a l s u c h a s a m p l i t u d e , w i d t h ,
a n d QRS e n e r g y [ 6 ] , [ 7 ] .
I t i s v e r y i m p o r t a n t t o e v a l u a t e a QRS d e t e c t o r a l g o r i t h m
u s i n g a s t a n d a r d a r r h y t h m i a d a t a b a s e . Th e r e a r e n o w t w o s u c h
d a t a b a s e s a v a i l a b l e : MI T/ BI H [ 8 ] a n d AHA ( Am e r i c a n He a r t
As s o c i a t i o n ) [ 9 ] . Th e p e r f o r m a n c e o f a n a l g o r i t h m o n a d a t a -
b a s e i s n o t t h e u l t i m a t e a n s w e r a s t o i t s u t i l i t y i n a c l i n i c a l e n -
v i r o n m e n t , b u t i t p r o v i d e s a s t a n d a r d i z e d m e a n s o f c o m p a r i n g
t h e b a s i c p e r f o r m a n c e o f o n e a l g o r i t h m t o a n o t h e r .
ALGORI THM OVE RVI E W
We i m p l e m e n t e d t h e QRS d e t e c t i o n a l g o r i t h m i n a s s e m b l y
l a n g u a g e . I t o p e r a t e s o n e i t h e r a Z 8 0 ( Z i l o g ) o r a n NSC8 0 0
( Na t i o n a l Se m i c o n d u c t o r ) m i c r o p r o c e s s o r . Al l t h e p r o c e s s i n g
i s d o n e w i t h i n t e g e r a r i t h m e t i c s o t h a t t h e a l g o r i t h m c a n o p -
e r a t e i n r e a l t i m e w i t h o u t r e q u i r i n g e x c e s s i v e c o m p u t i n g p o w e r .
Th e d a t a b a s e p r o v i d e s t w o s i m u l t a n e o u s E CG c h a n n e l s . We
a t t e m p t e d t w o - c h a n n e l a n a l y s i s , b u t a b a n d o n e d t h i s a p p r o a c h .
Du e t o t h e w a y t h a t t h e e l e c t r o d e p o s i t i o n s a r e o r t h o g o n a l l y
p l a c e d i n Ho l t e r r e c o r d i n g , a h i g h - q u a l i t y s i g n a l o n o n e c h a n n e l
n o r m a l l y i m p l i e s a l o w - a m p l i t u d e E CG w i t h a p o o r s i g n a l - t o -
n o i s e r a t i o o n t h e s e c o n d c h a n n e l . Th e o n l y w a y t h a t t w o -
c h a n n e l a l g o r i t h m s w i l l y i e l d i m p r o v e d p e r f o r m a n c e f o r m o s t
p a t i e n t s i s b y a d o p t i n g a n e w w a y o f e l e c t r o d e p l a c e m e n t t h a t
w i l l p r o v i d e u s a b l e s i g n a l s i n b o t h c h a n n e l s .
F i g . 1 s h o w s s i g n a l s a t v a r i o u s s t e p s i n d i g i t a l s i g n a l p r o c e s s i n g .
F i r s t , i n o r d e r t o a t t e n u a t e n o i s e , t h e s i g n a l p a s s e s t h r o u g h a
d i g i t a l b a n d p a s s f i l t e r c o m p o s e d o f c a s c a d e d h i g h - p a s s a n d l o w -
p a s s f i l t e r s . F i g . l ( b ) s h o w s t h e o u t p u t o f t h i s f i l t e r . Th e n e x t
p r o c e s s a f t e r f i l t e r i n g i s d i f f e r e n t i a t i o n [ s e e F i g . 1 ( c ) ] , f o l l o w e d
b y s q u a r i n g [ s e e F i g . 1 ( d ) ] , a n d t h e n m o v i n g w i n d o w i n t e g r a -
t i o n [ s e e F i g . 1 ( e ) ] . I n f o r m a t i o n a b o u t t h e s l o p e o f t h e QRS
i s o b t a i n e d i n t h e d e r i v a t i v e s t a g e . Th e s q u a r i n g p r o c e s s i n -
t e n s i f i e s t h e s l o p e o f t h e f r e q u e n c y r e s p o n s e c u r v e o f t h e d e r i v -
a t i v e a n d h e l p s r e s t r i c t f a l s e p o s i t i v e s c a u s e d b y T w a v e s w i t h
0 0
1 8 - 9 2 9 4 / 8 5 / 0 3 0 0 - 0 2 3 0 $ 0 1 .0 0

1 9 8 5 I E E E
2 3 0
Authorized licensed use limited to: Oxford University Libraries. Downloaded on November 20, 2009 at 07:45 from IEEE Xplore. Restrictions apply.
PAN AND TOMPKI NS: RE AL- TI ME QRS DE TE CTI ON ALGORI THM
( a )
( b )
( c )
( d )
( e )
( f )
( g )
F i g . 1 . QRS d e t e c t i o n a l g o r i t h m p r o c e s s i n g s t e p s f o r a n o r m a l E CG f r o m
t h e MI T/ BI H d a t a b a s e . ( a ) Or i g i n a l s i g n a l . ( b ) Ou t p u t o f b a n d p a s s
f i l t e r . ( c ) Ou t p u t o f d i f f e r e n t i a t o r . ( d ) Ou t p u t o f s q u a r i n g p r o c e s s .
( e ) Re s u l t s o f m o v i n g - w i n d o w i n t e g r a t i o n . ( f ) Or i g i n a l E CG s i g n a l
d e l a y e d b y t h e t o t a l p r o c e s s i n g t i m e . ( g ) Ou t p u t p u l s e s t r e a m .
h i g h e r t h a n u s u a l s p e c t r a l e n e r g i e s . Th e m o v i n g w i n d o w i n t e -
g r a t o r p r o d u c e s a s i g n a l t h a t i n c l u d e s i n f o r m a t i o n a b o u t b o t h
t h e s l o p e a n d t h e w i d t h o f t h e QRS c o m p l e x . F i g . 1 ( f ) i s t h e
s a m e a s t h e o r i g i n a l E CG i n F i g . 1 ( a ) e x c e p t d e l a y e d b y t h e
t o t a l p r o c e s s i n g t i m e o f t h e d e t e c t i o n a l g o r i t h m . F i g . l ( g )
s h o w s t h e f i n a l o u t p u t s t r e a m o f p u l s e s m a r k i n g t h e l o c a t i o n s
o f t h e QRS c o m p l e x e s a f t e r a p p l i c a t i o n o f t h e a d a p t i v e
t h r e s h o l d s .
F i g . 2 i l l u s t r a t e s a s e t o f s i g n a l s s i m i l a r t o t h o s e i n F i g . 1 f o r
a n o i s e - c o n t a m i n a t e d E CG i n t h e d a t a b a s e . Th e a l g o r i t h m i s
a b l e t o c o r r e c t l y d e t e c t QRS c o m p l e x e s i n t h e p r e s e n c e o f t h e
s e v e r e n o i s e t y p i c a l o f t h e a m b u l a t o r y E CG e n v i r o n m e n t . We
b a s e d a l l j u d g m e n t s o f c o r r e c t n e s s u p o n t h e a n n o t a t i o n s i n t h e
d a t a b a s e . E a c h a n n o t a t i o n o n t h e l o c a t i o n a n d m o r p h o l o g y
o f a b e a t w a s d e t e r m i n e d b y a r b i t r a t i o n b e t w e e n t w o c a r d i o l -
o g i s t s w h o h a d t o b e i n a g r e e m e n t o n a l l b e a t s i n o r d e r f o r a n
E CG d a t a s e g m e n t t o b e p l a c e d i n t h e d a t a b a s e .
Th e a l g o r i t h m i s d i v i d e d i n t o t h r e e p r o c e s s e s : l e a r n i n g p h a s e
1 , l e a r n i n g p h a s e 2 , a n d d e t e c t i o n . Le a r n i n g p h a s e 1 r e q u i r e s
a b o u t 2 s t o i n i t i a l i z e d e t e c t i o n t h r e s h o l d s b a s e d u p o n s i g n a l a n d
n o i s e p e a k s d e t e c t e d d u r i n g t h e l e a r n i n g p r o c e s s . Le a r n i n g
p h a s e 2 r e q u i r e s t w o h e a r t b e a t s t o i n i t i a l i z e RR - i n t e r v a l a v e r a g e
a n d RR- i n t e r v a l l i m i t v a l u e s . Th e s u b s e q u e n t d e t e c t i o n p h a s e
d o e s t h e r e c o g n i t i o n p r o c e s s a n d p r o d u c e s a p u l s e f o r e a c h QRS
c o m p l e x . Th e t h r e s h o l d s a n d o t h e r p a r a m e t e r s o f t h e a l g o r i t h m
a r e a d j u s t e d p e r i o d i c a l l y t o a d a p t t o c h a n g i n g c h a r a c t e r i s t i c s
o f t h e s i g n a l .
We u s e t w o s e t s o f t h r e s h o l d s t o d e t e c t QRS c o m p l e x e s . On e
s e t t h r e s h o l d s t h e f i l t e r e d E CG, a n d t h e o t h e r t h r e s h o l d s t h e
s i g n a l p r o d u c e d b y m o v i n g w i n d o w i n t e g r a t i o n . By u s i n g t h r e s h -
o l d s o n b o t h s i g n a l s , w e i m p r o v e t h e r e l i a b i l i t y o f d e t e c t i o n
c o m p a r e d t o u s i n g o n e w a v e f o r m a l o n e . Pr e p r o c e s s i n g t h e
( a )
( b )
( c )
( d )
( e )
F i g . 2 . QRS d e t e c t i o n a l g o r i t h m p r o c e s s i n g s t e p s f o r a n o i s e - c o n t a m -
i n a t e d E CG f r o m t h e MI T/ BI H d a t a b a s e . ( a ) Or i g i n a l s i g n a l . ( b ) Ou t -
p u t o f b a n d p a s s f i l t e r . ( c ) Re s u l t s o f m o v i n g - w i n d o w i n t e g r a t i o n .
( d ) Or i g i n a l E CG s i g n a l d e l a y e d b y t h e t o t a l p r o c e s s i n g t i n e . ( e )
Ou t p u t p u l s e s t r e a m .
E CG w i t h t h i s d i g i t a l b a n d p a s s f i l t e r i m p r o v e s t h e s i g n a l - t o -
n o i s e r a t i o a n d p e r m i t s t h e u s e o f l o w e r t h r e s h o l d s t h a n w o u l d
b e p o s s i b l e o n t h e u n f i l t e r e d E CG. Th i s i n c r e a s e s t h e o v e r a l l
d e t e c t i o n s e n s i t i v i t y . Th e d e t e c t i o n t h r e s h o l d s f l o a t o v e r t h e
n o i s e t h a t i s s e n s e d b y t h e a l g o r i t h m . Th i s a p p r o a c h r e d u c e s
t h e n u m b e r o f f a l s e p o s i t i v e s c a u s e d b y t y p e s o f n o i s e t h a t
m i m i c t h e c h a r a c t e r i s t i c s o f t h e QRS c o m p l e x .
Th e a l g o r i t h m u s e s a d u a l - t h r e s h o l d t e c h n i q u e t o f i n d m i s s e d
b e a t s , a n d t h e r e b y r e d u c e f a l s e n e g a t i v e s . Th e r e a r e t w o s e p a -
r a t e t h r e s h o l d l e v e l s i n e a c h o f t h e t w o s e t s o f t h r e s h o l d s . On e
l e v e l i s h a l f o f t h e o t h e r . Th e t h r e s h o l d s c o n t i n u o u s l y a d a p t
t o t h e c h a r a c t e r i s t i c s o f t h e s i g n a l s i n c e t h e y a r e b a s e d u p o n
t h e m o s t - r e c e n t s i g n a l a n d n o i s e p e a k s t h a t a r e d e t e c t e d i n t h e
o n g o i n g p r o c e s s e d s i g n a l s . I f t h e p r o g r a m d o e s n o t f i n d a QRS
c o m p l e x i n t h e t i m e i n t e r v a l c o r r e s p o n d i n g t o 1 6 6 p e r c e n t o f
t h e c u r r e n t a v e r a g e RR i n t e r v a l , t h e m a x i m a l p e a k d e t e c t e d i n
t h a t t i m e i n t e r v a l t h a t l i e s b e t w e e n t h e s e t w o t h r e s h o l d s i s c o n -
s i d e r e d t o b e a p o s s i b l e QRS c o m p l e x , a n d t h e l o w e r o f t h e
t w o t h r e s h o l d s i s a p p l i e d . I n t h i s w a y , w e a v o i d r e q u i r i n g a
l o n g m e m o r y b u f f e r f o r s t o r i n g t h e p a s t h i s t o r y o f t h e E CG,
a n d t h u s r e q u i r e m i n i m a l c o m p u t i n g t i m e t o a c c o m p l i s h t h e
s e a r c h - b a c k p r o c e d u r e t o l o o k f o r a m i s s i n g QRS c o m p l e x .
Un f o r t u n a t e l y , t h e d u a l - t h r e s h o l d t e c h n i q u e i s o n l y u s e f u l
i f t h e h e a r t r a t e i s r e g u l a r . I n a b n o r m a l i t i e s s u c h a s b i g e m i n y
o r t r i g e m i n y , w e c a n n o t f i n d t h e m i s s e d b e a t b y s e a r c h i n g b a c k
t h r o u g h t h e s a m e t i m e i n t e r v a l a s f o r r e g u l a r h e a r t r a t e s . F o r
t h e c a s e o f i r r e g u l a r h e a r t r a t e s , b o t h t h r e s h o l d s a r e r e d u c e d
b y h a l f i n o r d e r t o i n c r e a s e t h e s e n s i t i v i t y o f d e t e c t i o n a n d t o
a v o i d m i s s i n g v a l i d b e a t s .
On c e a v a l i d QRS c o m p l e x i s r e c o g n i z e d , t h e r e i s a 2 0 0 m s
r e f r a c t o r y p e r i o d b e f o r e t h e n e x t o n e c a n b e d e t e c t e d s i n c e
QRS c o m p l e x e s c a n n o t o c c u r m o r e c l o s e l y t h a n t h i s p h y s i o -
l o g i c a l l y . Th i s r e f r a c t o r y p e r i o d e l i m i n a t e s t h e p o s s i b l i t y o f a
f a l s e d e t e c t i o n s u c h a s m u l t i p l e t r i g g e r i n g o n t h e s a m e QRS
c o m p l e x d u r i n g t h i s t i m e i n t e r v a l . Wh e n a QRS d e t e c t i o n
2 3 1
Authorized licensed use limited to: Oxford University Libraries. Downloaded on November 20, 2009 at 07:45 from IEEE Xplore. Restrictions apply.
I E E E TRANSACTI ONS ON BI OME DI CAL E NGI NE E RI NG, VOL. BME - 3 2 , NO. 3 , MARCH 1 9 8 5
o c c u r s f o l l o w i n g t h e e n d o f t h e r e f r a c t o r y p e r i o d b u t w i t h i n
3 6 0 m s o f t h e p r e v i o u s c o m p l e x , w e m u s t d e t e r m i n e i f i t i s a
v a l i d QRS c o m p l e x o r a T w a v e . I n t h i s c a s e , w e j u d g e t h e
w a v e f o r m w i t h t h e l a r g e s t s l o p e t o b e t h e QRS c o m p l e x .
To b e r e l i a b l e , a QRS d e t e c t i o n a l g o r i t h m m u s t a d a p t e a c h
o f i t s p a r a m e t e r s w i t h t i m e s o a s t o b e a b l e t o o p e r a t e p r o p e r l y
f o r E CG' s o f d i f f e r e n t p a t i e n t s a s w e l l a s f o r E CG m o r p h o l o g y
c h a n g e s i n a s i n g l e p a t i e n t . I n o u r a l g o r i t h m , e a c h t h r e s h o l d
a u t o m a t i c a l l y a d a p t s p e r i o d i c a l l y b a s e d u p o n p e a k v a l u e s o f
s i g n a l a n d n o i s e . Wh e n a QRS m u s t b e f o u n d u s i n g s e c o n d
( l o w e r ) t h r e s h o l d s , t h r e s h o l d r e a d j u s t m e n t o c c u r s t w i c e a s f a s t
a s u s u a l . I n t h e d u a l - t h r e s h o l d t e c h n i q u e , t h e RR- i n t e r v a l a v e r -
a g e m u s t b e u p d a t e d f o r e a c h h e a r t b e a t .
Tw o s e p a r a t e m e a s u r e m e n t s o f t h e a v e r a g e RR i n t e r v a l a r e
m a i n t a i n e d . On e RR- i n t e r v a l a v e r a g e i s t h e m e a n o f a l l o f t h e
m o s t r e c e n t e i g h t RR i n t e r v a l s . A s e c o n d RR - i n t e r v a l a v e r a g e
i s t h e m e a n o f t h e m o s t r e c e n t e i g h t b e a t s t h a t f e l l w i t h i n t h e
r a n g e o f 9 2 - 1 1 6 p e r c e n t o f t h e c u r r e n t RR- i n t e r v a l a v e r a g e .
Wi t h o u t t h i s f i r s t a v e r a g e , t h i s a p p r o a c h w o u l d b e s u i t a b l e o n l y
f o r a s l o w l y c h a n g i n g a n d r e g u l a r h e a r t r a t e . Wh e n t h e h e a r t r a t e
s u d d e n l y c h a n g e s , t h e f i r s t RR- i n t e r v a l a v e r a g e s u b s t i t u t e s f o r
t h e s e c o n d o n e . Th e a l g o r i t h m a d a p t s r a p i d l y t o a c h a n g i n g
s i g n a l . I t c a n e v e n a d a p t r a p i d l y w h e n s w i t c h i n g f r o m o n e
p a t i e n t ' s E CG t o a n o t h e r w i t h o u t r e q u i r i n g s p e c i a l l e a r n i n g
p h a s e s .
ME THODS
An a n a l o g f i l t e r b a n d l i m i t s t h e E CG s i g n a l a t 5 0 Hz . An a n a -
l o g - t o - d i g i t a l c o n v e r t e r ( ADC) s a m p l e s t h e E CG a t a r a t e o f 2 0 0
s a m p l e s / s . Th e r e s u l t i n g d i g i t a l s i g n a l p a s s e s s u c c e s s i v e l y
t h r o u g h a s e q u e n c e o f p r o c e s s i n g s t e p s t h a t i n c l u d e s t h r e e
l i n e a r d i g i t a l f i l t e r s i m p l e m e n t e d i n s o f t w a r e . F i r s t i s a n i n t e g e r -
c o e f f i c i e n t b a n d p a s s f i l t e r c o m p o s e d o f c a s c a d e d l o w - p a s s a n d
h i g h - p a s s f i l t e r s . I t s f u n c t i o n i s n o i s e r e j e c t i o n . Ne x t i s a f i l t e r
t h a t a p p r o x i m a t e s a d e r i v a t i v e . Af t e r a n a m p l i t u d e s q u a r i n g
p r o c e s s , t h e s i g n a l p a s s e s t h r o u g h a m o v i n g - w i n d o w i n t e g r a t o r .
Ad a p t i v e t h r e s h o l d s t h e n d i s c r i m i n a t e t h e l o c a t i o n s o f t h e QRS
c o m p l e x e s .
Ba n d p a s s F i l t e r
Th e b a n d p a s s f i l t e r r e d u c e s t h e i n f l u e n c e o f m u s c l e n o i s e ,
6 0 Hz i n t e r f e r e n c e , b a s e l i n e w a n d e r , a n d T- w a v e i n t e r f e r e n c e .
Th e d e s i r a b l e p a s s b a n d t o m a x i m i z e t h e QRS e n e r g y i s a p p r o x -
i m a t e l y 5 - 1 5 Hz [ 1 0 ] , ( 1 1 1 . Ou r f i l t e r i s a f a s t , r e a l - t i m e r e -
c u r s i v e f i l t e r i n w h i c h p o l e s a r e l o c a t e d t o c a n c e l z e r o s o n t h e
u n i t c i r c l e o f t h e z p l a n e [ 1 2 ] . Th i s a p p r o a c h r e s u l t s i n a f i l t e r
d e s i g n w i t h i n t e g e r c o e f f i c i e n t s . Si n c e o n l y i n t e g e r a r i t h m e t i c
i s n e c e s s a r y , a r e a l - t i m e f i l t e r c a n b e i m p l e m e n t e d w i t h a s i m p l e
m i c r o p r o c e s s o r a n d s t i l l h a v e a v a i l a b l e c o m p u t i n g p o w e r l e f t
t o d o t h e QRS r e c o g n i t i o n t a s k .
Th i s c l a s s o f f i l t e r s h a v i n g p o l e s a n d z e r o s o n l y o n t h e u n i t
c i r c l e p e r m i t s l i m i t e d p a s s b a n d d e s i g n f l e x i b i l i t y . F o r o u r
c h o s e n s a m p l e r a t e , w e c o u l d n o t d e s i g n a b a n d p a s s f i l t e r d i -
r e c t l y f o r t h e d e s i r e d p a s s b a n d o f 5 - 1 5 Hz u s i n g t h i s s p e c i a l i z e d
d e s i g n t e c h n i q u e . Th e r e f o r e , w e c a s c a d e d t h e l o w - p a s s a n d
h i g h - p a s s f i l t e r s d e s c r i b e d b e l o w t o a c h i e v e a 3 d B p a s s b a n d
f r o m a b o u t 5 - 1 2 Hz , r e a s o n a b l y c l o s e t o t h e d e s i g n g o a l . F i g . 3
s h o w s t h e o v e r a l l f r e q u e n c y r e s p o n s e .
F r e q u e n c y
( Hz )
.L;
( r )
L
E L
E 4
F i g . 3 . Am p l i t u d e r e s p o n s e o f t h e d i g i t a l b a n d p a s s
d B) i s 5 - 1 1 Hz .
Lo w - Pa s s F i l t e r
Th e t r a n s f e r f u n c t i o n o f t h e s e c o n d - o r d e r l o w - p a s s f i l t e r i s
( 1
-
6 2
H( Z )
=
( I
z
1 ) 2
.
Th e a m p l i t u d e r e s p o n s e i s
s i n 2
( 3 o T)
Hw T
= s i n 2
( w TI 2 )
( 3
( 1 )
( 2 )
w h e r e T i s t h e s a m p l i n g p e r i o d . Th e d i f f e r e n c e e q u a t i o n o f
t h e f i l t e r i s
y ( n T)
=
2 y ( n T - T) - y ( n T - 2 T) + x ( n T)
- 2 x ( n T- 6 T) + x ( n T- 1 2 T)
( 3 )
w h e r e t h e c u t o f f f r e q u e n c y i s a b o u t 1 1 Hz a n d t h e g a i n i s 3 6 .
Th e f i l t e r p r o c e s s i n g d e l a y i s s i x s a m p l e s .
Hi g h - Pa s s F i l t e r
Th e d e s i g n o f t h e h i g h - p a s s f i l t e r i s b a s e d o n s u b t r a c t i n g t h e
o u t p u t o f a f i r s t - o r d e r l o w - p a s s f i l t e r f r o m a n a l l - p a s s f i l t e r ( i .e .,
t h e s a m p l e s i n t h e o r i g i n a l s i g n a l ) . Th e t r a n s f e r f u n c t i o n f o r
s u c h a h i g h - p a s s f i l t e r i s
H( z )
=
( 1 + z 1 )
)
Th e a m p l i t u d e r e s p o n s e i s
| H( w T) I = [ 2 5 6 + s i n 2 ( 1 6 c T) ] 1 / 2
c o s ( w T/ 2 )
Th e d i f f e r e n c e e q u a t i o n i s
y ( n T)
=
3 2 x ( n T
- 1 6 T)
-
[ y ( n T
-
T)
+
x ( n T)
-
x ( n T
-
3 2 T) ] .
( 4 )
( 5 )
( 6 )
Th e l o w c u t o f f f r e q u e n c y o f t h i s f i l t e r i s a b o u t 5 Hz , t h e g a i n
i s 3 2 , a n d t h e d e l a y i s 1 6 s a m p l e s .
De r i v a t i v e
Af t e r f i l t e r i n g , t h e s i g n a l i s d i f f e r e n t i a t e d t o p r o v i d e t h e QRS-
c o m p l e x s l o p e i n f o r m a t i o n . We u s e a f i v e - p o i n t d e r i v a t i v e w i t h
2 3 2
Authorized licensed use limited to: Oxford University Libraries. Downloaded on November 20, 2009 at 07:45 from IEEE Xplore. Restrictions apply.
PAN AND TOMPKI NS: RE A L- TI ME QRS DE TE CTI ON ALGORI THM
t h e t r a n s f e r f u n c t i o n
H( z ) ( l / 8 T) ( - z - 2 - 2 z - + 2 z ' + Z 2 )
Th e a m p l i t u d e r e s p o n s e i s
| H( w T) j
=
( 1 / 4 T) [ s i n ( 2 c o T)
+ 2 s i n
( c w T) ] .
Th e d i f f e r e n c e e q u a t i o n i s [ 7 ]
y ( n T) = ( 1 / 8 T) [ - x ( n T - 2 T) - 2 x ( n T - T)
F r e q u e n c y
( Hz )
( 7 )
LI
a U-
~ L
( 8 ) 1 : J
,,
L
+ 2 x ( n T
+
T) + x ( n T+ 2 T) ] . ( 9 )
F i g . 4 s h o w s t h a t t h e f r e q u e n c y r e s p o n s e o f t h i s d e r i v a t i v e i s
n e a r l y l i n e a r b e t w e e n d c a n d 3 0 Hz ( i .e ., i t a p p r o x i m a t e s a n
i d e a l d e r i v a t i v e o v e r t h i s r a n g e ) . I t s d e l a y i s t w o s a m p l e s .
Sq u a r i n g F u n c t i o n
Af t e r d i f f e r e n t i a t i o n , t h e s i g n a l i s s q u a r e d p o i n t b y p o i n t .
Th e e q u a t i o n o f t h i s o p e r a t i o n i s
1 .
I
D
- 0
- - I
E
V
F i g . 4 . Am p l i t u d e r e s p o n s e o f t h e d i g i t a l d e r i v a t i v e f i l t e r .
y ( n T) = [ x ( n T) ] 2 .
Th i s m a k e s a l l d a t a p o i n t s p o s i t i v e a n d d o e s n o n l i n e a r a m p l i f i -
c a t i o n o f t h e o u t p u t o f t h e d e r i v a t i v e e m p h a s i z i n g t h e h i g h e r
f r e q u e n c i e s ( i .e ., p r e d o m i n a n t l y t h e E CG f r e q u e n c i e s ) .
Mo v i n g - Wi n d o w I n t e g r a t i o n
Th e p u r p o s e o f m o v i n g - w i n d o w i n t e g r a t i o n i s t o o b t a i n w a v e -
f o r m f e a t u r e i n f o r m a t i o n i n a d d i t i o n t o t h e s l o p e o f t h e R w a v e .
I t i s c a l c u l a t e d f r o m
y ( n T)
=
( 1 / N) [ x ( n T- ( N
-
1 ) T) + x ( n T- ( N
-
2 ) T)
( W- QS)
F i g . 5 . Th e r e l a t i o n s h i p o f a QRS c o m p l e x t o t h e m o v i n g i n t e g r a t i o n
w a v e f o r m . ( a ) E CG s i g n a l . ( b ) Ou t p u t o f m o v i n g - w i n d o w i n t e g r a t o r .
QS: QRS w i d t h . W: w i d t h o f t h e i n t e g r a t o r w i n d o w .
( 1 1 )
w h e r e N i s t h e n u m b e r o f s a m p l e s i n t h e w i d t h o f t h e i n t e g r a -
t i o n w i n d o w .
F i g . 5 s h o w s t h e r e l a t i o n s h i p b e t w e e n t h e m o v i n g - w i n d o w
i n t e g r a t i o n w a v e f o r m a n d t h e QRS c o m p l e x . Th e n u m b e r o f
s a m p l e s N i n t h e m o v i n g w i n d o w i s i m p o r t a n t . Ge n e r a l l y , t h e
w i d t h o f t h e w i n d o w s h o u l d b e a p p r o x i m a t e l y t h e s a m e a s t h e
w i d e s t p o s s i b l e QRS c o m p l e x . I f t h e w i n d o w i s t o o w i d e , t h e
i n t e g r a t i o n w a v e f o r m w i l l m e r g e t h e - QRS a n d T c o m p l e x e s
t o g e t h e r . I f i t i s t o o n a r r o w , s o m e QRS c o m p l e x e s w i l l p r o d u c e
s e v e r a l p e a k s i n t h e i n t e g r a t i o n w a v e f o r m . Th e s e c a n c a u s e d i f -
f i c u l t y i n s u b s e q u e n t QRS d e t e c t i o n p r o c e s s e s . Th e w i d t h o f
t h e w i n d o w i s d e t e r m i n e d e m p i r i c a l l y . F o r o u r s a m p l e r a t e
o f 2 0 0 s a m p l e s / s , t h e w i n d o w i s 3 0 s a m p l e s w i d e ( 1 5 0 m s ) .
F i d u c i a l Ma r k
Th e QRS c o m p l e x c o r r e s p o n d s t o t h e r i s i n g e d g e o f t h e i n t e -
g r a t i o n w a v e f o r m . Th e t i m e d u r a t i o n o f t h e r i s i n g e d g e i s e q u a l
t o t h e w i d t h o f t h e QRS c o m p l e x . A f i d u c i a l m a r k f o r t h e
t e m p o r a l l o c a t i o n o f t h e QRS c o m p l e x c a n b e d e t e r m i n e d f r o m
t h i s r i s i n g e d g e a c c o r d i n g t o t h e d e s i r e d w a v e f o r m f e a t u r e t o
b e m a r k e d s u c h a s t h e m a x i m a l s l o p e o r t h e p e a k o f t h e R w a v e .
Ad j u s t i n g t h e Th r e s h o l d s
Th e t h r e s h o l d s a r e a u t o m a t i c a l l y a d j u s t e d t o f l o a t o v e r t h e
n o i s e . Lo w t h r e s h o l d s a r e p o s s i b l e b e c a u s e o f t h e i m p r o v e -
m e n t o f t h e s i g n a l - t o - n o i s e r a t i o b y t h e b a n d p a s s f i l t e r .
Th e h i g h e r o f t h e t w o t h r e s h o l d s i n e a c h o f t h e t w o s e t s i s
u s e d f o r t h e f i r s t a n a l y s i s o f t h e s i g n a l . Th e l o w e r t h r e s h o l d
i s u s e d i f n o QRS i s d e t e c t e d i n a c e r t a i n t i m e i n t e r v a l s o t h a t
a s e a r c h - b a c k t e c h n i q u e i s n e c e s s a r y t o l o o k b a c k i n t i m e f o r
t h e QRS c o m p l e x . Th e s e t o f t h r e s h o l d s i n i t i a l l y a p p l i e d t o
t h e i n t e g r a t i o n w a v e f o r m i s c o m p u t e d f r o m
SPKI = 0 .1 2 5 PE AKI + 0 .8 7 5 SPKI
( i f PE AKI i s t h e s i g n a l p e a k )
NPKI = 0 .1 2 5 PE AKI + 0 .8 7 5 NPKI
( i f PE AKI i s t h e n o i s e p e a k )
THRE SHOLD I l
= NPKI + 0 .2 5 ( SPKI
-
NPKI )
THRE SHOLD I 2 = 0 .5 THRE SHOLD I l
w h e r e a l l t h e v a r i a b l e s r e f e r t o t h e i n t e g r a t i o n w a v e f o r m :
PE AKI i s t h e o v e r a l l p e a k ,
SPKI i s t h e r u n n i n g e s t i m a t e o f t h e s i g n a l p e a k ,
NPKI i s t h e r u n n i n g e s t i m a t e o f t h e n o i s e p e a k ,
THRE SHOLD I l i s t h e f i r s t t h r e s h o l d a p p l i e d , a n d
THRE SHOLD 1 2 i s t h e s e c o n d t h r e s h o l d a p p l i e d .
( 1 2 )
( 1 3 )
( 1 4 )
( 1 5 )
A p e a k i s a l o c a l m a x i m u m d e t e r m i n e d b y o b s e r v i n g w h e n t h e
s i g n a l c h a n g e s d i r e c t i o n w i t h i n a p r e d e f i n e d t i m e i n t e r v a l . Th e
s i g n a l p e a k SPKI i s a p e a k t h a t t h e a l g o r i t h m h a s a l r e a d y e s t a b -
l i s h e d t o b e a QRS c o m p l e x . Th e n o i s e p e a k NPKI i s a n y p e a k
( 1 0 )
2 3 3
+
-
* * +
x ( n T) ]
Authorized licensed use limited to: Oxford University Libraries. Downloaded on November 20, 2009 at 07:45 from IEEE Xplore. Restrictions apply.
I E E E TRANSACTI ONS ON BI OME DI CAL E NGI NE E RI NG, VOL. BME - 3 2 , NO. 3 , MARCH 1 9 8 5
t h a t i s n o t r e l a t e d t o t h e QRS ( e .g ., t h e Tw a v e ) . Th e t h r e s h -
o l d s a r e b a s e d u p o n r u n n i n g e s t i m a t e s o f SPKI a n d NPKI . Th a t
i s , n e w v a l u e s o f t h e s e v a r i a b l e s a r e c o m p u t e d i n p a r t f r o m t h e i r
p r i o r v a l u e s . Wh e n a n e w p e a k i s d e t e c t e d , i t m u s t f i r s t b e
c l a s s i f i e d a s a n o i s e p e a k o r a s i g n a l p e a k . To b e a s i g n a l p e a k ,
t h e p e a k m u s t e x c e e d THRE SHOLD I 1 a s t h e s i g n a l i s f i r s t
a n a l y z e d o r THRE SHOLD 1 2 i f s e a r c h b a c k i s r e q u i r e d t o f i n d
t h e QRS. Wh e n t h e QRS c o m p l e x i s f o u n d u s i n g t h e s e c o n d
t h r e s h o l d - ,
SPKI = 0 .2 5 PE AKI + 0 .7 5 SPKI . ( 1 6 )
Th e s e t o f t h r e s h o l d s a p p l i e d t o t h e f i l t e r e d E CG i s d e t e r m i n e d
f r o m
SPKF = 0 .1 2 5 PE AKF + 0 .8 7 5 SPKF
( i f PE AKF i s t h e s i g n a l p e a k )
NPKF = 0 .1 2 5 PE AKF + 0 .8 7 5 NPKF
( i f PE AKF i s t h e n o i s e p e a k )
THRE SHOLD F 1 = NPKF + 0 .2 5 ( SPKF - NPKF )
THRE SHOLD F 2 = 0 .5 THRE SHOLD F l
w h e r e a l l t h e v a r i a b l e s r e f e r t o t h e f i l t e r e d E CG:
PE AKF i s t h e o v e r a l l p e a k ,
SPKF i s t h e r u n n i n g e s t i m a t e o f t h e s i g n a l p e a k ,
NPKF i s t h e r u n n i n g e s t i m a t e o f t h e n o i s e p e a k ,
THRE SHOLD F l i s t h e f i r s t t h r e s h o l d a p p l i e d , a n d
THRE SHOLD F 2 i s t h e s e c o n d t h r e s h o l d a p p l i e d .
( 1 7 )
( 1 8 )
( 1 9 )
( 2 0 )
Wh e n t h e QRS c o m p l e x i s f o u n d u s i n g t h e s e c o n d t h r e s h o l d ,
SPKF
= 0 .2 5 PE AKF + 0 .7 5 SPKF . ( 2 1 )
F o r i r r e g u l a r h e a r t r a t e s , t h e f i r s t t h r e s h o l d o f e a c h s e t i s r e -
d u c e d b y h a l f s o a s t o i n c r e a s e t h e d e t e c t i o n s e n s i t i v i t y a n d t o
a v o i d m i s s i n g b e a t s :
THRE SHOLDI I v - 0 .5 THRE SHOLD I I ( 2 2 )
THRE SHOLD F l 0 .5 THRE SHOLD F l . ( 2 3 )
To b e i d e n t i f i e d a s a QRS c o m p l e x , a p e a k m u s t b e r e c o g n i z e d
a s s u c h a c o m p l e x i n b o t h t h e i n t e g r a t i o n a n d b a n d p a s s - f i l t e r e d
w a v e f o r m s .
Ad j u s t i n g t h e Av e r a g e RR I n t e r v a l a n d Ra t e Li m i t s
Tw o RR- i n t e r v a l a v e r a g e s a r e m a i n t a i n e d . On e i s t h e a v e r a g e
o f t h e e i g h t m o s t - r e c e n t b e a t s . Th e o t h e r i s t h e a v e r a g e o f t h e
e i g h t m o s t - r e c e n t b e a t s h a v i n g RR i n t e r v a l s t h a t f a l l w i t h i n c e r -
t a i n l i m i t s . Th e r e a s o n f o r m a i n t a i n i n g t h e s e t w o s e p a r a t e a v e r -
a g e s i s t o b e a b l e t o a d a p t t o q u i c k l y c h a n g i n g o r i r r e g u l a r h e a r t
r a t e s . Th e f i r s t a v e r a g e i s t h e m e a n o f t h e e i g h t m o s t - r e c e n t
s e q u e n t i a l RR i n t e r v a l s r e g a r d l e s s o f t h e i r v a l u e s .
RR AVE RAGE 1 = 0 .1 2 5 ( RRI n - I 7 + RRI n - 6
+
- + RRn )
( 2 4 )
w h e r e RR
n
i s t h e m o s t - r e c e n t RR i n t e r v a l .
Th e s e c o n d a v e r a g e i s b a s e d o n s e l e c t e d b e a t s .
RR AVE RAGE 2 = 0 .1 2 5 ( RR' _ 7 + RR' ? 6 + * *
-
+ RR' )
( 2 5 )
w h e r e RR' i s t h e m o s t r e c e n t RR i n t e r v a l t h a t f e l l b e t w e e n
t h e a c c e p t a b l e l o w a n d h i g h RR - i n t e r v a l l i m i t s . Th e RR- i n t e r -
v a l l i m i t s a r e
RR LOW LI MI T
=
9 2 % RR AVE RAGE 2
RR HI GH LI MI T
=
1 1 6 % RR AVE RAGE 2 .
RR MI SSE D LI MI T
=
1 6 6 % RR AVE RAGE 2
( 2 6 )
( 2 7 )
( 2 8 )
I f a QRS c o m p l e x i s n o t f o u n d d u r i n g t h e i n t e r v a l s p e c i f i e d
b y t h e RR MI SSE D LI MI T, t h e m a x i m a l p e a k r e s e r v e d b e t w e e n
t h e - t w o e s t a b l i s h e d t h r e s h o l d s i s c o n s i d e r e d t o b e a QRS
c a n d i d a t e .
I f e a c h o f t h e e i g h t m o s t - r e c e n t s e q u e n t i a l RR i n t e r v a l s t h a t
a r e c a l c u l a t e d f r o m RR AVE RAGE 1 i s b e t w e e n t h e RR LOW
LI MI T a n d t h e RR HI GH LI MI T, w e i n t e r p r e t t h e h e a r t r a t e
t o b e r e g u l a r f o r t h e s e e i g h t h e a r t b e a t s a n d
( 2 9 )
RR AVE RAGE 2>- RR AVE RAGE 1 .
Th i s i s t h e c a s e f o r n o r m a l s i n u s r h y t h m .
T- Wa v e I d e n t i f i c a t i o n
Wh e n a n RI i n t e r v a l i s l e s s t h a n 3 6 0 m s ( i t m u s t b e g r e a t e r
t h a n t h e 2 0 0 m s l a t e n c y ) , a j u d g m e n t i s m a d e t o d e t e r m i n e
w h e t h e r t h e c u r r e n t QRS c o m p l e x h a s b e e n c o r r e c t l y i d e n t i f i e d
o r w h e t h e r i t i s r e a l l y a T w a v e . I f t h e m a x i m a l s l o p e t h a t
o c c u r s d u r i n g t h i s w a v e f o r m i s l e s s t h a n h a l f t h a t o f t h e QRS
w a v e f o r m t h a t p r e c e d e d i t , i t i s i d e n t i f i e d t o b e a Tw a v e ; o t h e r -
w i s e , i t i s c a l l e d a QRS c o m p l e x .
E VALUATI ON
We u s e d t h e MI T/ BI H a r r h y t h m i a d a t a b a s e t o e v a l u a t e t h e
QRS d e t e c t i o n a l g o r i t h m [ 8 ] . Th e d a t a b a s e c o n s i s t s o f 4 8
h a l f - h o u r r e c o r d i n g s f o r a t o t a l o f 2 4 h o f E CG d a t a . Th e d a t a -
b a s e i s o n f o u r - c h a n n e l F M m a g n e t i c t a p e . Ch a n n e l s I a n d 2
a r e t h e t w o - c h a n n e l E CG s i g n a l s . Ch a n n e l 3 i s a n a n n o t a t i o n
c h a n n e l r e c o r d e d i n a s t a n d a r d b i n a r y f o r m a t , a n d c h a n n e l 4
i s a b i n a r y - r e c o r d e d t i m i n g t r a c k .
F i g . 6 s h o w s t h e e x p e r i m e n t a l s e t u p f o r e v a l u a t i o n o f t h e
QRS a l g o r i t h m . I t i n c l u d e s t w o f o u r - c h a n n e l F M t a p e r e -
c o r d e r s , t w o Z 8 0 - b a s e d l a b o r a t o r y m i c r o c o m p u t e r s y s t e m s , a
d c a m p l i f i e r , a n d a n o n f a d e o s c i l l o s c o p e .
Us i n g t h e QRS d e t e c t i o n a l g o r i t h m , o n e o f t h e m i c r o c o m -
p u t e r s y s t e m s s a m p l e s a n d a n a l y z e s t h e d a t a b a s e E CG p l a y e d
b a c k f r o m o n e o f t h e F M r e c o r d e r s . I f i t d e t e c t s a QRS c o m -
p l e x , i t g e n e r a t e s a p u l s e . Si m u l t a n e o u s l y , t h e s e c o n d m i c r o -
c o m p u t e r m o n i t o r s t h e e n c o d e d b e a t a n n o t a t i o n c h a n n e l o f
t h e r e c o r d e r a n d g e n e r a t e s a p u l s e c o i n c i d e n t w i t h t h e f i d u c i a l
m a r k a n n o t a t e d i n t h e d a t a b a s e .
A s e c o n d f o u r - c h a n n e l F M t a p e r e c o r d e r r e c o r d s t h e o r i g i n a l
E CG w a v e f o r m b e i n g a n a l y z e d o n o n e c h a n n e l a n d t h e p u l s e s
f r o m e a c h o f t h e m i c r o c o m p u t e r s y s t e m s o n t w o o t h e r c h a n -
n e l s . Al l o f t h e s e s i g n a l s a p p e a r o n a n o n f a d e d i s p l a y o s c i l l o -
s c o p e o r a c h a r t r e c o r d e r f o r f u r t h e r v i s u a l e v a l u a t i o n .
2 3 4
Authorized licensed use limited to: Oxford University Libraries. Downloaded on November 20, 2009 at 07:45 from IEEE Xplore. Restrictions apply.
PAN AND TOMPKI NS: RE AL- TI ME QRS DE TE CTI ON ALGORI THM
F i g . 6 . E x p e r i m e n t a l s e t u p f o r e v a l u a t i n g t h e QRS d e t e c t i o n a l g o r i t h m
u s i n g t h e MI T/ BI H d a t a b a s e . 1 : E CG s i g n a l f r o m MI T/ BI H d a t a b a s e
c h a n n e l 1 . 2 : Bi n a r y a n n o t a t i o n f r o m MI T/ BI H d a t a b a s e c h a n n e l 3 .
3 : Sa m p l e d a n d r e c o n s t r u c t e d E CG s i g n a l . 4 : Pu l s e g e n e r a t e d b y d e t e c -
t i o n a l g o r i t h m . 5 : Pu l s e o b t a i n e d f r o m a n n o t a t i o n t r a c k f i d u c i a l m a r k .
TABLE I
RE SULTS OF E VALUATI NG THE RE AL- TI ME QRS DE TE CTI ON ALGORI THM
USI NG THE MI T/ BI H DATABASE
To t a l F a i l e d F a i l e d
Ta p e ( No . F P F N De t e c t i o n De t e c t i o n
( No .) Be a t s ) ( Be a t s ) ( Be a t s ) ( Be a t s ) ( % )
2 2 7 3
1 8 6 5
2 1 8 7
2 0 8 4
2 2 3 0
2 5 7 2
2 0 2 7
2 1 3 7
1 7 6 3
2 5 3 2
2 1 2 4
2 5 3 9
1 7 9 5
1 8 7 9
1 9 5 3
2 4 1 2
1 5 3 5
2 2 7 5
1 9 8 7
1 8 6 3
2 4 7 6
1 5 1 8
1 6 1 9
2 6 0 1
1 9 6 3
2 1 3 6
2 9 8 2
2 6 5 6
1 8 6 2
2 9 5 6
3 0 0 4
2 6 4 7
2 7 4 8
3 2 5 1
2 2 6 2
3 3 6 3
2 2 0 8
2 1 5 4
2 0 4 8
2 4 2 7
2 4 8 4
2 6 0 5
2 0 5 3
2 2 5 6
1 8 8 6
1 7 8 0
3 0 7 9
2 7 5 3
1 1 6 1 3 7
0 0 0
5 3 8
0 0 0
0 0 0
1 0 1
6 7 2 2 8 9
5 2 7
0 2 2
1 9 9 2 2 2 2 1
0 1 1
1 0 1
0 1 1
0 0 0
3 1 7 2 0
0 0 0
3 2 2 2 5
1 1 2
1 0 1
1 0 1
4 7 1 1
1 1 2
0 0 0
0 0 0
6 3 9
0 1 0 1 0
0 4 4
5 3 3 0 8 3
0 2 2
4 4 8
4 1 4 1 8
3 0 3
2 8 1 0
0 0 0
1 2 3
2 4 6
0 1 . 1
4 6 1 0
0 0 0
0 0 0
2 0 0
1 0 1 8 1 1 8 2
1 0 1
2 5 5 3 0
1 0 1
0 0 0
6 1 7
0 1 1
O- 0 0
5 0 7 2 7 7 7 8 4
0
0 .4 3
0
0
0 .0 4
3 .4 6
0 .0 5
0 .0 9
1 2 .5 4
0 .0 4
0 .0 5
0 .0 4
0
1 .0 6
0
1 .0 4
0 .1 3
0 .0 4
0 .0 5
0 .5 9
0 .0 8
0
0
0 .3 5
0 .5 1
0 .1 9
2 .7 8
0 .0 8
0 .4 3
0 .6 0
0 .1 0
0 .3 8
0
0 .0 9
0 .2 6
0 .0 3
0 .4 5
0
0
0 .0 8
7 .3 3
0 .0 4
1 .4 6
0 .0 4
0
0 .3 9
0 .0 3
0
0 .6 7 5
Th e m a x i m a l a m p l i t u d e o f t h e E CG f r o m t h e F M r e c o r d e r i s
l e s s t h a n + 1 V, s o a d c a m p l i f i e r a m p l i f i e s t h e s i g n a l b y a g a i n
o f 2 .5 t o e n s u r e t h a t t h e s i g n a l u s e s t h e f u l l r a n g e o f t h e A/ D
c o n v e r t e r ( t h e i n p u t v o l t a g e r a n g e i s 2 .5 V) .
Th e 2 4 h MI T/ BI H d a t a b a s e c o n t a i n s m o r e t h a n 1 1 6 0 0 0
b e a t s . Ta b l e I s u m m a r i z e s t h e p e r f o r m a n c e o f o u r a l g o r i t h m
f o r t h i s d a t a b a s e . I t p r o d u c e d 5 0 7 f a l s e p o s i t i v e b e a t s ( 0 .4 3 7
p e r c e n t ) a n d 2 7 7 f a l s e n e g a t i v e b e a t s ( 0 .2 3 9 p e r c e n t ) f o r a t o t a l
d e t e c t i o n f a i l u r e o f 0 .6 7 5 p e r c e n t .
Th e p r o b l e m t a p e s a r e c h a r a c t e r i z e d , i n g e n e r a l , b y s t r e t c h e s
o f n o i s e , b a s e l i n e s h i f t s , a n d a r t i f a c t s . Ta p e 1 0 8 h a s u n u s u a l l y
t a l l , p e a k e d P w a v e s q u i t e u n c h a r a c t e r i s t i c i n m o r p h o l o g y o f
t y p i c a l P w a v e s . Pa r t i c u l a r l y a t t h e b e g i n n i n g a n d e n d o f t h i s
t a p e , t h e s e P w a v e s a r e c l a s s i f i e d a s QRS c o m p l e x e s b e c a u s e o f
t h e i r h i g h s l o p e s . Th i s l e a d s t o a h i g h f a l s e p o s i t i v e c o u n t o n
t h i s t a p e . Ta p e 2 2 2 a l s o h a s s o m e n o n - QRS w a v e s w i t h h i g h l y
u n u s u a l m o r p h o l o g i e s t h a t l e a d t o f a l s e p o s i t i v e s . A f a l s e p o s i -
t i v e d e t e c t i o n f o r o n e o f t h e s e b i z a r r e w a v e s h a p e s c a n s o m e -
t i m e s l e a d t o a f a l s e n e g a t i v e o n t h e f o l l o w i n g QRS c o m p l e x
b e c a u s e t h e a l g o r i t h m i n c l u d e s a l a t e n c y t i m e f r o m t h e t i m e a
QRS i s d e t e c t e d t o t h e n e x t p e r m i t t e d d e t e c t i o n .
SUMMARY
We h a v e d e v e l o p e d a n o n - l i n e r e a l - t i m e QRS d e t e c t i o n a l g o -
r i t h m a n d i m p l e m e n t e d i t i n Z 8 0 a s s e m b l y l a n g u a g e . Th i s
a l g o r i t h m r e l i a b l y d e t e c t s QRS c o m p l e x e s u s i n g s l o p e , a m p l i -
t u d e , a n d w i d t h i n f o r m a t i o n . A b a n d p a s s f i l t e r p r e p r o c e s s e s
t h e s i g n a l t o r e d u c e i n t e r f e r e n c e , p e r m i t t i n g t h e u s e o f l o w -
a m p l i t u d e t h r e s h o l d s i n o r d e r t o g e t h i g h d e t e c t i o n s e n s i t i v i t y .
I n t h e a l g o r i t h m , w e u s e a d u a l - t h r e s h o l d s t e c h n i q u e a n d s e a r c h -
b a c k f o r m i s s e d b e a t s .
Th e a l g o r i t h m p e r i o d i c a l l y a d a p t s e a c h t h r e s h o l d a n d RR i n -
t e r v a l l i m i t a u t o m a t i c a l l y . Th i s a d a p t i v e a p p r o a c h p r o v i d e s
f o r a c c u r a t e u s e o n E CG s i g n a l s h a v i n g m a n y d i v e r s e s i g n a l c h a r -
a c t e r i s t i c s , QRS m o r p h o l o g i e s , a n d h e a r t r a t e c h a n g e s . I n e v a l u -
a t i o n s u s i n g t h e MI T/ BI H a r r h y t h m i a d a t a b a s e , t h e a l g o r i t h m
f a i l e d t o p r o p e r l y d e t e c t o n l y 0 .6 7 5 p e r c e n t o f t h e b e a t s .
RE F E RE NCE S
[ 1 ] N. V. Th a k o r , J. G. We b s t e r , a n d W. J. To m p k i n s , " De s i g n , i m -
p l e m e n t a t i o n , a n d e v a l u a t i o n o f a m i c r o c o m p u t e r - b a s e d p o r t a b l e
a r r h y t h m i a m o n i t o r ," Me d . Bi o l . E n g . Co m p u t ., v o l . 2 2 , p p . 1 5 1 -
1 5 9 , 1 9 8 4 .
[ 2 1 R. G. Ma r k , G. B. Mo o d y , W. H. Ol s o n , S. K. Pe t e r s o n , P. S.
Sc h u l t e r , a n d J. B. Wa l t e r s , Jr ., " Re a l - t i m e a m b u l a t o r y a r r h y t h -
m i a a n a l y s i s w i t h a m i c r o c o m p u t e r ," Co m p u t . Ca r d i o l ., p p . 5 7 -
6 2 , 1 9 7 9 .
[ 3 ] L. Pa t o m a k i , J. F o r s t i , V- M. No k s o - Ko i v i s t o , Y. Jo k i n e n , a n d E .
La n s i m i e s , " On l i n e r e c o r d i n g a n d a n a l y s i s o f t h e E CG i n a m b u l a -
t o r y p a t i e n t s ," Co m p u t . Ca r d i o l ., p p . 1 7 3 - 1 7 5 , 1 9 8 1 .
[ 4 ] 0 . Pa h l m a n d L. So r n m o , " So f t w a r e QRS d e t e c t i o n i n a m b u l a t o r y
m o n i t o r i n g - A r e v i e w ," Me d . Bi o l . E n g . Co m p u t ., v o l . 2 2 , p p .
2 8 9 - 2 9 7 , 1 9 8 4 .
[ 5 ] M. L. Ah l s t r o m a n d W. J. To m p k i n s , " Au t o m a t e d h i g h - s p e e d
a n a l y s i s o f Ho l t e r t a p e s w i t h m i c r o c o m p u t e r s ," I E E E Tr a n s .
Bi o m e d . E n g ., v o l . BME - 3 0 , p p . 6 5 1 - 6 5 7 , Oc t . 1 9 8 3 .
[ 6 1 M. Ny g a r d s a n d L. So r n m o , " A QRS d e l i n e a t i o n a l g o r i t h m w i t h
l o w s e n s i t i v i t y t o n o i s e a n d m o r p h o l o g y c h a n g e s ," Co m p u t .
Ca r d i o l ., p p . 3 4 7 - 3 5 0 , 1 9 8 1 .
[ 7 1 A. Li g t e n b e r g a n d M. Ku n t , " A r o b u s t - d i g i t a l QRS- d e t e c t i o n a l g o -
r i t h m f o r a r r h y t h m i a m o n i t o r i n g ," Co m p u t . Bi o m e d . Re s ., v o l .
1 6 , p p . 2 7 3 - 2 8 6 , 1 9 8 3 .
1 0 0
1 0 1
1 0 2
1 0 3
1 0 4
1 0 5
1 0 6
1 0 7
1 0 8
1 0 9
1 1 1
1 1 2
1 1 3
1 1 4
1 1 5
1 1 6
1 1 7
1 1 8
1 1 9
1 2 1
1 2 2
1 2 3
1 2 4
2 0 0
2 0 1
2 0 2
2 0 3
2 0 5
2 0 7
2 0 8
2 0 9
2 1 0
2 1 2
2 1 3
2 1 4
2 1 5
2 1 7
2 1 9
2 2 0
2 2 1
2 2 2
2 2 3
2 2 8
2 3 0
2 3 1
2 3 2
2 3 3
2 3 4
4 8 p a t i e n t s
2 3 5
Authorized licensed use limited to: Oxford University Libraries. Downloaded on November 20, 2009 at 07:45 from IEEE Xplore. Restrictions apply.
I E E E TRANSACTI ONS ON BI OME DI CAL E NGI NE E RI NG, VOL. BME - 3 2 , NO. 3 , MARCH 1 9 8 5
[ 8 ] " MI T/ BI H a r r h y t h m i a d a t a b a s e - Ta p e d i r e c t o r y a n d f o r m a t s p e c -
i f i c a t i o n ," Do c u m e n t BME C TR0 0 , Ma s s . I n s t . Te c h n o l ., Ca m -
b r i d g e , 1 9 8 0 . Da t a b a s e i s a v a i l a b l e f r o m Bi o e n g i n e e r i n g Di v i -
s i o n KB- 2 6 , Be t h - I s r a e l Ho s p i t a l , 3 3 0 Br o o k l i n e Av e n u e , Bo s t o n ,
MA 0 2 2 1 5 .
[ 9 ] " AHA d a t a b a s e ." Da t a b a s e i s a v a i l a b l e f r o m E m e r g e n c y Ca r e Re -
s e a r c h I n s t i t u t e , 5 2 0 0 Bu t l e r Pi k e , Pl y m o u t h Me e t i n g , PA 1 9 4 6 2 .
[ 1 0 ] H. G. Go o v a e r t s , H. H. Ro s , T. J. v a n d e n Ak k e r , a n d H. Sc h n e i d e r ,
" A d i g i t a l QRS d e t e c t o r b a s e d o n t h e p r i n c i p l e o f c o n t o u r l i m -
i t i n g ," I E E E Tr a n s . Bi o m e d . E n g ., v o l . BME - 2 3 , p . 1 5 4 , 1 9 7 6 .
[ 1 1 ]
N. V. Th a k o r , J. G. We b s t e r , a n d W. J. To m p k i n s , " Op t i m a l QRS
d e t e c t o r ," Me d . Bi o L E n g . Co m p u t ., v o l . 2 1 , p p . 3 4 3 - 3 5 0 , 1 9 8 3 .
[ 1 2 ] P. A. Ly n n , " On l i n e d i g i t a l f i l t e r f o r b i o l o g i c a l s i g n a l s : So m e f a s t
d e s i g n s f o r a s m a l l c o m p u t e r ," Me d . Bi o l . E n g . Co m p u t ., v o l . 1 5 ,
p p . 5 3 4 - 5 4 0 , 1 9 7 7 .
Ji a p u Pa n r e c e i v e d t h e M.D. d e g r e e i n 1 9 6 2 w i t h
a s p e c i a l t y i n b i o p h y s i c s i n m e d i c i n e f r o m t h e
Sh a n g h a i Se c o n d Me d i c a l Co l l e g e , Sh a n g h a i ,
Pe o p l e ' s Re p u b l i c o f Ch i n a .
Si n c e t h a t t i m e , h e h a s b e e n o n t h e F a c u l t y
o f t h e De p a r t m e n t o f Bi o p h y s i c s o f t h e Sh a n g h a i
Se c o n d Me d i c a l Co l l e g e . Hi s b a c k g r o u n d i n -
c l u d e s r e s e a r c h i n m e d i c a l a p p l i c a t i o n s o f l a s e r s ,
f l o w c y t o m e t r y f o r s i n g l e c e l l a n a l y s i s a n d
s o r t i n g , a r t i f i c i a l a r m c o n t r o l u s i n g e l e c t r o m y o -
g r a p h i c s i g n a l s , b o d y s u r f a c e m a p p i n g i n e l e c t r o -
c a r d i o g r a p h y , a n d m i c r o c o m p u t e r - b a s e d m e d i c a l i n s t r u m e n t a t i o n . Re -
c e n t l y h e s p e n t t w o y e a r s i n t h e Un i t e d St a t e s a s a v i s i t i n g s c h o l a r . Th e
f i r s t o f t h e s e w a s a t Ca s e We s t e r n Re s e r v e Un i v e r s i t y , Cl e v e l a n d , OH,
a n d t h e s e c o n d y e a r w a s a t t h e Un i v e r s i t y o f Wi s c o n s i n , Ma d i s o n , w h e r e
h e c o m p l e t e d t h e w o r k r e p o r t e d h e r e .
f
Wi l l i s J. To m p k i n s ( S' 6 1 - M' 6 6 - SM' 7 7 ) r e c e i v e d
_ t h e B.S. a n d M.S. d e g r e e s i n e l e c t r i c a l e n g i -
> n e e r m g f r o m t h e Un i v e r s i t y o f Ma i n e , Or o n o ,
| lm Wi n 1 9 6 3 a n d 1 9 6 5 , r e s p e c t i v e l y , a n d t h e Ph .D.
d e g r e e
i n b i o m e d i c a l e l e c t r o n i c
e n g i n e e r i n g
f r o m
* ; 0 i t h e Un i v e r s i t y o f Pe n n s y l v a n i a , Ph i l a d e l p h i a , i n
1 9 7 3 .
F r o m 1 9 6 5 t o 1 9 6 8 h e w a s a n E l e c t r i c a l E n g i -
n e e r a t Sa n d e r s As s o c i a t e s , I n c ., Na s h u a , NH,
w h e r e h e w o r k e d o n r e s e a r c h a n d
d e v e l o p m e n t
o f d a t a s t o r a g e s y s t e m s . He w a s e m p l o y e d f r o m
1 9 7 3 t o 1 9 7 4 a t t h e Ho s p i t a l o f t h e Un i v e r s i t y o f Pe n n s y l v a n i a a s a Bi o -
m e d i c a l E n g i n e e r . Si n c e 1 9 7 4 h e h a s b e e n o n t h e F a c u l t y o f t h e Un i -
v e r s i t y o f Wi s c o n s i n , Ma d i s o n , w h e r e h i s t e a c h i n g s p e c i a l t y i s o n t h e
t o p i c o f c o m p u t e r s i n m e d i c i n e , a n a r e a i n w h i c h h e h a s d e v e l o p e d t w o
n e w c o u r s e s . Hi s r e s e a r c h i n t e r e s t s i n c l u d e o n - l i n e b i o m e d i c a l c o m p u t i n g
a p p l i c a t i o n s . He i s c o - e d i t o r , w i t h J. G. We b s t e r , o f t h e t e x t b o o k De s i g n
o f Mi c r o c o m p u t e r - Ba s e d Me d i c a l I n s t r u m e n t a t i o n ( E n g l e w o o d Cl i f f s ,
NJ: Pr e n t i c e - Ha l l , 1 9 8 1 ) a n d c o - e d i t o r , w i t h J. G. We b s t e r , A. M. Co o k ,
a n d G. C. Va n d e r h e i d e n , o f t h e t e x t b o o k E l e c t r o n i c De v i c e s f o r Re -
h a b i l i t a t i o n ( Ne w Yo r k : Wi l e y , 1 9 8 4 ) .
Dr . To m p k i n s i s a m e m b e r o f t h e I E E E E n g i n e e r i n g i n Me d i c i n e a n d
Bi o l o g y So c i e t y ( c u r r e n t l y Re g i o n I V Ad m i n i s t r a t i v e Co m m i t t e e Re p -
r e s e n t a t i v e a n d Vi c e Pr e s i d e n t f o r Te c h n i c a l Ac t i v i t i e s ) , t h e I E E E Co m -
p u t e r So c i e t y , t h e As s o c i a t i o n f o r t h e Ad v a n c e m e n t o f Me d i c a l I n s t r u -
m e n t a t i o n , a n d t h e Bi o m e d i c a l E n g i n e e r i n g So c i e t y . He i s a Re g i s t e r e d
Pr o f e s s i o n a l E n g i n e e r i n t h e St a t e o f Wi s c o n s i n .
2 3 6
Authorized licensed use limited to: Oxford University Libraries. Downloaded on November 20, 2009 at 07:45 from IEEE Xplore. Restrictions apply.

You might also like