Digital Signal Processing Reference
In-Depth Information
Start
threshold=0.5
zerocrossing=0
Get enhanced ECG data array x(n)
with N data
pre_sign=-1 and cur_sign=-1
get x(n) and x(n-1)
if x(n-1))>threshold then pre_sign=1
if x(n)>threshold then cur_sign=1
zerocrossing=zerocrossing+
abs(cur_sign-pre_sign)/2
No
n=n+1
is n=N ?
Yes
Stop
FIGURE 8.46
A simple zero-crossing algorithm.
6
2
60
1 ; 500
600
Heart rate ¼
¼ 72 pulses per minute
The MATLAB implementation of the zero-crossing detection can be found in the last part in
Program 8.16.
Program 8.16. MATLAB program for heart rate detection using an ECG signal.
load ecgbn.dat; % Load noisy ECG recording
b1
[0.9803 -1.5862 0.9803]; %Notch filter with a notch frequency of 60 Hz
a1 ¼ [1 -1.5842 0.9586];
b2 ¼ [0.9794 -0.6053 0.9794]; % Notch filter with a notch frequency 120 Hz
a2 ¼ [1 -0.6051 0.9586];
b3 ¼ [0.9793 0.6052 0.9793]; % Notch filter with a notch frequency of 180 Hz
a3 ¼ [1 0.6051 0.9586];
y1 ¼ filter(b1,a1,ecgbn); % First section filtering
y2 ¼ filter(b2,a2,y1);
¼
% Second section filtering
y3 ¼ filter(b3,a3,y2);
% Third section filtering
%Bandpass filter
fs ¼ 600;
% Sampling rate
T ¼ 1/600;
% Sampling interval
% BLT design
wd1 ¼ 2*pi*0.25;
 
Search WWH ::




Custom Search