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 Be rnal - N oreñ a 3   1 Facul t y   of   Eng i nee ring ,   Univ ers ida San ti ago   de   Cali,   Colom bia   1, 2 ,3 El ec tr ic a l an 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 Fe b 25 , 202 0       The   detec t ion  of  par ox y sm al   atrial   fibr il l at ion  (PA F)  is   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 for  aut om atic  d e te c ti on  b ase 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 net work   (AN N)  have   been  proposed.   In  t his  stud y ,   six  fe at ure wer obt a ine base d   on  the   m orpholog y   of  th P - W ave ,   the   QRS   c om ple 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 m et h odolog y   wa val id at ed  using  cl inica ECG  signal from   the   Ph y sione arr h y th m ia   dat aba s e   MIT - BIH.   fee dforward  neur a net work  was  used  to  det ec t he  pre senc e     of  PAF  rea chi ng   gene ral   a cc ur a c y   of  97. 4% .   Th result obta ined  show  tha the   in cl usion  of   the   informa ti o of  the   P - W av e,   HRV   and  Q El e ct ri cal  al t ern ans  inc r ea s es  the   a cc ura c y   t ide nti f y   the   P AF   eve nt  compa red   to  other  works   tha us th 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 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 o f Ad vanc ed   Engi n ee r ing  and  S cienc e   Al l   rights re serv ed .   Corres pond in 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 cl inica l l diag no se ca rd ia 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 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 of   pro gr ess   of  pa r oxysm al   a tria fibr il la ti on   (PAF)  to  persi ste nt     or   per m anen on hav not  been   fu ll identifie d,   the refo re,  de te ct in a AF   in  it ea rly   fo rm   is  i mp ort ant     to avoid  the  r is ks   of a str oke,  hear fail ur e  and /  or m or ta li ty   [ 1] .   The  process   of  detect in a AF  is  pe rfo r m ed  m anu al ly  by  ca rd i ologist   or  el ect r ophysi ologist     by  inter pr et in the  el ect r oc ard i ogram   (ECG)   r eco r ds This  process  is  highly   dem and i ng  due  to   bot   the  num ber   of  records   t be   analy zed  an the  fact  that  so m et i m es  i i 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 path ol og y.   Th us,  a autom at ed  m et ho   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 m et hods   that  aut om at the  detect ion   of  P AF So m autho r s   hav reac hed   a   detect ion   acc uracy   betwee 70%  an 92 [6 - 9]  us in the   char act e risti cs  of   t he  wav e   [10] oth e rs  pro pose   the  us of   hea rt  rate  var ia bili ty   ob ta ining   a accuracy  betw een  81. 2%  an 94 . 7%   [ 7,   11 - 18] finall y,  [9 ]   pro po s es  the  us of   QR  el ect rical   al te rn at ion   r eachin an  ac cur acy   of  70% Accord i ng   to   this   the proble m  o appr opriat el y detec ti ng  a  FAP is n ot f ully  s olv e ye t, due  to r es ults achie ved   by these m et hods   are  not  def init ive  an ca st il be  i m pr ove d.   S o,  in  this  pap e ne m et ho dolo gy  is  pro posed  t address     Evaluation Warning : The document was created with Spire.PDF for Python.
                         IS S N :   2088 - 8708   In t J  Elec  &  C om En g,   V ol.  10 , No 4 A ugus 2020  :   4023   -   4034   4024   this  pro blem   integrati ng  m ultiv ariat sta ti sti cs  [ 19 ]   on  t he  c har act erist ic 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 m et hod was  97.4%.   P AF   is  c ha r act erized  by  irr egu la m ov em ent  of  the   le ft  a trium   that  pr ev ents  the  pro per  bl oo fl ow   into  the   ci rc ulatory  syst em   and   al so  by  re duct ion  of  the   ti m that  the  ve ntricl es  val ves  hav e   to  receiv an sen blood   to   the  lun gs.  I an  ECG  signa l,  these  two  char act e risti cs  hav an  im pact  in  the  m or phol og y     of   t he  P - W a ve   an in  t he   distance   bet w een   the  P - Wav e   an t he   R - W a ve   s ee   Fig ur 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 W i dth   a nd   Hei ght,  as  well   as  the  P R   segm ent,  hear t   rate va riabil it (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 a n EC si gn al       Diff e re nt  auth or reli ed  on  on or   t wo   c har act erist ic f or   the  detect ion   of   P AF   as   il lustrate   in   Ta ble  1 .   In  this  pa per,  unli ke   ot he works  re po rted  i the   l i te ratur e,   i is  pro pose t us e   the  inf or m at ion   of  the  three  char act e risti cs  to  cover  al the  sy m pto m of   the  PAF  an extract  six  rel evan featur e 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 he r e.  Ta ble  1   li sts  so m works  t hat  ad dress  t he   sam 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 m e tho dolo gy pr evi ou sl dig it iz ed  ECG  signa is  received  as  in put.  The  sign a l     is  pr oce ssed  i f our  m ai sta ges  (Prep r oc essing,  cha ra ct erist ic   po int extracti on,  featur e 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 i Fi gure .   Evaluation Warning : The document was created with Spire.PDF for Python.
In t J  Elec  &  C om 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 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 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  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   is  per f or m ed  to  ens ur sta nd a r fr e quen cy   fo the  s ubseq uen ap plica ti on   of  low - pass  fi nite  i m pu ls e   respo ns dig it al   filt er  (F IR a nd   t al lo ea ch  of   t he  cha ra ct erist ic   po ints   of   t he  sig nal  t be   est ablishe 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 a ver a ge  a nd f il te rin g.     2.1.1 .   Res ampl ing   The  pro po se m et ho dolo g use six  featu re f or   t he  rec og niti on   of  at rial   fib rill at ion   th at   are  ba se o t he  m or phol og of  the  si gnal T her e fore   it   is  ver i m po rta nt  to  prese rv t he  f reque ncy  co ntent  as   well     as  the  sh ape  of   the  sig nal  durin proce ss ing F or   this  reason,  it   is  re qu i red   to  be   rep re sent  eac beat    by a s uffici ent  nu m ber   of poi nts that e nsure   a good  detect io a nd a  good  f eat ur e e xtracti on.   The  hei gh an widt of   the   P - W a ve  are  f eat ur es  that  ne ed  good  m or phologica representat io n,   thu s in  t his  pap e we  c onsidere us in resam ple  frequ e ncy  to   en su re   that  the   P - Wav has   a le ast    50  sam ples.Con si der i ng  tha there  a re  docum ented  case of  patie nts  with  P AF  at   the  age   of  22   [20]   the  m axi m u m   hear rate  (     c on si der e i this  m et ho do l ogy  was  cal c ula te 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 m s u sin       on   (2 ).        = 60      12%   (2)     Finall y,  resa m pl ing   f re qu e ncy  (  of  ap pro xim a te ly   11 70  Hz  wa 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 a   baseli ne  wa nder  that  m us be   correct ed   to  re fer e nce  the   vol ta ge  le vels  of   th sig nal  to   zero  D le ve l.  The  m ov in aver a ge  giv e in   (4 is  com m on ly   use t do  this  w hic re qu i res   sp eci fyi ng  a   w indow  siz e   ( ).  This  pa per  pro po s es  t obta in   base on  t he  m os c ommon  hear t   rate   va lue  pr ese nt  in   the  sign al To   fin this  val ue,   we   obta in  the   f re qu e ncy  with  th highest  e nergy  val ue  in  t he   powe r   sp ect ral  den sit y   of   the  sig nal  bounde betwe en  60  bpm   and   200  bp m The refor e is  de fine as  the  i nvers e   of   t he  f reque nc with  the  hi gh e st  energy  value  rou nd e to  the  nea rest   even   value This  is  sho wn  in   (5 ).    Said  f reque nc was  obta ine 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 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 En g,   V ol.  10 , No 4 A ugus 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 is  re pr ese nte by   (7) ,   w here,  ( )   is  the   sig na ge ner at e by  car diac  act ivit wit   fr e quency  ra ng of  2.5   Hz  and   45  Hz   [ 21] (n)  is  el ect ri cal   no ise   a nd  wh it 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 m ov ing  aver a ge   in   the   la st  ste p.  I th is  ste p,  a   lo w - pass   filt er  with     a cutoff  freq ue ncy of  45  Hz w as  desig ne 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 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 beat  of   t he  ECG  sig na l These  points,  sh ow in   Fig ur 3 ,   will   la te be   use 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 EC 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 M   fo un in  sect ion   2.1.2   was  use to  fin   the  R - Wav pe ak.   T he  wind ow   m ov es   thr oughout  the  E CG  sig nal  fi ndin peak s   th at   exceed   0.6   tim es     the  m axi m u m   a m plit ud in  the  wind ow   an ha ve  separ at ion   bet wee the m   of   at   least  35 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 i this  m et ho dolog of 17 0 bpm .   Evaluation Warning : The document was created with Spire.PDF for Python.
In t J  Elec  &  C om 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 on  the   locat io of   t wo  co ns ec utiv R - W a ve  pea ks As   se e   in   Figure  4 The  P - Wa ve  pe ak  is  the  m axim u m   value  found  withi de fine searc area  betwee 70%  an 90%  of  t he dist ance  betwee 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 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   neg at ive  peak   l ocated  j ust   befo re  th app ea ra nce     of   t he  R - Wave,  f or   this  rea so n,  de rivati ve  was  us e as  searc m et hod  f or   t his   peak.  Acc ord ing   to   the  pro po s ed   ( 8) the  valu of  the  de rivati ve   is  cal culat ed  on   eac sam ple  on at   tim e   befor the  R - Wav e .     This  process  i done   unti der i vative  with  negat i ve  va lue  is  f ound  as  seen  i n   Fi gure  5 .   I this  pape r     we  pro pose  distance  of  ei gh sam ples  t be  use in  order   to  a void   s m al l   var ia ti on t hat  cou l 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 peak.  r ed  dots re present l oc at ion 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 wa carrie out  f ollow i ng  pro cedure   sim il ar   to  that  us e 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 area b et wee 0%  a nd  10%   of the  distance   betwee tw c on s ecuti ve  R pe aks  as  is s how 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 En g,   V ol.  10 , No 4 A ugus 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 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  m V.   This  po i nt  wa f ound  by  e va luati ng   eac on e   of  the   sa m ples  pr ior  t 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 eq uatio c onside rs  t he  fa ct   that,  in   pract ic e,    the  P - O ns et   ha posit ive  value  higher   than  t he  baseli ne,   t her e fore,  value  of  0.1 ti m es  the  a m pl it ude     of the  peak  was use 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 the   sam ple  wh er the  P - W a ve   en ds T fin this  point ,     we  procee ded  in  sim il ar  way  to  the   m et h od  use to  fin the   P - O ns et   with  the   diff e r ence  th at   the  s a m ples  evaluate are  locate 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 fi nd  this  ch aracte rist ic   po i nt,  sim i la m et ho us e in  sect ion  2. 2.3  was  co nsi der e d.   Eac of   the  sam ples  befor the  Q - Wav pea is  cal culat ed  one  by  on e   on  the  der i vative  descr i b ed   by   the  pro pose d   (10 unti posit ive  va lue  i f ound.  In  thi case,  sensi ti vity  gr eat er  t ha th at   required   t fin the  Q - Wa ve  pea 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 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 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 pe ak     Peak2    Se co nd  p ea k     RR    Pe ak 2. l oc at io   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 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 pe ak     Peak2    Se co nd  p ea k     RR    Pe ak 2. l oc at io   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 ext r act i on   On ce  the  ch ar act erist ic   po ints  hav bee id entifi ed,   the  si featu res  pr e s ented  on  the  thir sta ge  of  the  m et ho do l ogy  des cribe i Fi gu re   a re  extracte f or  e ach  beat  of  t he   ECG  si gnal .   T he  first  th ree  f eat ur es  P - Wav 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 P - Off set   an P - On s et an 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 En g,   V ol.  10 , No 4 A ugus 2020  :   4023   -   4034   4030   the  f ourt fe at ur e   P - Wa ve  A rea,  it   is  de fin ed  as   the   area   unde t he  c urve  betwee P - On set   an P - Offset .   Con si der i ng   t ha the  ECG  sig nal  is  discrete,   trapez oid al   nu m erical   integrati on  is  use 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 Hear t   Ra te   Var ia bili ty   (H RV is  t he   num ber   of  be at per  m inu te   (bpm that  would  be  gen e rated  acc ordin to  the  distan c betwee tw 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 cal le Q el e ct rical   a l te rn a ns   is  def i ned   a s   the  dif fer e nce  betwee the  a m pl it ud of  th R - W a ve  pea an 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    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 m et ho do l ogy.  To  dete rm i ne  the  pr ese nc of   P AF    in  the  ECG feedfo rw a r neural  netw ork  with  tw hidden  la ye rs   each  with  10  ne uro ns   wa us e   as  cl assifi er   [ 23] T his  ne ur al   netw ork,   whose  trai ning   was  ca rr ie ou us in 60%  of  t he  in f orm ation     in the dat a base   show i n   Ta bl e 2 ,  to  i den ti fy  the prese nce  or not o a  P AF  i 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 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 (SN),   s pecifici ty   (S P)   a nd  ac cur acy   ( ACC) show in  ( 13 - 15 res pect ively wer e   cal culat ed  sinc these  a re  t he   m os widely   us e perform a nce  m et rics  to  asses the   pr obabili ty   of  suc cess  of   a cla ssifie r   [24 ] . Tab le   3   s ho ws  th e re su lt of these m et rics in  dif fer e nt wo r ks   re ported  i 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 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 pro po s ed  m et hodo l og y,   th 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 on has  ECG  sign al   sam ples  fr om   bo th  sic a nd   healt hy  patie nts.  Eac si gnal   is  pr ocesse us in t he  m eth od ology  desc ribe befor e Fi gure  7(a )   shows  a or i gin al   ECG  sign al   from   th database,  w hile  Fi gu r 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 was  a pp li e to  ea ch  of  th recor ds   in   bo th  data bases.  We  ob ta ine six  feat ur es  of   total   of  99 ,002  beats  as   il lustrate in   Table  2 T 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 correla ti on   m at rix.   As  it   is  sho wn  in  Ta ble  4,  th relat ion   betw een  the   six  fea tures  is  l ow  in   al cases  exce pt  bet ween  P - Wa ve   area,  P - Wa ve  heig ht  and   P - Wav width   w hich   is  m od erate.  These  res ults  ensu r that  the  featu res  obt ai ned  thr ough the  pr opos e 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  fee dfo rward   ne ur al   net work  w hose  tr ai nin data  c orrespo nd e t 60%  of   the  in for m ation   pro vid e by  the  99,00 beats  ob ta ine be f ore.  The  netw or was  trai ne on   10   diff e re nt  occa sion a nd   wa ob ta ine th SN SP  an 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 in  Ta ble  5.   c om par at ive  analy sis  of  the  perform ance  m e tric between  dif fer e nt   cl assifi ers  use in  sim il ar  works  an th propose m et hodo l og w as  done.   T he   resu lt are  s how in   Tabl 3 The  pro po s ed   m et h odology  ob ta ine m i nim u m   SN   of   96 . 4%  that  i higher  tha the  oth e rs.   On   the  oth e r   hand,    the  SP  reache 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 En g,   V ol.  10 , No 4 A ugus 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   To  date,  dif fe ren a uthors  ha ve  pr opos e m et ho ds   t hat  autom at the  detect ion   of   PA us in   the  cha racteri sti cs  of   t he  wa ve,   hear rate  va riabil it or   Q el ect rical   al t ern at io n The  a ccur acy   reache by   these  m et ho ds   var betwe en  70%  and   94.7%.  Th us the  pro blem   of   ap propriat el detect ing   FA is  not  fu ll so lve 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  m et ho do l og to  ide nt ify   the  pr esen ce  of   PA in   patie nts  by  an al yz ing   their   ECG.  T he  m eth od ology  incl ud e both  t he  identific at ion  of   t he  c har act e risti po i nts  of   the  ECG  sig na and     the  m e tho ds   t ext ract  six  fea tures  that  al lo PA t be   detect ed  thr ou gh   cl assifi er .   The  res ults  obta ined  Evaluation Warning : The document was created with Spire.PDF for Python.