Signal Processing, Filtering, and Noise

Report
EE93 – Medical Mobile Devices
and Apps
60
98
30
bpm
%
rpm
Lecture: Instrumentation & DSP
ECG Waveform on Strip Chart
12-lead – showing in 4 columns by 3 rows
One heartbeat cycle
5 mm by 5 mm
reference square
0,200 s duration by
0.5 mV amplitude
1 mm by 1 mm
reference square
0,040 s duration by
0.1 mV amplitude
EE93 – Mobile Medical Devices and Apps
1 mV, 10 mm high reference pulse
Length: 0.200 s
2
Measuring ECG (3-Lead)
• 3-lead ECG uses right
arm (or chest), left arm
(or chest) and left foot
• Able to obtain PQRST
wave
• Unable to obtain other
leads and heart angle
60
98
30
bpm
%
rpm
Source for ECG slides: Computing the Electrical Activity in
the Heart: 1 (Monographs in Computational Science and
Engineering) by Joakim Sundnes, Glenn Terje Lines, Xing
Cai and Bjørn Frederik Nielsen (2007)
EE93 – Mobile Medical Devices and Apps
3
Common Frequencies for ECG
•
•
•
•
•
Heart rate: 0.67 to 5 Hz (40 to 300 bpm)
P-wave: 0.67 to 5 Hz
QRS Complex: 10 to 50 Hz
T-wave: 1 to 7 Hz
High frequency potentials: 100 to 500 Hz
EE93 – Mobile Medical Devices and Apps
4
Common Frequencies for ECG Artifacts & Noise
•
•
•
•
Muscle: 5 Hz to 50 Hz
Respiratory: 0.12 to 0.5 Hz (8 to 30 bpm)
External Electric: 50 Hz or 60 Hz (AC Line)
Other Electrical: > 10 Hz (muscle stimulators,
magnetic fields, pacemakers with impedance
monitoring)
EE93 – Mobile Medical Devices and Apps
5
ECG Special Notes
• Skin-electrode interface – largest source of
interference – produces 200 to 300 mV
• Skin-electrode interference is magnified by
motion (patient movement, respiratory
variation)
• Electrical activity of heart – 0.1 to 2 mV
EE93 – Mobile Medical Devices and Apps
6
Power Spectra of ECG
Relative power spectra
of QRS complex, P and T
waves, muscle noise
and motion artifacts
based upon an average
of 150 bpm
Source: http://www.ems12lead.com/wp-content/uploads/sites/42/2014/03/ecg-component-frequencies.jpg
EE93 – Mobile Medical Devices and Apps
7
ECG Amplifier
+
+
V1
V2
EE93 – Mobile Medical Devices and Apps
8
Signal & Noise Model
Vnoise
Vsignal
+
-
Vsignal + Vnoise
EE93 – Mobile Medical Devices and Apps
9
Instrumentation Amplifier
+
V1
–
R4
R3
R2
–
R1
+
Vout
R2
R3
R4
–
V2
+
EE93 – Mobile Medical Devices and Apps
10
Instrumentation Amplifier (IA)
• Provides capability to:
– Reject common-mode signal components (noise &
interference, undesired DC offsets)
– Amplifies differential-mode signal
• In practice, rejection of common-mode signal
is not complete  common-mode rejection
ration (CMRR)
Adifferential-mode
CMRR=
Acommon-mode
EE93 – Mobile Medical Devices and Apps
11
Instrumentation Amplifier (IA)
• Provides impedance isolation between bridge
transducers and differential amplifier stage
• Signals V1 and V2 are amplified separately
• Conditions the signals
• Provide high CMRR if implemented with
diligence
EE93 – Mobile Medical Devices and Apps
12
Instrumentation Amplifier
+
V1
–
R4
R3
R2
–
R1
Vout
+
R2
R3
R4
Vout =
R4 æ 2R2 ö
1+
V2 - V1 )
(
ç
÷
R3 è
R1 ø
–
V2
+
R2
2R2
A1st = 1+
= 1+
R1
R1
2
R4
A2nd =
R3
EE93 – Mobile Medical Devices and Apps
13
Level Shifter
+
–
• Wide spread
Rs
use in
medical
V+
applications
• Adds or
subtracts a
Vref +
DC offset to
or from
signal
RF
EE93 – Mobile Medical Devices and Apps
Vout
14
Signal Processing
Pulse
Indicator
Instrumentation
Amplifier
ECG with
Noise
High
Pass
Filter
Signal
Processing
Stop Band
Filter
EE93 – Mobile Medical Devices and Apps
WiFi
Square
Signal
Patient
Monitor
Pulse Detect
15
DSP
N
M
i=1
i=0
y[n]+ å ai y[n - i] = å bi x[n - i]
 IIR Filter
M
y[n] = å bi x[n - i]
i=0
 FIR Filter
EE93 – Mobile Medical Devices and Apps
16
Filter Specification
H dB = 20log10 ( H(w ) )
20 log10 (1+ d 2 )
“Ripple”
20 log10 (1- d 2 )
“Effective edge of the filter”
wP + wS
wC =
2
20 log10 (1+ d1 )
“Ripple”
20 log10 (1- d1 )
wS wC wP
EE93 – Mobile Medical Devices and Apps
17
DSP Notes
• IIR filter – has infinite impulse response  need to limit
• FIR filter – has finite impulse response  hf[n] = 0, n ≥ 0
• FIR filter advantages:
–
–
–
–
–
Can have exact linear phase
Always stable (even under quantization)
Design methods are reasonable linear
Realize efficiently in hardware or software
Transients have finite duration
• Disadvantages
– Requires higher filter order that IIR to achieve similar
performance
– Delay is typically greater in FIR than IIR counterpart
EE93 – Mobile Medical Devices and Apps
18
FIR Filter Design Notes
• IIR: H[Ω] = desired IIR filter with impulse
h[n]
ìï h[n], 0 £ n £ N -1
• FIR: hd [n] = í
otherwise
ìï h[n],
• Transfer function: hd [n] = í
ïî 0,
ïî
0,
0 £ n £ N -1
otherwise
N -1
• DTFT:
H d [W] = å hd [n]z - jnW
n=0
H d [W] » H[W]
EE93 – Mobile Medical Devices and Apps
19
DSP – Analytically
• hd[n] = w[n]h[n]
– Where w[n] is a window function  truncates the
signal
ìï 1, 0 £ n £ N -1
w[n] = í
otherwise
ïî 0,
– Rectangular window causes abrupt transitions
– Other windows allow gradual transitions
EE93 – Mobile Medical Devices and Apps
20
DSP – Other Windows
• Hanning:
é
æ 2p n ö ù
w[n] = ê1- cos ç
÷ø ú
è
N -1 û
ë
1
2
• Hamming:
æ 2p n ö
w[n] = 0.54 - 0.46 cos ç
è N -1÷ø
EE93 – Mobile Medical Devices and Apps
21
DSP – Windows
• Hd(Ω) better approximates H(Ω) when main lobe of filter is narrow
in bandwidth and side lobes are small in value
• Hanning and Hamming, in general have much smaller sidelobes
than rectangular window  less ripple in frequency response of FIR
filter
EE93 – Mobile Medical Devices and Apps
22
DSP – Procedure
•  signal that needs to be filtered
– Design the filter
– Normalize the Nyquist rate across the spectrum
– Generate the filter coefficients in MatLab
• Use MatLab command fir1
– Iterate until you “get an acceptable response”
• Use MatLab command filter on signal
•  signal filter in iPad
– Set up difference equation
– Use filter coefficients from fir1
– Compute filtered signal in code using add/multiply via
difference equation
– Program filter in Objective-C – rather than vDSP
framework
EE93 – Mobile Medical Devices and Apps
23

similar documents