Professional Documents
Culture Documents
1
II. IMPLIMENTATION
I.
INTRODUCTION
= (2 log N )
Where is the standard deviation and N is the
M .A.D
number of points. In case of white noise =
0.6745
where MAD is the median absolute deviation of the
detail coefficients. We alter this algorithm to provide a
different threshold for each level of detail. Our altered formula
is:
j = j (2 log N j )
Where j =max (|d ( j , k )|) where d are the detail
coefficients at the
jth level. The estimated denoised
constructed by taking the inverse discrete wavelet transform
using the modified detail coefficients.
ECG signal analysis relies heavily on identifying a feature
2
function (PDF)
the value of
signal X [ n] . The signal may undergo an abrupt change at
time
changes from
H 1 ; =1 .
PDF
n
p X H ( x [ 0 ] , , x [ n ] ; 0 )= p X (x [ k ] ; 0)
0
independence
from
k=0
of
random
variables
and
n01
the
p X H ( x [ 0 ] , , x [ n ] ; 1) = p X (x [ k ] ; 0 ) p X (x [ k ] ; 1 )
1
k=0
k=n0
.
The algorithm requires prior knowledge of the both the
0 and 1 . The
PDFs as well as the values of
algorithm functions as follows:
k = 0
while algorithm running
measure x[k]
decide between H0 and H1
if H1
n1 = k
estimate n0
stop
end if
end while
To decide between H 0 and H 1 from X [ n] is a
binary hypothesis testing problem. A binary hypothesis
problem can be adequately decided between the two
conflicting hypothesis by the likelihood ratio test
P ( L ( X )> ; H 0 ) =
(the likelihood function),
where
L ( X )=
p (0 )
p (1 )
p X ( x ; H 1)
p X ( x ; H 0)
and , the significance level [3]. For the SPRT, we use the
log likelihood function
ln ( L ( X ))=ln
p X (x ; H 1)
p X (x ; H 0)
as
L ( X [n])=
p X ( x [ k ] ; 0 ) p X ( x [ k ] ; 1 )
k=0
k=n
0
k=n0
p X (x [ k ] ; 0)
k=0
Var ( 0 )=Var ( 1 )= 2
p X ( xas[ k ] ;11 ) is a linear function of 0 . Now as X [n]
a
normal
distribution
p X ( xhas
[ k ] ; 0 )
1
pX ( x [k ] ; )=
e( x [ n] )/ 2 .
2
we let
p X (x [ k ] ; 1)
p X (x [ k ] ; 0 )
k=n
If L( X [ n ] )> h then H 1 is accepted.
ln ( L ( X [ n ] ) ) = ln
Hence
G(X [ n ] )=max ( L ( X [ n ] ))
log
S [ n ] = ln
k=0
ratio
p X (x [ k ] ; 1)
p X (x [ k ] ; 0)
of
the
p X ( x [ n ] ; 1 )
p X ( x [ n ] ; 0)
nth
sample
as
and
G ( X [ n ] ) =
[2]
Z=
X 0+ + X nn
n
0 ,
and
H1
(x [ n ] 1) / 2
G X [ n1 ] +
10
2
function
10
( x [n ]
G ( X [ n ] ) =
( x [ n ]
1 + 0
), 0
2
1 + 0
)
2
x [ n ] 0 ,0
2
Now
G(X [ n1 ] )+ 2 () where must be set a
G ( X [ n ] ) =
priori.
We now adjust the algorithm for our specific problem,
detecting if a patients ECG shows any signs of MI. We have a
sequence ST =ST [ 0 ] , , ST [ n ] , which are the values
of ST segments. We assume that the ST samples are
normally distributed with a mean and a variance of
2
. Our NULL hypothesis, H 0 , is that the patient is
healthy, and the alternate hypothesis, H 1 ,
is that the
patient is having a MI event. We define the changing
parameter, i , in our binary hypothesis as the mean,
ith
term and
Si
as the
(z ) as n
with mean
Hence
likelihood
(x [ n ] 1) / 2
s [ n ] =L ( x [ n ] )=ln
likelihood
n
log
ln ( L ( X [ n ] ) ) =ln
the
then the
Let us define
1=0 +
H0
(normal ECG),
1 , if
G i ( ST )=S imin S j .
0 < j <i
If
Gi ( ST )> h
for any
Gi ( ST )= Gi1 (ST )+
( ST [ i ] 0 ), 0
2
2
where
set
value
set threshold value h>0
S = S_prev = 0
G = G_prev = 0
set initial values of and
initialize A[n] = 0
set i = 0
while algorithm running
measure ST[i]
calculate s_i
S_prev = S
calculate S
G_prev = G
calculate G
if G>h
A[i] = 1
if (sum(A) > k)
sound alarm
G = 0
else
G = G_prev
end if
else if (G <= 0)
G = 0
end if
calculate new from ST_i for i
such that A[i] = 0
shift window to right by one value
i = i + 1
end while
4
III. EXPERIMENTAL RESULTS
1.4
1.3
1.2
1.1
0.8
0.6
0.6
0.4
0.4
0.2
0.2
-0.2
0.8
-0.4
V(mV)
1.5
1
0.5
0
-0.5
-1
-0.2
0
100
200
300
400
500
600
-0.4
700
-1.5
0
50
100
150
200
250
300
130
350
140
150
160
170
180
1
3rd Level App Coefficients
0.9
1.5
1.5
0.8
1
0.6
0.8
0.4
0.7
1
0.5
0.5
0.2
-0.5
-0.2
0
0.5
1.5
2.5
t (sec)
3.5
4.5
-0.4
20
40
60
80
FIGURE - I
100
120
140
160
-0.5
180
-1
0
10
20
30
40
50
60
70
80
130
90
FIGURE - II
150
160
170
180
FIGURE - III
ST Elevation Spectrum
1.4
140
CUSUM Alarms
1.4
1.5
0.5
1.2
1.2
0.8
0.8
0.6
0.6
0.4
0.4
0.2
0.2
-0.5
-1
100
150
200
250
300
500
1000
1500
2000
2500
3000
FIGURE - V
FIGURE - IV
3500
4000
500
1000
1500
2000
2500
3000
3500
4000
FIGURE - VI
technique is rst used to denoise and lter the original ECG
signal and extract the values of ST segments, then the
CUSUM algorithm is applied on these extracted values to
detect signicant deviations of ST elevation in order to raise
alarms. To reduce the probability of false alarms, we adapted
the CUSUM algorithm by introducing a sliding window with
xed size, to hold the number of deviations that must be
detected before raising an alarm. Finally, we applied our
proposed approach on a real medical database (the Physionet
EDB database) using MI and other cardiac problems ECG.
REFERENCES
[1] E. S. Page, "Continuous Inspection Schemes,"
Biometrika, vol. 41, pp. 100-115, 1954.
[2] M. Basseville, Detection of abrupt changes:
Theory and application, Prentice Hall, 1993.
[3] J. N. T. Dimitri P. Bertsekas, Introduction to
Probability, Athena Scientific, 2008.
[4] S. Kay, Fundamentals of statistical signal
processing, volume 2: Detection theory, Prentice
Hall PTR, 1998.
[5] Method for Correcting Baseline Wander in
Raw ECG Signals, ECG Signal Analysis for
Myocardial Infarction Detection, ELEC 301
Projects Fall 2013.
[6] PhysioBank, PhysioToolkit, and PhysioNet:
Components of a New Research Resource for
Complex Physiologic Signals, Circulation, vol.
101, no. 23, pp. 215220, 2000.
[7] ECG Feature Extraction with Wavelet
Transform and ST Segment Detection using
Matlab 2012, Grasshopper.iics, Code Project
[8] Denoising of Electrocardiogram Data with
Methods of Wavelet Transform, CompSysTech13.