Crystal Structure analysis and detailed information pptx
ECG DE-NOISING USING WAVELETS AND MOVING AVERAGE FILTER
1. DE-NOISING OF ECG USING
WAVELETS AND MULTIWAVELETS
10-Mar-17
PRESENTED BY,
Dr.S.BALAMBIGAI
ASSISTANT PROFESSOR(SRG)
DEPARTMENT OF ECE /KEC
Ph.no :9443895494
Email: sbalambigai@gmail.com
2. Need for ECG processing:
March 10, 2017
2
Electrocardiogram and heart rate are vital physiological signals to
monitor cardiovascular diseases(CVD).
A report by World Health Organization (March 2013) estimates
cases of CVD (including heart attack, stroke, angina) will increase
from 17.3 million in 2008 to 23.3 million by 2030 .
Hence, frequent monitoring is required for those under great risk for
cardiovascular diseases.
This signifies the importance of research in the recording and
processing of electrocardiogram signals.
3. Introduction - Electrocardiogram
3
The electrocardiogram is a graphic record of the direction and
magnitude of the electrical activity of the heart.
One cardiac cycle consists of the P-QRS-T wave.
The clinically useful information is found in the intervals and
amplitudes of an electrocardiogram.
March 10, 2017
4. ECG
Recorded with surface
electrodes on the limbs or chest.
ECG is used to measure the rate
and regularity of heartbeats, the
presence of any damage to the
heart.
5.
6. THE HEART
It is a 4 chambered
muscular organ
consist of 2 atriums
and 2 ventricles.
It function in a
regular fashion to
pump blood thought
the body.
Average heart rate
of a human being is
72beats/min
7. Uses of ECG
March 10, 2017
7
To find the orientation of the heart.
To determine heart rate and to analyze the working mechanism of
the heart.
To determine the extent of damage in various parts of the heart
muscle.
To diagnose an impending occurrence of heart attack or CVD.
To determine unusual electrical activity in patients with abnormal
cardiac rhythms.
To determine the thickness of the heart muscles.
To determine blockage areas and restricted blood flow areas in the
heart muscles.
10. Types of Noises in Electrocardiogram
10
• Power line interference
• Base line drift
• Motion artifacts
• Muscle contraction
• Electrode contact noise
• Instrumentation noise generated by electronic devices
March 10, 2017
11. Baseline Wander
Baseline wander, or extragenoeous low-frequency high-
bandwidth components, can be caused by:
Perspiration (effects electrode impedance)
Respiration
Body movements
Can cause problems to analysis, especially when examining the
low-frequency ST-T segment
12. Power Line Interference
Electromagnetic fields from power lines can cause 50/60 Hz sinusoidal
interference, possibly accompanied by some of its harmonics
Such noise can cause problems interpreting low-amplitude waveforms and
spurious waveforms can be introduced.
13. Source of ECG
March 10, 2017
13
MIT-BIH Arrhythmia Database obtained from the Beth Israel Hospital
Arrhythmia Laboratory
Consists of 48-half-hour ECG recordings which were digitized at 360
Hz having 11-bit resolution
14. Performance measures
March 10, 2017
14
Signal to Noise Ratio
where P is average power and A is RMS amplitude
Mean Square Error
MSE =
where N represents the total number of samples in the given signal,
x (i) is the original ECG and d (i) is the de-noised ECG.
15. What is a Transform
and Why Do we Need One ?
Transform: A mathematical operation that takes a function or
sequence and maps it into another one
Transforms are good things because…
The transform of a function may give additional /hidden
information about the original function, which may not be
available /obvious otherwise
The transform of an equation may be easier to solve than the
original equation (recall your fond memories of Laplace
transforms in DFQs)
The transform of a function/sequence may require less storage,
hence provide data compression / reduction
An operation may be easier to apply on the transformed function,
rather than the original function (recall other fond memories on
convolution).
16. Why Wavelet?
Time domain analysis, e.g. averaging (Not suitable for
non- stationary signals).
Frequency domain analysis (Not suitable for non-
stationary signals)
Time-frequency domain analysis
Statistical methods (SVD,EMD)
Time-scale domain analysis, e.g. wavelet (Variably-
sized regions for the windowing operation which
adjust to signal components).
18. DWT Analysis
DWT of original signal is obtained by concatenating all
coefficients starting from the last level of decomposition.
DWT will have same number of coefficients as original
signal.
Frequencies most prominent (appear as high
amplitudes) are retained and others are discarded
without loss of information.
19. Applications of Wavelets
Compression
De-noising
Feature Extraction
Discontinuity Detection
Distribution Estimation
Data analysis
Biological data
Financial data
20. Types of thresholding
In hard thresholding, a sudden change occurs, but in soft
thresholding, a change occurs linearly which gives good result.
10-Mar-17 1
21. Thresholding contd…
Hard-thresholding method: In hard thresholding, the remaining co-
efficients above the threshold remains unchanged as given by
Soft-thresholding method: In soft thresholding, the remaining
coefficients are reduced by an amount equal to the value of the
threshold.
10-Mar-17 1
22. Steps in Wavelet Filtering
March 10, 2017
22
Step 1: Decomposing of the noisy signals using wavelet
transform by using an appropriate mother wavelet and the noisy
signal is decomposed, at a suitable decomposition level to obtain
approximate coefficients aj and detail coefficients dj.
Step 2: Thresholding of the obtained wavelet coefficients
yields the estimated wavelet coefficients dj. For each level, a
threshold value is found, and it is applied to the detailed
coefficients.
Step 3: Inverse transformation to obtain the cleaned signal The
reconstruction of the de-noised ECG signal x (n) is done from the
values of dj and aj obtained by inverse discrete wavelet transform
(IDWT).
24. Three level decomposition of ECG signal
using wavelets
March 10, 2017
24
The useful information in ECG is contained in the frequency of 0.5
Hz-45 Hz ( Nagendra et al 2011).
The high frequencies contain the noise and the low frequencies of
the ECG contains the required data for the ECG analysis (Kumar &
Agnihotri 2010). Thus, this three level decomposition of the ECG
signal guarantees that the dominant frequency components of the
actual signal is not lost during this omission of coefficients of few
levels
The Daubechies family (Db 4) gives the best de- noising results for
the ECG data (Balasubramaniam & Nedumaran 2009). The Rigrous
Sure thresholding (Garg et al 2011) gives a better result than min-
max and universal thresholding.
26. Denoising Using Matlab Choose thresholding
method
Choose noise type
Choose threshold
Hit
Denoise
27. (a) Input ECG (b) De-noised ECG and (c) error
obtained using wavelet de-noising for ECG100
March 10, 2017
27
28. SNR and MSE values for Wavelet based
ECG de-noising
March 10, 2017
28
ECG Record
number
SNR
(in dB)
MSE
100 18.6231 4.3456 e -04
103 20.3215 3.6112 e -04
113 20.6286 3.6093 e -04
114 19.9831 3.7621 e -04
119 21.7861 3.0038 e -04
121 21.3048 3.2912 e -04
201 26.3668 2.8917 e -04
203 14.5414 4.5626 e -04
234 19.6314 4.0953 e -04
ECG01 10.4014 4.8591e -04
ECG04 16.8415 4.3802 e -04
29. Moving average filter
29
Moving average is a simple mathematical technique which is
set to remove the baseline wander noise removal.
It replaces each data point with the average of the neighboring
data points.
Advantages of moving average filter (Smith S W 1997) are given
below:
Moving average filter is considered as a optimal filter to reduce
random white noise while preserving the sharpest step response.
It is computationally fast as it requires addition and subtraction
operations rather than multiplication operations.
It is a recursive operation.
It has high execution speed.
March 10, 2017
30. Method II: ECG De-noising using Wavelet with
Moving Average Filter
March 10, 2017
30
Wavelet
Transform
Moving Average
filter
ECG
(BL+PL)
Clean
ECG
ECG
(BL)
BL – Baseline noise
PL – Power line noise
31. ECG De-noising using Wavelet with Moving
Average Filter ( contd..)
March 10, 2017
31
Algorithm:
Step 1: The Daubechies wavelet 4 (Db 4) wavelet is used to de-
noise the input ECG. The RigSure threshold is used for
thresholding and the ECG signal is decomposed into three levels of
decomposition.
Step 2: After thresholding , the approximate co-efficients of the last
and detail co-efficients of all levels after soft thresholding are used
to reconstruct the ECG.
Step 3: The wavelet de-noised ECG is given as input to the
moving average filter of order 7
Step 4: The de-noised ECG is obtained at the final output after
de-noising by the wavelet and moving average filter.
32. Method III: ECG de-noising using wavelet with
moving average filter
March 10, 2017
32
(a) Noisy ECG signal, (b) De-noised ECG signal after using wavelet and moving average filter and (c) Superimposition of input
noisy ECG signal of (a) and reconstructed signal after applying wavelet and moving average filter of (b)
33. SNR for the methods Wavelet and MAF
March 10, 2017
33
ECG Record Number
Wavelet and Moving average
filter
(SNR in dB)
100 27.652
103 24.781
113 26.409
114 21.671
119 29.813
121 26.965
201 26.024
203 17.318
234 25.928
ECG01 17.801
ECG04 24.414
34. MSE for the method: Wavelet and MAF
March 10, 2017
34
ECG Record Number Wavelet and Moving average filter
(MSE)
100 1.9213 e -04
103 2.3947 e -04
113 2.0712 e -04
114 2.4812 e -04
119 1.8914 e -04
121 1.9566 e -04
201 2.1231 e -04
203 3.8942 e -04
234 2.3497 e -04
ECG01 3.4217 e -04
ECG04 1.8112 e -04
35. Summary
March 10, 2017
35
The possible reasons for these wavelet based methods to be
effective only for power-line noises in ECG are given below :
The power line interference is narrow-band noise centered at 50 Hz
or 60 Hz with a bandwidth of less than 1Hz and the useful
information in ECG is contained in the frequency of 0.5 Hz - 45 Hz
The use of wavelets to de-noise ECG by decomposing the into
three levels removes the power line frequency of 50 Hz or 60 Hz.
Wavelet based de-noising requires the selection of suitable wavelet
denoising parameters for the success electrocardiogram signal
filtration in wavelet domain
36. Summary
March 10, 2017
36
Wavelet Transform and MAF have removed the baseline and power
line noise effectively in the ECG signal.
Wavelet Transform removes the power line and MAF removes the
baseline noise from the ECG signal.
37. (a) Input ECG (b) De-noised ECG and (c)
error obtained using wavelet de-noising for
ECG100
March 10, 2017
37
38. SNR and MSE values for Wavelet based
ECG de-noising
March 10, 2017
38
ECG
Record
number
SNR
(in dB)
MSE
100 18.6231 4.3456 e -04
103 20.3215 3.6112 e -04
113 20.6286 3.6093 e -04
114 19.9831 3.7621 e -04
119 21.7861 3.0038 e -04
121 21.3048 3.2912 e -04
201 26.3668 2.8917 e -04
203 14.5414 4.5626 e -04
234 19.6314 4.0953 e -04
ECG01 10.4014 4.8591e -04
ECG04 16.8415 4.3802 e -04
39. Multiwavelets (contd..)
39
Instead of one scaling function and one wavelet, multiple scaling
functions and wavelets are used.
Leads to more degree of freedom i.e more number of independent
samples to be used for reconstruction.
March 10, 2017
40. Multiwavelets (contd..)
March 10, 2017
40
Multiwavelets have properties such as compact support (value of
wavelet is 0 after a time interval a-b), orthogonality, symmetry and
vanishing moments (decay towards low frequency) when compared
to scalar wavelets.
The increase in the degree of freedom in multiwavelets is obtained at
the expense of replacing scalars with matrices, scalar functions with
vector functions and single matrices with block of matrices
43. SNR and MSE values for Multiwavelet based
ECG de-noising
March 10, 2017
43
ECG
Record
Number
SNR
(in dB)
MSE
100 24.9531 2.7802e -04
103 29.9125 2.3381 e -04
113 30.9861 1.9903 e -04
114 33.0423 1.4710 e -04
119 24.3102 2.8632 e -04
121 29.9025 2.3499 e -04
201 26.5337 2.4119 e -04
203 18.8351 3.4671 e -04
234 26.5183 2.5004 e -04
ECG01 15.3892 3.5226 e -04
ECG04 22.7168 2.9284 e -04
44. Statistical analysis of SNR for de-noising ECG
signals using wavelets and multiwavelets
March 10, 2017
44
There is an average increase of 6.6064 dB in terms of SNR
with a 34.53% increase in the performance of multiwavelets
over that of wavelets for the various ECG records.
Name of the technique
Wavelet Multiwavelet
Parameters
of SNR
( in dB)
Mean 19.1299 25.7363
Variance 15.1536 28.3428
Standard
Deviation
4.1417 5.3238
45. Summary
March 10, 2017
45
The possible reasons for these wavelet based methods to be
effective only for power-line noises in ECG are given below:
The power line interference is narrow-band noise
centered at 50 Hz or 60 Hz with a bandwidth of less
than 1Hz and the useful information in ECG is
contained in the frequency of 0.5 Hz - 45 Hz (
Nagendra et al 2011).
The use of wavelets to de-noise ECG by
decomposing the into three levels removes the power
line frequency of 50 Hz or 60 Hz.
46. Summary
March 10, 2017
46
Wavelet based de-noising requires the selection of suitable wavelet
de-noising parameters for the success electrocardiogram signal
filtration in wavelet domain
Multiwavelets are faster in decomposition and have good symmetry
properties.
Even though the performance of wavelets and multiwavelets are
greater than the adaptive filter method, wavelet transforms ignore
polynomial components of the signal up to the approximation order of
the basis.
It is also found that the wavelet and multiwavelet de-noising removes
power line noise alone from the ECG, but not the baseline noise.
47. EEG
The electroencephalogram (EEG) is a recording of the electrical
activity of the brain from the scalp.
The first recordings were made by Hans Berger in 1929
The systematic approach of recognition, source identification, and
elimination of artifact is an important process to reduce the chance of
misinterpretation of the EEG and limit the potential for adverse
clinical consequences
48. EEG Waves
Alpha wave -- 8 – 13 Hz.
Beta wave -- >13 Hz. (14 – 30 Hz.)
Theta wave -- 4 – 7.5 Hz.
Delta waves – 1 – 3.5 Hz.
60. EEG Electrodes
Each electrode site is labeled with a letter and a
number.
The letter refers to the area of brain underlying the
electrode
e.g. F - Frontal lobe and T - Temporal lobe.
Even numbers denote the right side of the head
and
Odd numbers the left side of the head.
61.
62. Montage
Different sets of electrode arrangement on the scalp by 10 – 20
system is known as montage.
21 electrodes are attached to give 8 or 16 channels recording.
63. Factor influencing EEG
Age
Infancy – theta, delta wave
Child – alpha formation.
Adult – all four waves.
Level of consciousness (sleep)
Hypocapnia(hyperventilation) slow & high
amplitude waves.
Hypoglycemia
Hypothermia
Low glucocorticoids
Slow waves
64. Eye opening
Alpha rhythm changes to beta on eye opening (desynchronization /
α- block)
66. Use of EEG
Epilepsy
Generalized seizures.
Localize brain tumors.
Sleep disorders (Polysomnography- EEG activity together with
heart rate, airflow, respiration, oxygen saturation and limb movement)
Sleep apnea syndrome
Insomnia
Helpful in knowing the cortical activity
Determination of brain death.
Flat EEG(absence of electrical activity) on two records
run 24 hrs apart.
68. The artifact occurs with maximum amplitude and clearest QRS
morphology over the temporal regions and often is better formed and
larger on the left side.
The R wave is most prominent in channels that include the ear
electrodes.
Cardiac artifact
70. ECG artifact may occur inconsistently by not being present with every
contraction of the heart and may have an irregular interval when a
cardiac arrhythmia is present.
In either situation, it may be identified by its temporal association with
the QRS complexes in an ECG channel.
Cardiac pacemakers produce a different electrical artifact.
it is distinct from ECG artifact in both distribution and morphology.
Pacemaker artifact is generalized across the scalp and comprises high
frequency
72. Types:
Electrode pop
Electrode contact
Electrode/lead movement
Perspiration
Salt bridge
Movement artifact
Electrode artifact
73. Electrode artifacts usually manifest as one of two disparate waveforms,
brief transients that are limited to one electrode and low frequency
rhythms across a scalp region.
The brief transients are due to either spontaneous discharging of
electrical potential that was present between the electrode or its lead.
The spontaneous discharges are called electrode pops, and they
reflect the ability of the electrode and skin interface to function as a
capacitor and store electrical charge across the electrolyte paste or gel
that holds the electrode in place.
With the release of the charge there is a change in impedance, and a
sudden potential appears in all channels that include the electrode.
74. Poor electrode contact or lead movement produces artifact
with a less conserved morphology than electrode pop.
The poor contact produces instability in the impedance, which
leads to sharp or slow waves of varying morphology and
amplitude.
These waves may be rhythmic if the poor contact occurs in the
context of rhythmic movement, such as from a tremor.
Lead movement has a more disorganized morphology that does
not resemble true EEG activity in any form and often includes
double phase reversal
75. Lead movement
Multiple channels demonstrate the artifact through activity that is both unusually high
amplitude and low frequency and also disorganized without a plausible field
76. The smearing of the electrode paste between electrodes to form a salt
bridge or the presence of perspiration across the scalp both produce
artifacts due to an unwanted electrical connection between the
electrodes forming a channel.
Perspiration artifact is manifested as low amplitude, undulating waves
that typically have durations greater than 2 sec; thus, they are beyond
the frequency range of cerebrally generated EEG.
Slat bridge artifact differs from perspiration artifact by being lower in
amplitude, not wavering with low frequency oscillation, and typically
including only one channel
It may appear flat and close to isoelectric.
Sweat artifact
77. Sweat artifact
This is characterized by very low-frequency (here, 0.25- to 0.5-Hz) oscillations. The
distribution here (midtemporal electrode T3 and occipital electrode O1) suggests sweat
on the left side
78. Salt bridge artifact
Activity in channels that include left frontal electrodes is much lower in amplitude and frequency
than the remaining background. The lack of these findings when viewed in a referential montage
confirms that an electrolyte bridge is present among the electrodes involved.
80. 60 Hz artifact
The very high frequency artifact does not vary and is present in the posterior central
region, which does not typically manifest muscle artifact. This example was generated
by eliminating the 60Hz notch filter.
81. Electrical noise may also result from falling electrostatically charged
droplets in an IV drip.
A spike like EEG potential results, which has the regularity of the drip.
Intravenous drips
82. Electrical devices may produce other forms of noise.
Anything with an electric motor may produce high amplitude,
irregular or spike like artifact.
This is due to the switching magnetic fields within the motor.
The artifact occurs with the motor’s activity; thus, it may be constant
or intermittent, as is the case with infusion pumps.
Mechanical telephone bells are the classic source for a more
sinusoidal form of this artifact but are increasingly a less common
source of the intermittent form of this artifact.
Electrical devices: intravenous pumps,
telephone
83. Electrical motor
The very high frequency activity suggests an electrical source, and the fixed morphology
and repetition rate indicate an external device. This was caused by an electric motor
within the pump.
84.
85. Movement during the recording of an EEG may product artifact through
both the electrical fields generated by muscle and through a movement
effect on the electrode contacts and their leads.
Although the muscle potential fields are the signals sought by
electromyographers, they are noise to electroencephaographers.
Indeed, EMG activity is the most common and significant source of
noise in EEG.
EMG activity almost always obscures the concurrent EEG because of
its higher amplitude and frequency.
EMG
86. Muscle artifact
The high amplitude, fast activity across the b/l ant. region is due to facial muscle
contraction and has a distribution that reflects the locations of the muscles generating it.
Typical of muscle artifact, it begins and ends abruptly.
89. Repetitive blinks usually appear as a sequence of the slow wave
ocular artifacts and thus resemble rhythmic delta activity.
Although ocular flutter involves vertical eye movements, it differs
from repetitive blinks by being more rapid and having lower
amplitude.
90. Eye flutter artifact
Medium amplitude, low frequency activity that is confined to the frontal poles is identified
as ocular artifact through its morphology. Compared to blink artifact, flutter artifact
typically has a lower amplitude and a more rhythmic appearance
91. Lateral eye movement
Although a horizontal, frontal dipole is the key finding with lateral eye movements, the
artifact is also distinguished by its morphology, which has a more abrupt transition
between the positive and negative slopes that blinks and most flutter.
92. Artifacts are usually easily recognized by experienced EEGer.
The process of visual analysis and digital filtering allow
identification of most physiologic and nonphysiologic artifacts.
Digital filters can be applied and removed multiple times, and
can significantly improve interpretation of EEG contaminated by
artifacts by allowing specific frequencies to be removed from the
digital display.
Artifact detection and rejection
94. If the analysis is restricted to certain frequency bands, an
automated algorithm can be designed to only analyze activity in
this frequency band.
For ex., a 1 to 20Hz band pass may be used to remove muscle
artifact.
This method is not very useful for analysis of the entire
bandwidth of EEG, as artifacts can occur at any frequency.
Even for very narrow frequency bands, there may be significant
artifact remaining after band pass filtering.
The process of filtering may significantly alter the appearance of
EEG and make subsequent identification of artifacts more
difficult.
Use of Band Pass Filters:
95. In this case, a technologist or EEGer visually reviews the entire
EEG recording and marks segments with artifacts.
This is a reliable method, and may detect some artifact that
would be missed by automated techniques.
It is time consuming, however, and reader fatigue may become
problematic for long or multichannel recordings.
Subtle or brief artifacts may not be identified, and different
readers may have different thresholds for rejection.
This method is only possible for offline(not real time) digital
analysis.
Manual rejection of artifact
segments:
96. This technique rejects short segments of EEG if the segment
exceeds predefined thresholds.
These thresholds can be simple analysis of the EEG channels
themselves such as amplitude, numbers of zero crossings, or
60Hz artifact.
If a segment shows very high amplitude, it is eliminated.
Some techniques use other special electrodes to identify artifact
signals, such as EOG,EMG, EKG or accelerometers.
If the signal in these channels exceeds a threshold, the segment
of EEG will be rejected.
Automatic rejection of artifact
segments:
97. 97
EEG DATA
EEG DATA and EEGLAB Toolbox is obtained from
Swartz Center for Computational Neuroscience,
Institute for Neural Computation,
University of California San Diego
EEG DATA:
http://sccn.ucsd.edu/~arno/fam2data/publicly_available
_EEG_data.html
EEGLAB Toolbox:
http://sccn.ucsd.edu/eeglab/
98. 98
STEPS IN DENOISING EEG
Apply
Wavelet
Transform
Threshold
the Noisy
Wavelet coefficients
Apply
Inverse
Wavelet
Transform
Noisy
EEG
Wavelet
coefficients
Signal
coefficients
Denoised
EEG