MEDICAL DIAGNOSIS H.R SINGH, RAHUL SHARMA, NITIN SAHGAL, POONAM SETHI, AHUL KUSHWAH & PRANAV KACHHAWA ABSTRACT The ac c ur acy i n t he onl i ne measur ement of ECG Par amet er s has a dec i si ve r ol e i n t he bet t er di agnosi s and ef f ec t i ve t r eat ment of t he di seases. The pr esent paper desc r i bes a Lab-VI EW based pr ogr ammi ng usi ng Pan Tompk i ns met hod t o ex t r ac t out QRS c ompl ex w her eas QT i nt er val measur ement s wer e c ar r i ed out usi ng Mat -l ab based Mat h- Sc r i pt modul e. Hi l ber t Tr ansf or m has been appl i ed on t he ECG si gnal t o c onver t i t i nt o an anal yt i c al si gnal f or bet t er peak det ec t i on. Peak det ec t i on and ot her par amet er s l i ke RR i nt er val , HR and sever al t i me domai n measur es of Hear t Rat e Var i abi l i t y suc h as RR mean and st andar d devi at i ons, HR mean and st andar d devi at i ons, RMSSSD, NN50 c ount , pNN50 et c wer e c al c ul at ed f or sever al ot her cl i ni c al appl i c at i ons apar t f r om onl i ne di sease di agnosi s. ECG PARAMETERS AND THEI R I MPORTANCE I N DI AGNOSI S. P wave is produced by muscle contraction of atria. The shape and duration of P wave indicate atrial enlargement. R wave marks the ending of the atrial contraction and the beginning of ventricular contraction. Magnitude normally varies from 0.1mV-1.5mV Narrow and high R wave indicates a physically strong heart. T wave marks the ending of ventricular contraction. A normal T wave is slight round and symmetrical. Pointed T wave is a cause of concern. Tall T wave indicates a certain disease. Ti me i t t akes t he i mpul se t o t r avel f r om at r i a t o AV node (At r i o-vent r i c ul ar c onduc t i on t i me). The PR i nt er val Measur ed f r om t he onset of t he P wave t o onset of t he QRS c ompl ex No mor e t han 5 smal l squar es i n dur at i on (0.20 sec ) Pr ol onged PR i nt er val >0.20 sec s. i n 1st degr ee hear t bl ock . Pl ac ement of el ec t r odes Repr esent s vent r i c ul ar c ont r ac t i on. Bet ween 0.08 and 0.12 sec s i n dur at i on (3 smal l squar es). Measur ed f r om t he onset of Q wave t o t he end of S wave. Si nc e t he vent r i cl es c ont ai n gr eat er muscl e mass t han t he at r i a, t he QRS c ompl ex i s l ar ger t han t he P wave. The QRS c ompl ex Fi r st negat i ve c omponent of t he QRS c ompl ex Shoul d be l ess t han 25% of t he assoc i at ed R wave. METHODOLOGY QRS and QT det ec t i on wer e per f or med usi ng Pan Tompk i ns w hi l e most of t he ot her par amet er s suc h as RR i nt er val , BPM, peak s, RR measur ement s and sever al ot her st at i st i c al and geomet r i c measur es wer e det ec t ed usi ng Hi l ber t Tr ansf or m. I n or der t o i sol at e t he QRS ener gy pr edomi nant por t i on, t he r aw si gnal af t er ac qui si t i on i s pr e- pr oc essed by pr oper si gnal c ondi t i oni ng and r emovi ng base l i ne wander i ng. These par amet er s af t er ex t r ac t i ng out f r om t he enhanc ed ECG si gnal have been si gni f i c ant l y used i n di agnost i c appl i c at i ons w i t h ac c ur ac y ac c ept abl e t o pr ovi de hi gher or der of c ar e t o t he pat i ent . PAN-TOMPKI NS ALGORI THM I dent i f i es QRS c ompl ex based on t he anal ysi s of t he sl ope, ampl i t ude and w i dt h of t he QRS. Bandpass f i l t er f or med usi ng l ow pass and hi gh pass f i l t er s r educ e noi se i n t he ECG si gnal . I t al so r emoves basel i ne dr i f t . The di f f er ent i at or di st i ngui shes QRS c ompl ex es f r om l ow f r equenc y P and T waves. Squar i ng emphasi zes t he hi gher val ues ex pec t ed due t o QRS c ompl ex and suppr esses smal l er val ues r el at ed t o P and T waves. Movi ng w i ndow i nt egr at or i s r equi r ed due t o t he pr esenc e of mul t i pl e peak s w i t hi n t he dur at i on of a si ngl e QRS, t hi s t akes an aver age of N sampl es. I t s out put c an be used t o det ec t QRS c ompl ex es, RR i nt er val and det er mi ne t he dur at i on of t he QRS c ompl ex . QRS DETECTI ON A bl ock di agr am i mpl ement i ng t he above st at ed st ages i n Lab-VI EW pr ogr am i s show n i n f i gur e f or QRS det ec t i on. BLOCK DI AGRAM OF QRS DETECTI ON I NPUT/OUTPUT WAVEFORMS OF A NORMAL SI NUS RHYTHM QT DETECTI ON The gap i nt er val bet ween Q onset and T of f set val ues i s c al c ul at ed on a si gnal as ac qui r ed and pr oc essed i n t he pr evi ous sec t i on of QRS c ompl ex det er mi nat i on. The bl oc k di agr am devel oped f or t he det ec t i on of QT i nt er val and Q poi nt and T poi nt t i me measur ement s i s show n i n f i gur e. BLOCK DI AGRAM FOR DETECTI ON OF QT I NTERVAL The c or r espondi ng QT i nt er val measur ement di spl ayi ng t he QT of f and QT on val ues separ at el y al ong w i t h t he si gnal ac qui r ed i s show n bel ow :- FRONT PANEL OF QT DETECTI ON The der i vat i ve of t he si gnal ac qui r ed af t er f i l t er i ng and base l i ne wander i ng el i mi nat i on usi ng medi an f i l t er i s t aken on w hi ch Hi l ber t Tr ansf or m i s per f or med. The r eason Hi l ber t Tr ansf or m i s used f or t hese measur ement s i s t o t ur n t he ECG si gnal t o an anal yt i c si gnal , w hi ch gi ves a bet t er peak t o det ec t . Thi s pr oc ess w i l l gi ve an enhanc ed ECG si gnal as c ompar ed t o r aw ECG si gnal f i r st obt ai ned. Peak det ec t i on.vi al gor i t hm i s devel oped t o f i nd al l t he peak s and t hei r l oc at i ons by set t i ng appr opr i at e t hr eshol d par amet er s. The RR i nt er val s ar e ex t r ac t ed by measur i ng t he t i me i nt er val bet ween t wo c onsec ut i ve peak s. The hear t r at e i s c al c ul at ed as f ol l ow s : Sampl i ng r at e * 60/ RR i nt er val (ms) HRV ANALYSI S METHODS Ther e ar e di f f er ent met hods of HRV anal ysi s. one of t hi s met hod i s Ti me Domai n Anal ysi s. Thi s met hod ex t r ac t s a f ew spec i al measur es usi ng onl y t he t empor al RR i nt er val si gnal s. For Ti me Ser i es Anal ysi s, Ti me Domai n measur es ar e c ommonl y used. Many measur es c an be ex t r ac t ed f r om t he or i gi nal RR i nt er val si gnal s t o show t he changes i n t he ans. Var i abl es Uni t s Desc r i pt i on St at i st i c al Measur es RR Mean & St d S Mean and st andar d devi at i on of al l RR i nt er val s HR Mean & St d 1/mi n Mean and st andar d devi at i on of al l hear t r at es. RMSSD MS Squar e r oot of t he mean of t he sum of squar es of di f f er enc es bet ween adj ac ent RR i nt er val s. NN50 c ount Number of pai r s of adj ac ent RR i nt er val s di f f er i ng by mor e t han 50 ms i n al l measur ement s pNN50 % NN50 c ount di vi ded by t he t ot al number of al l RR i nt er val s Geomet r i c al measur es HRV t r i angul ar i ndex Tot al number of al l RR i nt er val s di vi ded by t he hei ght of t he hi st ogr am of al l RR i nt er val s. HEART RATE VARI ABI LI TY ANALYSI S The Hear t Rat e Var i abi l i t y anal ysi s c an be per f or med i n many ways but t he c ommonl y used met hod i s Ti me Domai n Anal ysi s w her e onl y t he t empor al RR i nt er val si gnal s ar e used t o ex t r ac t out a f ew spec i al measur es such as mean and st andar d devi at i on (RR mean) of al l RR i nt er val s and hear t r at e (HR), RMSSD (squar e r oot of mean of sum of squar e of di f f er enc es bet ween adj ac ent RR i nt er val s), NN50 c ount (Number of pai r s of adj ac ent RR i nt er val s di f f er i ng by mor e t han 50 ms) and HRV t r i angul ar i ndex (Tot al no. of al l RR i nt er val s di vi ded by hei ght of t he hi st ogr am of al l RR i nt er val s) et c . PROCESS OF ACQUI RI NG SI GNALPARA METERS The pr oc ess of ac qui r i ng var i ous si gnal par amet er s as st at ed above. Basel i ne dr i f t el i mi nat i on Hi l ber t s t r ansf or m Peak Det ec t i on Ti me domai n HRV anal ysi s Hear t r at e Ex t r ac t R peak s & RR i nt er val s Ac qui r e r aw ECG si gnal BLOCK DI AGRAM OF TI ME DOMAI N HRV ANALYSI S Data Acquisition Signal Conditioning Processing Display raw ECG waveform, enhanced ECG waveform, Heart Rate, time domain parameters of HRV Transmission of data parameters and waveforms Is Heart Rate out of range? Warning indicator at remote PC Do you want to save the data? Do you want to quit? Press the save button no no Start Stop Figure : ECG data of patient with normal heart rate on Local PC(top) and Remote PC(bottom). Figure : ECG data of patient with abnormal heart rate on Local PC(top)and Remote PC(below). CONCLUSI ON VI s f or t he det er mi nat i on of QRS dur at i on usi ng Pan Tompk i ns al gor i t hm i s devel oped and st epw i se exec ut i on of ever y st age i s di spl ayed i n t he f r ont panel di agr am. For QT i nt er val measur ement , Mat h-Sc r i pt t ool i n Mat -l ab i s used and t he c or r espondi ng QT i nt er val s al ong w i t h t hei r Q poi nt and T poi nt t i me measur ement s ar e di spl ayed i n t he r espec t i ve f r ont panel di agr am. A si ngl e w i ndow VI f or t he measur ement of al l t i me domai n st at i st i c al and geomet r i c measur es suc h as RR i nt er val , HR, HRV t i me var i ant anal ysi s, RR and HR mean and st andar d devi at i ons, RMSSSD, NN50 c ount i s al so devel oped and r esul t s ar e di spl ayed. These r esul t s and t hei r i nt er dependenc i es on eac h ot her ar e hi ghl y desi r abl e f or sever al cl i ni c al appl i c at i ons apar t f r om t he onl i ne medi c al di agnosi s.