MATLAB Answers

(Food for Thought) Peak Detection on ECG signal

8 ビュー (過去 30 日間)
Lok Yiu To
Lok Yiu To 2019 年 6 月 21 日
回答済み: David Wilson 2019 年 6 月 21 日
Hey guys,
I've been working on a ECG signal collected during exercise through my chest mount heart rate monitor. My goal is to accurately detect the location of the R-wave. (For those who are new to ECG signal, R-wave is the narrow peak similar to the ones I circled in red.) Can you guys suggest any method for preprocessing the data so that it will be easier to extract the signal? Like anything! I am just trying to learn new skills right now
I have tried wavelet transform but I am not getting any luck. Come on guys, show me the power of the internet! haha
if you want to try it out, this is the data.
The sampling frequency is 150 Hz.

  0 件のコメント

サインインしてコメントする。

採用された回答

David Wilson
David Wilson 2019 年 6 月 21 日
OK, here's my (ugly) solution (withou using findpeaks). I've re-named your data set, and did some pre-processig.
load ecg
y = ecgSamplePreProc;
Ts = 1/150; % sampling freq = 150 Hz;
t = Ts*[0:length(y)-1]';
%% Do some preliminary cleaning
idx = [1:600];
t(idx) = []; y(idx) = []; % drop start-u transients
y = y - mean(y); % remove any bias
plot(t,y,'.-')
Now we are ready to identify the peaks. (I'm not sure if that's the same as your R-wave, but it's a start.)
n = length(y);
thresh = 0.7;
pauseOn = false;
irange = [-5:5];
pk = [1];
pauseOn = true;
for i=10:n-10
if y(i) > thresh
yr = y(i+irange);
if y(i) >= max(yr) && pauseOn && (i > pk(end)+50)
pk = [pk;i];
pauseOn = true;
end
if y(i) < -thresh
pauseOn = false;
end % if
end
end
plot(t,y, ...
t(pk), y(pk), 'ro')
yline(thresh,'--','color',0.5*[1,1,1])
The results look like:
tmp.png
and a zoomed version is:
tmp2.png
Of course you could try findpeaks as well.

  0 件のコメント

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by