Int ern at i onal  Journ al of Ele ctrical  an d  Co mput er  En gin eeri ng   (IJ E C E)   Vo l.   10 ,  No.   4 ,  A ugus t   2020 ,   pp.  4023 ~ 40 34   IS S N: 20 88 - 8708 ,  DOI: 10 .11 591/ ijece . v10 i 4 . pp 4023 - 40 34          4023       Journ al h om e page :  http: // ij ece.i aesc or e.c om/i nd ex .ph p/IJ ECE   Meth odology f or  detecti on   of  p aroxysm al at rial fib rillati on  based on   P - W ave, HRV  an d QR  electri ca l  alte rnan s featu res       Henry  Cas tro 1 , Ju an D avid  Ga rci a - Ra ci n es 2 ,  Al va r o  Be rnal - N oreñ a 3   1 Facul t y   of   Eng i nee ring ,   Univ ers ida d  San ti ago   de   Cali,   Colom bia   1, 2 ,3 El ec tr ic a l an d  Elec tron ic E ng ine er ing  School ,   Univer sidad  d el  Vall e ,   Colom bi a       Art ic le  In f o     ABSTR A CT    Art ic le  history:   Re cei ved   Oct  24 , 201 9   Re vised Feb  19 ,   2020   Accepte d  Fe b 25 , 202 0       The   detec t ion  of  par ox y sm al   atrial   fibr il l at ion  (PA F)  is   a  fai rl y   com plex   proc ess  per form ed  m anua lly   b y   c ard iol og ists  or  el ec troph y s iol ogists  b y   rea ding  an  e le c t roc ard iogr am  (E CG).  Curre ntly ,   computat ion al   te chn ique s  for  aut om atic  d e te c ti on  b ase d  on   fast  fouri er  tra n sform   (FF T),   B ay es  op ti m al  cl assifi er  (BOC),  K - nea rest  nei g hbors  (K - N Ns ),   and  art ifici al   ne ura l  net work   (AN N)  have   been  proposed.   In  t his  stud y ,   six  fe at ure s  wer e  obt a ine d  base d   on  the   m orpholog y   of  th e  P - W ave ,   the   QRS   c om ple x  and  the  hea rt  r ate   var ia b il i t y   (HR V)  of  the   ECG.   The   p erf orm an ce   of   thi s  m et h odolog y   wa s  val id at ed  using  cl inica l  ECG  signal s  from   the   Ph y sione t  arr h y th m ia   dat aba s e   MIT - BIH.   A  fee dforward  neur a l  net work  was  used  to  det ec t  t he  pre senc e     of  PAF  rea chi ng   a  gene ral   a cc ur a c y   of  97. 4% .   Th e  result s  obta ined  show  tha t  the   in cl usion  of   the   informa ti o n  of  the   P - W av e,   HRV   and  Q R  El e ct ri cal  al t ern ans  inc r ea s es  the   a cc ura c y   t o  ide nti f y   the   P AF   eve nt  compa red   to  other  works   tha t  us e  th e  informat ion  of   onl y   one   or at   m ost t wo of   the m .     Ke yw or d s :   Ar ti fici al  n e ur a l netw ork   Digital  sig nal  processi ng   Ele ct ro ca r diog ram   Feat ur es  ex t rac ti on   HRV   Me thodo l og y  f or d et ect io n   Par ox ysm al  atria l fibr il la ti on   P - Wav e   QR elec tric al  a lt ern ans   Copyright   ©   202 0   Instit ut e  o f Ad vanc ed   Engi n ee r ing  and  S cienc e .    Al l   rights re serv ed .   Corres pond in g  Aut h or :   Henry Ca str o ,   Faculty   of E ngineerin g, Bi oe ng i neer i ng ,   Un i ver si dad Sa ntiago de  Cal i ,   Ca ll e 5  # 62 - 00 Cal i, Col om bia .   Em a il :  hecastro 1@ gm ail.co m       1.   INTROD U CTION     Atrial   Fib rill ation   (AF)  is  t he   m os t  cl inica l l y  diag no se d  ca rd ia c  a rrhyt hmi a,  both  in   out patie nts  a nd   ho s pital iz ed  pa ti ents.  Its  pr evalence  a nd  incidenc e  incr ease  with  a ge   reachi ng   e pi dem ic   char act erist ic s     in  seni or   ci ti zens.  T he  i nd i cat or s  of   pro gr ess   of  pa r oxysm al   a tria l  fibr il la ti on   (PAF)  to  a  persi ste nt     or   per m anen t  on e  hav e  not  been   fu ll y  identifie d,   the refo re,  de te ct in g  a n  AF   in  it s  ea rly   fo rm   is  i mp ort ant     to avoid  the  r is ks   of a str oke,  hear t  fail ur e  and /  or m or ta li ty   [ 1] .   The  process   of  detect in g  a n  AF  is  pe rfo r m ed  m anu al ly  by  a  ca rd i ologist   or  el ect r ophysi ologist     by  inter pr et in g  the  el ect r oc ard i ogram   (ECG)   r eco r ds .  This  process  is  highly   dem and i ng  due  to   bot h    the  num ber   of  records   t o  be   analy zed  an d  the  fact  that  so m et i m es  i t  i s  necessa ry  to  exam ine  each  beat   ind ivi du al ly   to   ens ur e   the  c orrect  ide ntific at ion   of  the  card ia c  path ol og y.   Th us,  a n  autom at ed  m et ho d    for  cl assifi cat ion an d detec ti on  would i m pr ove the  d ia gnos t ic  an d p re ven ti on of a n AF   [2 - 5] .   To  date,  dif fere nt  auth ors  ha ve  pro pose d  m et hods   that  aut om at e  the  detect ion   of  P AF .  So m e  autho r s   hav e  reac hed   a   detect ion   acc uracy   betwee n  70%  an d  92 %  [6 - 9]  us in g  the   char act e risti cs  of   t he  P  wav e   [10] ,  oth e rs  pro pose   the  us e  of   hea rt  rate  var ia bili ty   ob ta ining   a n  accuracy  betw een  81. 2%  an d  94 . 7%   [ 7,   11 - 18] ,  finall y,  [9 ]   pro po s es  the  us e  of   QR  el ect rical   al te rn at ion   r eachin g  an  ac cur acy   of  70% .  Accord i ng   to   this ,    the proble m  o f  appr opriat el y detec ti ng  a  FAP is n ot f ully  s olv e d  ye t, due  to r es ults achie ved   by these m et hods   are  not  def init ive  an d  ca n  st il l  be  i m pr ove d.   S o,  in  this  pap e r  a  ne w  m et ho dolo gy  is  pro posed  t o  address     Evaluation Warning : The document was created with Spire.PDF for Python.
                         IS S N :   2088 - 8708   In t J  Elec  &  C om p  En g,   V ol.  10 , No .  4 ,  A ugus t  2020  :   4023   -   4034   4024   this  pro blem   integrati ng  m ultiv ariat e  sta ti sti cs  [ 19 ]   on  t he  c har act erist ic s  of  the   P   wa ve,  he art  rate  va riab il ity  and Q R  elec tric al  alt ern at ion.  Th e  accu racy  ob ta ine d usi ng  this ne w  m et hod was  97.4%.   A  P AF   is  c ha r act erized  by  irr egu la r  m ov em ent  of  the   le ft  a trium   that  pr ev ents  the  pro per  bl oo d  fl ow   into  the   ci rc ulatory  syst em   and   al so  by  a  re duct ion  of  the   ti m e  that  the  ve ntricl es  val ves  hav e   to  receiv e  an d  sen d  blood   to   the  lun gs.  I n  an  ECG  signa l,  these  two  char act e risti cs  hav e  an  im pact  in  the  m or phol og y     of   t he  P - W a ve   an d  in  t he   distance   bet w een   the  P - Wav e   an d  t he   R - W a ve   s ee   Fig ur e  1 ,   t her e fore,     it   is  i m po rtant  to  l ocate  the  c har act erist ic   points   P - O ns et ,  P - O ffset ,  P  W i dth   a nd   P  Hei ght,  as  well   as  the  P R   segm ent,  hear t   rate va riabil it y  (H R V)  a nd  QR  elec tric al  alt ern at ion t o f ully  d escri b e a  PAF .       7.3 7.35 7.4 7.45 7.5 7.55 7.6 7.65 T i m e  ( s ) - 0.1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 A m p l i t u d e  ( m V ) P - O n s e t P - O f f s e t P   Wi d t h P   H e i g h t Q R   E l e c t r i c a l   a l t e r n a n s P R  S e gm e n t R Q S     Figure   1 .   Cha r act erist ic  o f  a n EC G  si gn al       Diff e re nt  auth or s  reli ed  on  on e  or   t wo   c har act erist ic s  f or   the  detect ion   of   P AF   as   il lustrate d    in   Ta ble  1 .   In  this  pa per,  unli ke   ot he r  works  re po rted  i n  the   l i te ratur e,   i t  is  pro pose d  t o  us e   the  inf or m at ion   of  the  three  char act e risti cs  to  cover  al l  the  sy m pto m s  of   the  PAF  an d  extract  six  rel evan t  featur e s  to   im pro ve  the   dete ct ion   rates.  Se ns it ivit y,  sp eci fici ty   and   acc ur acy   wer e   us ed  as   pe rfor m ance  m et rics  fo r   the   evaluati on  of  t he  m et ho dolo gy   pro po se d  he r e.  Ta ble  1   li sts  so m e  works  t hat  ad dress  t he   sam e  them e and   the   char act e risti cs u se d.       Table   1 .  C har a ct erist ic s u se d for the  d et ect io n of PA F   Ref erence   P - W av e   HRV   QR Elect rical  alter n an s   [ 1 1 ]   ✗   ✓   ✗   [ 6 ]   ✓   ✗   ✗   [ 7 ]   ✓   ✓   ✗   [ 8 ]   ✓   ✗   ✗   [ 9 ]   ✓   ✗   ✓   [ 1 2 ]   ✗   ✓   ✗   [ 1 6 ]   ✗   ✓   ✗   [ 1 5 ]   ✗   ✓   ✗   [ 1 4 ]   ✗   ✓   ✗   [ 1 3 ]   ✗   ✓   ✗   [ 1 7 ]   ✗   ✓   ✗   [ 1 8 ]   ✗   ✓   ✗   Prop o sed   m e th o d   ✓   ✓   ✓       2.   RESEA R CH MET HO D   In   the  propose d  m e tho dolo gy ,  a  pr evi ou sl y  dig it iz ed  ECG  signa l  is  received  as  in put.  The  sign a l     is  pr oce ssed  i n  f our  m ai n  sta ges  (Prep r oc essing,  cha ra ct erist ic   po int s  extracti on,  featur e s  extra ct ion ,  detect i on)  a nd  it  is d et erm ined wh et her o r n ot a PAF  ex ist s , as  il lustrate d  i n  Fi gure .   Evaluation Warning : The document was created with Spire.PDF for Python.
In t J  Elec  &  C om p  En g     IS S N: 20 88 - 8708       Met hodolo gy  f or   detect ion of  Paroxys ma l At rial Fi br il lati on B as e d o n P - Wave,  H R V… ( Hen r y Castr o )   4025   P R EP R O C ES S I N G R e s a m p l e Mo v i n g   a v e r a g e F i l t e r i n g D E T E C T I O N A N N I N P U T  S I G N A L           E C G R E S U L T S CH A R A CT E RIS T IC  P O IN T S   D E T E CT IO N R - W a v e   p e a k P - W a v e   p e a k Q - W a v e   p e a k S - W a v e   p e a k P - O n s e t P - O f f s e t Q - O n s e t F E A T U RE S   E X T R A CT IO N Q R  E l e c t r i c a l   a l t e r na ns H R V P - Wa v e   a r e a P R   s e g m e n t P - W a v e   w i d t h P - W a v e   h e i g h t   Figure   2 .  B loc k diag ram  o f  pro posed  m et ho d       2.1.   Prepr oce ssing   The  first  pa rt  of  the  al gorithm   is  pr ep ar ed  to   receive  as  input  the  le ad  II   of  a  sta nd a rd   12 - le ad  EC G   sign al .  D ue  to   the  var ia ble  natu re  of   the  sam pling   fr eq uen cy   of  the  ECG  sign al ,  an  1170 Hz  res a m plin g    is  per f or m ed  to  ens ur e  a  sta nd a r d  fr e quen cy   fo r  the  s ubseq uen t  ap plica ti on   of  a  low - pass  fi nite  i m pu ls e   respo ns e  dig it al   filt er  (F IR )  a nd   t o  al lo w  ea ch  of   t he  cha ra ct erist ic   po ints   of   t he  sig nal  t o  be   est ablishe d  m or e   pr eci sel y.   T his  sta ge  c om pr ise s thr ee  steps: R esam pling , m ov in g  a ver a ge  a nd f il te rin g.     2.1.1 .   Res ampl ing   The  pro po se d  m et ho dolo g y  use s  six  featu re s  f or   t he  rec og niti on   of  at rial   fib rill at ion   th at   are  ba se d  o n  t he  m or phol og y  of  the  si gnal .  T her e fore   it   is  ver y  i m po rta nt  to  prese rv e  t he  f reque ncy  co ntent  as   well     as  the  sh ape  of   the  sig nal  durin g  proce ss ing .  F or   this  reason,  it   is  re qu i red   to  be   rep re sent  eac h  beat    by a s uffici ent  nu m ber   of poi nts that e nsure   a good  detect io n  a nd a  good  f eat ur e e xtracti on.   The  hei gh t  an d  widt h  of   the   P - W a ve  are  f eat ur es  that  ne ed  a  good  m or phologica l  representat io n,   thu s ,  in  t his  pap e r  we  c onsidere d  us in g  a  resam ple  frequ e ncy  to   en su re   that  the   P - Wav e  has   a t  le ast    50  sam ples.Con si der i ng  tha t  there  a re  docum ented  case s  of  patie nts  with  P AF  at   the  age   of  22   [20] ,    the  m axi m u m   hear t  rate  (     )  c on si der e d  i n  this  m et ho do l ogy  was  cal c ula te d  us i ng   t he  pro po se d   ( 1 ).  The res ult o btained was  16 8 b eat s p er  m inu te  ( BPM ) .         = ( 220 −  ) ∗ 85%   (1)     Subseque ntly , i t was fo und  t ha t t he  du rati on  of the  P - Wav e   is 4 3  m s u sin g        on   (2 ).        = 60      ∗ 12%   (2)     Finall y,  a  resa m pl ing   f re qu e ncy  (  )  of  ap pro xim a te ly   11 70  Hz  wa s  obta in ed  th rou gh   (3 )  by  relat ing   t he  50  sam ples that rep rese nt the  P - Wav e  w it h i ts  durati on.      = 50          (3)     2.1.2.  M ov in g av er age   ECG  sig nals  norm al ly   hav e  a   baseli ne  wa nder  that  m us t  be   correct ed   to  re fer e nce  the   vol ta ge  le vels  of   th e  sig nal  to   a  zero  D C  le ve l.  The  m ov in g  aver a ge  giv e n  in   (4 )  is  com m on ly   use d  t o  do  this  w hic h  re qu i res   sp eci fyi ng  a   w indow  siz e   ( ).  This  pa per  pro po s es  t o  obta in   M  base d  on  t he  m os t  c ommon  hear t   rate   va lue  pr ese nt  in   the  sign al .  To   fin d  this  val ue,   we   obta in  the   f re qu e ncy  with  th e  highest  e nergy  val ue  in  t he   powe r   sp ect ral  den sit y   of   the  sig nal  bounde d  betwe en  60  bpm   and   200  bp m .  The refor e ,  M  is  de fine d  as  the  i nvers e   of   t he  f reque nc y  with  the  hi gh e st  energy  value  rou nd e d  to  the  nea rest   even   value .  This  is  sho wn  in   (5 ).    Said  f reque nc y  was  obta ine d  ap plyi ng   t he   fast  Four ie r   transfo rm   (F FT)  to  t he  sign al   a uto c orre la ti on     giv e n  in   ( 6) .     ̂ ( ) = 1 ∑ ( + ) 2 = − 2   (4)     Evaluation Warning : The document was created with Spire.PDF for Python.
                         IS S N :   2088 - 8708   In t J  Elec  &  C om p  En g,   V ol.  10 , No .  4 ,  A ugus t  2020  :   4023   -   4034   4026   = 1 a rg max   |  (  ( ℓ ) ) |              ∗ 60    60   < <  ∗ 200    60     (5)      ( ℓ ) = ∑ ( ) ( − ℓ ) − 1 = 0   (6)     2.1.3.  Fil terin g   An  ECG   sig na l  is  re pr ese nte d  by   (7) ,   w here,  ( )   is  the   sig na l  ge ner at e d  by  car diac  act ivit y  wit h    a  fr e quency  ra ng e  of  2.5   Hz  and   45  Hz   [ 21] ,  r  (n)  is  el ect ri cal   no ise   a nd  wh it e  no ise   wi th  freq ue ncies  gr eat er  than 4 5 Hz a nd b   ( n)  is  b asel i ne no ise  w it h f reque ncies le ss  than 2 .5 Hz   [ 22] .     ( ) = ( ) + ( ) + ( )   (7)     No ise   ( )   was   al r eady  rem ov ed   us in g  m ov ing  aver a ge   in   the   la st  ste p.  I n  th is  ste p,  a   lo w - pass   filt er  with     a cutoff  freq ue ncy of  45  Hz w as  desig ne d  t o rem ov e the  noise   ( ) .   The pre proces s ing   sta ge  is  sum m arized in  A lgor it hm  1 .     Algorithm 1. Preprocessing.   Begin  Load  Signal, Fs   Initialize  S_res, S_norm, S_ac, Sf, M, Sm, S_filter   S_res       Resample ( Signal,  1170)   S_norm       Normalize  ( S_res,  - 1,1)   S_ac       Autocorrel ation ( S_norm )   Sf       FFT ( S_ac )   M       arg max f   (  | Sf|  ) s.t.  60 bpm < f  < 200 bpm   Sm       MovingAver age ( S_res ,  M )   S_filter      lowpass( Sm , 45 Hz)   End     2.2.   C ha r ac te ri stic po in t de tection   In   t he  sec ond  sta ge  of  t he  m et hodo l og y  t he   pea ks   P ,  Q ,  R ,  S,  P - O ns et ,  P - O ff set   a nd  Q - On set   we re   fou nd   on  eac h  beat  of   t he  ECG  sig na l .  These  points,  sh ow n  in   Fig ur e  3 ,   will   la te r  be   use d  to   extrac t     the f eat ur es  of  the b eat .       7.3 7.35 7.4 7.45 7.5 7.55 7.6 7.65 T i m e  ( s ) - 0.1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 A m p l i t u d e  ( m V ) P - O n s e t P - O f f s e t Q - O n s e t P - Wa v e   p e a k Q - Wa v e   p e a k S - Wa v e   p e a k R - Wa v e   p e a k     Figure   3 .  Cha r act erist ic  p oi nts of a n  EC G  si gn al       2.2.1   R - W av e  peak   In   this  ste p,   a   m ov ing   wi ndow   f our  tim es  the  siz e  M   fo un d  in  sect ion   2.1.2   was  use d  to  fin d    the  R - Wav e  pe ak.   T he  wind ow   m ov es   thr oughout  the  E CG  sig nal  fi ndin g  peak s   th at   exceed   0.6   tim es     the  m axi m u m   a m plit ud e  in  the  wind ow   an d  ha ve  a  separ at ion   bet wee n  the m   of   at   least  35 3  m s,  that  is,     the h ea rt ra te  does  not ex cee d t he  m axi m u m   value  c hose n  i n  this  m et ho dolog y  of 17 0 bpm .   Evaluation Warning : The document was created with Spire.PDF for Python.
In t J  Elec  &  C om p  En g     IS S N: 20 88 - 8708       Met hodolo gy  f or   detect ion of  Paroxys ma l At rial Fi br il lati on B as e d o n P - Wave,  H R V… ( Hen r y Castr o )   4027   2.2.2.  P - W ave  peak   The  P - Wav e   pe ak  was  fou nd  base d  on  the   locat io n  of   t wo  co ns ec utiv e  R - W a ve  pea ks .  As   se e n    in   Figure  4 ,  The  P - Wa ve  pe ak  is  the  m axim u m   value  found  withi n  a  de fine d  searc h  area  betwee n  70%  an d  90%  of  t he dist ance  betwee n  t wo consec utiv e R - W a ve pea ks .       7 0 % 2 . 2 2 . 4 2 . 6 2 . 8 3 3 . 2 3 . 4 3 . 6 3 . 8 T i m e   ( s) - 0 . 2 0 0 . 2 0 . 4 0 . 6 0 . 8 A m p l i t u d e   ( m V ) R - W a v e   p e a k R - W a v e   p e a k P - W a ve   pe a k s e a rc h  a re a P - W a v e   p e a k                                                       R R   ( 1 0 0 % ) 10%     Figure   4 .  P - Wa ve peak  searc h area       2.2.3.  Q - Wave  peak   The  Q - Wav e   peak   is  c ha racteri zed  by   a  neg at ive  peak   l ocated  j ust   befo re  th e  app ea ra nce     of   t he  R - Wave,  f or   this  rea so n,  a  de rivati ve  was  us e d  as  a  searc h  m et hod  f or   t his   peak.  Acc ord ing   to   the  pro po s ed   ( 8) ,  the  valu e  of  the  de rivati ve   is  cal culat ed  on   eac h  sam ple  on e  at   a  tim e   befor e  the  R - Wav e .     This  process  i s  done   unti l  a  der i vative  with  a  negat i ve  va lue  is  f ound  as  seen  i n   Fi gure  5 .   I n  this  pape r     we  pro pose  a  distance  of  ei gh t  sam ples  t o  be  use d  in  order   to  a void   s m al l   var ia ti on s  t hat  cou l d  hav e     a n e gative  der i vative in  the  p a th.      ( )  = ( + 4 ) − ( − 4 ) 8   (8)       0 . 1 9 0 . 2 0 . 2 1 0 . 2 2 0 . 2 3 0 . 2 4 0 . 2 5 0 . 2 6 T i m e   ( s ) - 0 . 1 0 0 . 1 0 . 2 0 . 3 0 . 4 0 . 5 0 . 6 0 . 7 A m p l i t u d e   ( m V ) R - W a ve   pe a k Q - W a ve   pe a k     Figure   5 .   Q - Wav e  peak.  r ed  dots re present l oc at ion s  w he re t he deri vative  was  e valuate d       2.2.4.  S - Wave  peak   The  i den ti ficat ion   of  the  S - Wav e   pea k  wa s  carrie d  out  f ollow i ng  a  pro cedure   sim il ar   to  that  us e d  with  the  P - Wa ve  pea k.   T his  tim e,  the  m ini m um   value  was  so ug ht  within a  def ine d  area b et wee n  0%  a nd  10%   of the  distance   betwee n  tw o  c on s ecuti ve  R pe aks  as  is s how n  in   Fig ure  6 .   Evaluation Warning : The document was created with Spire.PDF for Python.
                         IS S N :   2088 - 8708   In t J  Elec  &  C om p  En g,   V ol.  10 , No .  4 ,  A ugus t  2020  :   4023   -   4034   4028   2 . 2 2 . 4 2 . 6 2 . 8 3 3 . 2 3 . 4 3 . 6 3 . 8 T i m e   ( s) - 0 . 2 0 0 . 2 0 . 4 0 . 6 0 . 8 A m p l i t u d e   ( m V ) R - W a v e   p e a k R - W a v e   p e a k S - W a v e   p e a k se a r c h   a r e a S - W a v e   p e a k R R   ( 1 0 0 % ) 1 0 %     Figure   6 .  S - Wa ve peak  searc h   area       2.2.5.  P - O nset   The   P - On set   point i s  def in ed a s the sam ple w he re th e  P - W ave starts a nd i deall y has a  va lue of  0  m V.   This  po i nt  wa s  f ound  by  e va luati ng   eac h  on e   of  the   sa m ples  pr ior  t o  the  P - W a ve  peak  one  by  one  un ti l     the  c onditi on  set   in   the   pro pos ed   (9 )   was  m et .  Thi s  eq uatio n  c onside rs  t he  fa ct   that,  in   pract ic e,    the  P - O ns et   ha s  a  posit ive  value  higher   than  t he  baseli ne,   t her e fore,  a  value  of  0.1 5  ti m es  the  a m pl it ude     of the  P  peak  was use d  to  f i nd it .     1 5 ∑ ( + ) 2 = − 2 < 0 . 15    ( 9)     2.2.6.  P - O ffset   This  c har act er ist ic   po int  is  def i ned   a s  the   sam ple  wh er e  the  P - W a ve   en ds .  T o  fin d  this  point ,     we  procee ded  in  a  sim il ar  way  to  the   m et h od  use d  to  fin d  the   P - O ns et   with  the   diff e r ence  th at   the  s a m ples  evaluate d  are  locate d  a fter  th e P - W a ve peak .     2.2.7.  Q - Onse t   Q - Onset   is  the  sam ple  wh ere  t he  Q - Wa ve  be gin s .  T o  fi nd  this  ch aracte rist ic   po i nt,  a  sim i la r  m et ho d  us e d  in  sect ion  2. 2.3  was  co nsi der e d.   Eac h  of   the  sam ples  befor e  the  Q - Wav e  pea k  is  cal culat ed  one  by  on e   on  the  der i vative  descr i b ed   by   the  pro pose d   (10 )  unti l  a  posit ive  va lue  i s  f ound.  In  thi s  case,  a  sensi ti vity  gr eat er  t ha n  th at   required   t o  fin d  the  Q - Wa ve  pea k  is  re quire d,   th us   the   distance  was  reduce  f r om   eig ht  to   four sam ples.      ( )  = ( + 2 ) − ( − 2 ) 4   (10)     The  c har a ct eris ti c p oin t  detect ion   sta ge  is  sum m arized in  A lgorit hm  2 .     Algorithm 2. Characteristic point detection.   Begin  Load  S_filter, M   Initialize   limMin, limMax, tempWin, Vmax, Rpeaks   //Find R - Wave peaks   For  i     0.. l en gt h( S_filter ), + M     limMin     ma x ( i - 2* M )     limMax     mi n ( i +2* M )   tempWin     S_ fi lt er [ limMin..limMax ]     Vmax     max( t em pW in )     While  True     Find the amplitude and location of the HighestPeak in  tempWin   If  HighestPeak. amplitude   < 0.6* Vmax     Break   Else If  Distance be tween HighestPeak .location   and any peak in  Rpeaks.location   < 353ms     Break   Evaluation Warning : The document was created with Spire.PDF for Python.
In t J  Elec  &  C om p  En g     IS S N: 20 88 - 8708       Met hodolo gy  f or   detect ion of  Paroxys ma l At rial Fi br il lati on B as e d o n P - Wave,  H R V… ( Hen r y Castr o )   4029   Else     Insert HighestPeak in  Rpeaks     Delete HighestPeak from  tempWin   End If     End While   End For   //Find P - Wave peaks   Initialize  Peak1, Peak2, RR, Peak, Ppeaks   For  each two consecutive p eaks in  Rpeaks     Peak1     Fi rs t  pe ak     Peak2    Se co nd  p ea k     RR    Pe ak 2. l oc at io n  –   Peak1.location     Peak    max(  S_filter [ Peak1+ 0.7* RR .. Peak1 +0.9* RR ])     Insert  Peak   in  Ppeaks   End For   // Find Q - Wave peaks   Initialize  dQ, j, Qpeaks  //dQ means the derivative at Q   Fo r  each Peak in  Rpeaks     dQ    1     j     0     While  dQ   > 0       j     j +1       dQ     ( S_ fi lt er [Peak .location   –   j +4]  –   S_filter [Peak .location   –   j   –   4])/8     End While     Insert  S_filter [Peak .location   –   j ] in  Qpeaks   End For   // Find S - Wave peaks   Initialize  Peak1, Peak2, RR, Peak,   Speaks   For  each two consecutive peaks in  Rpeaks     Peak1     Fi rs t  pe ak     Peak2    Se co nd  p ea k     RR    Pe ak 2. l oc at io n  –   Peak1.location     Peak    min(  S_filter [ Peak1 .. Peak1 +0.1* RR ])     Insert  Peak   in  Speaks   End For   // Find POnset   Initialize  j, temp, POnset   For   each Pe ak in  Ppeaks     temp     Peak . lo ca ti on     While  temp   >= 0.15*Peak. amplitude       j     j   + 1       temp     me an (   S_filter [Peak .location   - j - 2.. Peak .location   - j +2]     End While     Insert  S_filter [Peak  –   j ] in  POnset   End For   // Find POffset   Initialize  j, temp, POffset   For   each  Peak in  Ppeaks     temp     Peak . lo ca ti on     While  temp   >= 0.15*Peak .location       j     j   + 1       temp     me an (   S_filter [Peak .location   + j - 2.. Peak .location   + j +2])     End While     Insert  S_filter [Peak +  j ] in  POffset     End For   // Find QOnset   Initialize  dQ, j, QOnset   For  each  Peak in  Qpeaks     dQ    1     j     0     While  dQ   < 0       j     j +1       dQ     ( S_ fi lt er [Peak .location   –   j +2]  –   S_filter [Peak .location   –   j   –   2])/4     End While     Insert  S_filter [Peak .location   –   j ] in  QOnset   End For   End     2.3.   Fe at ure s  ext r act i on   On ce  the  ch ar act erist ic   po ints  hav e  bee n  id entifi ed,   the  si x  featu res  pr e s ented  on  the  thir d  sta ge  of  the  m et ho do l ogy  des cribe d  i n  Fi gu re   2  a re  extracte d  f or  e ach  beat  of  t he   ECG  si gnal .   T he  first  th ree  f eat ur es  P - Wav e  hei ght,  P - Wav e   wi dth   a nd  PR   se gm ent  are  the   m agn it ud es  of  the  P - Wa ve  peak,  the   dif f eren ce   betwee n  P - Off set   an d  P - On s et ,  an d  t he  diff e ren ce   bet w een  Q - O ns et   and  P - O ff set   resp ect ively .   As  for   Evaluation Warning : The document was created with Spire.PDF for Python.
                         IS S N :   2088 - 8708   In t J  Elec  &  C om p  En g,   V ol.  10 , No .  4 ,  A ugus t  2020  :   4023   -   4034   4030   the  f ourt h  fe at ur e   P - Wa ve  A rea,  it   is  de fin ed  as   the   area   unde r  t he  c urve  betwee n  P - On set   an d  P - Offset .   Con si der i ng   t ha t  the  ECG  sig nal  is  discrete,   a  trapez oid al   nu m erical   integrati on  is  use d  as  an  a pproxi m at ion   to the i nteg ral  of the si gn al   be tween t hese t w o po i nts.  T he   ( 11)   desc ribes  t his c onditi on.     ∫ ( )        ≈ 1 2 ∑ ( ) + ( + 1 )  =   (11)     The  fifth   featu re  cal le d  Hear t   Ra te   Var ia bili ty   (H RV )  is  t he   num ber   of  be at s  per  m inu te   (bpm )  that  would  be  gen e rated  acc ordin g  to  the  distan c e  betwee n  tw o  co ns ec utive  R - W a ve  pea ks.  The  (12 )   des crib e s     this p ro ce ss.     ℎ ( ) = 60 ( ) − ( + 1 ) ∗    (12)     In   (12) ,    is  the  beat  num ber .   ( )   is  the  locat ion  of   the  R - W a ve   peak.     is  the  resam pling   fr e qu e ncy,  1170   Hz  in  this   case.   The  six th  and   la st  fe at ur e  cal le d  Q R  el e ct rical   a l te rn a ns   is  def i ned   a s   the  dif fer e nce  betwee n  the  a m pl it ud e  of  th e  R - W a ve  pea k  an d  t he  Q - Wav e   pea k.   T he  feat ur es  e xt racti on  sta ge  is s umm a rized i n Alg or i thm  3 .     Algorithm 3. Features extraction.   Begin  Load  S_filter, Rpeaks, Ppeaks, Qpeaks, Speaks, POnset, POffset, QOnset   Initialize  PWaveHeight, PWaveWidth, PRsegment, PWaveArea, HRV, QRelectricalAlternans   For  i     0. .l en gt h( Ppeaks ), +1   PWaveHeight [ i ]    Ppeaks [ i] .amplitude   PWaveWidth [ i ]     POffset [ i ] .location   –   POnset [ i ] .location   PRsegment     QOnset [ i ] .location   –   POffset [ i ] .location   For  j    PO ns et [ i ].. POffset [ i ]   PWaveArea     ( S_filter [ j ] +  S_filter [ j +1]) / 1170     End For     HRV     ro un d(  6 0/ ( Rpeaks [ i +1] .location   –   Rpeaks [ i ] .location ) )     QRelectricalAlternans    Rpeaks [ i ] .amplitude   –   Qpeaks [ i ] .amplitude   End For   End     2.4.   De tecti on   Detect ion   is  the  final  sta ge  of   the  pro pose d  m et ho do l ogy.  To  dete rm i ne  the  pr ese nc e  of   a  P AF    in  the  ECG ,  a  feedfo rw a r d  neural  netw ork  with  tw o  hidden  la ye rs   each  with  10  ne uro ns   wa s  us e d    as  a  cl assifi er   [ 23] .  T his  ne ur al   netw ork,   whose  trai ning   was  ca rr ie d  ou t  us in g  60%  of  t he  in f orm ation     in the dat a base   show n  i n   Ta bl e 2 ,  to  i den ti fy  the prese nce  or not o f  a  P AF  i n  eac h beat  of  t he  EC G.         Table   2 . Fea tu r es  of the  af db a nd n s r db d at a ba ses   Beat   P - W av e heig h t   P - W av e width   PR s eg m en t   P - W av e ar e a   HRV   QR elect rical  alter n an s   1   0 .20 7 1   0 .08 1 0   0 .06 1 0   8 .67 1 3   100   3 .92 3 9   2   0 .20 2 7   0 .15 0 0   0 .05 2 0   1 1 .89 3 6   99   3 .79 8 1   3   0 .21 1 5   0 .08 4 0   0 .06 7 0   9 .32 8 4   99   3 .84 1 1   4   0 .19 5 3   0 .08 7 0   0 .05 2 0   9 .16 8 5   97   3 .62 8 0   5   0 .22 5 8   0 .09 2 0   0 .04 9 0   9 .84 7 8   98   3 .65 2 0   6   0 .23 9 3   0 .16 0 0   0 .04 9 0   1 3 .60 7 1   97   3 .68 5 3   7   0 .21 2 9   0 .10 5 0   0 .05 2 0   9 .79 5 5   100   3 .68 6 5   8   0 .21 1 3   0 .15 2 0   0 .04 4 0   1 2 .69 4 1   99   3 .74 8 8   9   0 .20 3 1   0 .10 7 0   0 .04 6 0   8 .87 2 1   98   3 .70 7 4   10   0 .23 2 6   0 .16 2 0   0 .04 9 0   1 4 .56 7 3   97   3 .67 1 7   ···   ···   ···   ···   ···   ···   ···   9 9 0 0 0   0 .32 0 2   0 .22 4 0   3 .98 0 0   3 5 .70 1 9   3   1 .13 4 4   9 9 0 0 1   0 .27 9 6   0 .30 3 0   0 .17 1 0   5 7 .28 3 4   34   0 .58 0 4   9 9 0 0 2   0 .40 0 0   0 .29 9 0   1 .67 9 0   7 9 .24 3 7   5   0 .17 0 4       The det ect ion s ta ge  is  s umm ar iz ed   in  Algo rithm  4 .     Algorithm 4. Detection.   // Training   Begin  Load  afdb, nsrdb   Initialize  PAF_features [1. .99002, 1..6],  input   Evaluation Warning : The document was created with Spire.PDF for Python.
In t J  Elec  &  C om p  En g     IS S N: 20 88 - 8708       Met hodolo gy  f or   detect ion of  Paroxys ma l At rial Fi br il lati on B as e d o n P - Wave,  H R V… ( Hen r y Castr o )   4031   For  each signal in  afdb   and  nsrdb   Obtain  PWaveHeight, PWaveWi dth, PRsegment, PWaveArea, HRV,  QRelectricalAlternans   End For   PAF_features    [ PWaveHei ght, PWaveWidth, PRsegment, PWaveArea, HRV,  QRelectricalAlternans ]   Set  input  as the 60%  of  PAF_features  selected randomly   Train  ANN   using  input     End     2.4.1.  Perf orm an ce  metric s   Sens it ivit y  (SN),   s pecifici ty   (S P)   a nd  ac cur acy   ( ACC) ,  show n  in  ( 13 - 15 )  res pect ively ,  wer e   cal culat ed  sinc e  these  a re  t he   m os t  widely   us e d  perform a nce  m et rics  to  asses s  the   pr obabili ty   of  suc cess  of   a cla ssifie r   [24 ] . Tab le   3   s ho ws  th e re su lt s  of these m et rics in  dif fer e nt wo r ks   re ported  i n  the  li te ratur e .      =                +          (13)      =              +           (14)      =        +              +       +       +        (15)       Table  3 . C om par iso n of m et h od s  for d et ect ion o f  P AF.   Ref erence   SN ( % )   SP ( %)   ACC  ( %)   [ 1 1 ]   8 0 .0   9 6 .0   8 8 .0   [ 6 ]   -   -   8 1 .5   [ 7 ]   8 2 .1   -   -   [ 8 ]   9 6 .0   8 8 .0   9 2 .0   [ 9 ]   -   -   7 0 .0   [ 1 2 ]   4 6 .5   9 8 .6   8 1 .2   [ 1 6 ]   9 0 .4   9 5 .2   9 2 .8   [ 1 5 ]   9 2 .9   9 6 .3   9 4 .6   [ 1 4 ]   9 1 .5   9 6 .1   9 4 .7   [ 1 3 ]   9 1 .5 / 93 .3 / 94 .1   9 6 .9 / 92 .8 / 93 .4   -   [ 1 7 ]   9 4 .5   9 6 .5   -   [ 1 8 ]   -   -   9 3 .1 / 93 .1 /9 2 .5   Propo sed  m ethod   9 6 .7   9 7 .4   9 7 .4       3.   RESU LT S  AND A N ALYSIS   To  e valuate  th e  pro po s ed  m et hodo l og y,   th e  At rial   Fib rila ti on   (a f db)  a nd   N or m al   Si nu s   Rhyt hm   (n s rdb )  databa ses  from   Ph ysi on et   [25]   were  us ed.   Eac h  on e  has  ECG  sign al   sam ples  fr om   bo th  sic k  a nd   healt hy  patie nts.  Eac h  si gnal   is  pr ocesse d  us in g  t he  m eth od ology  desc ribe d  befor e .  Fi gure  7(a )   shows  a n  or i gin al   ECG  sign al   from   th e  database,  w hile  Fi gu r e  7 ( b)   s hows  the  sign al   after  pr eprocessi ng.  Finall y ,   Fi gure   7 (c )  s ho ws  th e sig nal  with it s c har act erist ic  p oi nts  obta ined .   The  e xtracti on   of  cha racteri st ic s  was  a pp li e d  to  ea ch  of  th e  recor ds   in   bo th  data bases.  We  ob ta ine d  six  feat ur es  of   a  total   of  99 ,002  beats  as   il lustrate d  in   Table  2 .  T o  e ns ure  t he  li ne ar  in dep e nden ce  o f   t he  featu res,   t he   degree  of   c orrelat ion   bet we en  each  of  the m   was  determ i ned   t hro ugh  th e  correla ti on   m at rix.   As  it   is  sho wn  in  Ta ble  4,  th e  relat ion   betw een  the   six  fea tures  is  l ow  in   al l  cases  exce pt  bet ween  P - Wa ve   area,  P - Wa ve  heig ht  and   P - Wav e  width   w hich   is  m od erate.  These  res ults  ensu r e  that  the  featu res  obt ai ned  thr ough the  pr opos e d  m et ho dolo gy are  su it a ble for  the t rainin g of a  neura l netw ork.   The   P AF  was   detect ed  th r ough  a  fee dfo rward   ne ur al   net work  w hose  tr ai nin g  data  c orrespo nd e d  t o  60%  of   the  in for m ation   pro vid e d  by  the  99,00 2  beats  ob ta ine d  be f ore.  The  netw or k  was  trai ne d  on   10   diff e re nt  occa sion s  a nd   wa s  ob ta ine d  th e  SN ,  SP  an d  ACC  in  each  trai ning.  The  cal culat io ns   of   the m axi m u m , mi ni m u m , av er age a nd stan da rd d e viati on of  each  perform a nce m et ric   are  sh ow n  in  Ta ble  5.   A  c om par at ive  analy sis  of  the  perform ance  m e tric s  between  dif fer e nt   cl assifi ers  use d  in  sim il ar  works  an d  th e  propose d  m et hodo l og y  w as  done.   T he   resu lt s  are  s how n  in   Tabl e  3 .  The  pro po s ed   m et h odology  ob ta ine d  a  m i nim u m   SN   of   96 . 4%  that  i s  higher  tha n  the  oth e rs.   On   the  oth e r   hand,    the  SP  reache d  a  m axi m u m   value  of   98.1%  being   s urpa ssed  only   by  [8 ] ,  howe ver,  the  ACC  excee ds   al l     the r e ported  works e ve n wit h i ts  m ini m u m  v al ue  of  96. 3%.     Evaluation Warning : The document was created with Spire.PDF for Python.
                         IS S N :   2088 - 8708   In t J  Elec  &  C om p  En g,   V ol.  10 , No .  4 ,  A ugus t  2020  :   4023   -   4034   4032   0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 S am p le  ( n ) - 0.5 0 0.5 1 A m p l it u d e  ( m V ) x( n ) = y( n ) + r ( n ) + b ( n ) 0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 S am p l e  ( n ) - 0.4 - 0.2 0 0.2 0.4 0.6 0.8 1 A m p l it u d e  ( m V ) y( n ) 0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 S am p le  ( n ) - 0.4 - 0.2 0 0.2 0.4 0.6 0.8 1 Am p l i t u d e  ( m V) y( n ) P - Wave  p e ak R - Wave  p e ak Q - Wave  p e ak S - Wave  p e ak ( a ) ( b ) ( c ) Q S R  c om p le x ar e a     Figure  1 .  (a ) O r iginal si gnal  fro m   the d at a ba se, (b ) p re proc essed  si gnal ,   (c ) d et ect ion   of c har act erist ic   points       Table  4 .   C or rel at ion  m at rix  of  the  feature s     P - W av e heig h t   P - W av e width   PR seg m en t   P - W av e ar e a   HRV   QR elect rical  alter n an s   P - W av e heig h t   1   0 .20 7 3   0 .00 9 0   0 .60 8 9   0 .21 9 1   - 0 .03 1 5   P - W av e width   0 .20 7 3   1   0 .01 8 2   0 .62 4 9   0 .04 9 5   - 0 .12 0 2   PR seg m en t   0 .00 9 0   0 .01 8 2   1   0 .01 2 6   - 0 .01 8 5   - 0 .02 2 2   P - W av e ar e a   0 .60 8 9   0 .62 4 9   0 .01 2 6   1   0 .17 5 9   - 0 .20 8 2   HRV   0 .21 9 1   0 .04 9 5   - 0 .01 8 5   0 .17 5 9   1   - 0 .07 5 1   QR elect rical  alter n an s   - 0 .03 1 5   - 0 .12 0 2   - 0 .02 2 2   - 0 .20 8 2   - 0 .07 5 1   1       Table  5 .   SN, S P and ACC   m e tric s of the  propo s ed  m et ho d   Metr ic   Maxi m u m   Mini m u m   Mean   Co ef f icien t o f  variatio n   SN   9 7 .2%   9 6 .4%   9 6 .7%   0 .38 %   SP   9 8 .1%   9 6 .4%   9 7 .4%   0 .49 %   ACC   9 7 .5%   9 6 .3%   9 7 .4%   0 .42 %       4.   CONCL US I O N    To  date,  dif fe ren t  a uthors  ha ve  pr opos e d  m et ho ds   t hat  autom at e  the  detect ion   of   PA F  us in g    the  cha racteri sti cs  of   t he  P  wa ve,   hear t  rate  va riabil it y  or   Q R  el ect rical   al t ern at io n .  The  a ccur acy   reache d  by   these  m et ho ds   var y  betwe en  70%  and   94.7%.  Th us ,  the  pro blem   of   ap propriat el y  detect ing   a  FA P  is  not  fu ll y  so lve d  ye t,  due  to results ac hi eved by t hese  m et ho ds are  no t def i n it ive and  can st il l be im pro ved.   This   pa per   pro po s es  a  m et ho do l og y  to  ide nt ify   the  pr esen ce  of   a  PA F  in   patie nts  by  an al yz ing   their   ECG.  T he  m eth od ology  incl ud e s  both  t he  identific at ion  of   t he  c har act e risti c  po i nts  of   the  ECG  sig na l  and     the  m e tho ds   t o  ext ract  six  fea tures  that  al lo w  a  PA F  t o  be   detect ed  thr ou gh   a  cl assifi er .   The  res ults  obta ined  Evaluation Warning : The document was created with Spire.PDF for Python.