필터 지우기
필터 지우기

(Food for Thought) Peak Detection on ECG signal

조회 수: 3 (최근 30일)
Lok Yiu To
Lok Yiu To 2019년 6월 21일
댓글: lt c 2022년 2월 28일
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.

채택된 답변

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.
  댓글 수: 1
lt c
lt c 2022년 2월 28일
I'm new to matlab. Without annotation, I'm not fully understand your work.
1. what does "t(idx) = []; y(idx) = []; % drop start-u transients" mean?
I try to google start-u transients, unfortunately get start-up transients.
2. Also, what does following lines get us?
if y(i) >= max(yr) && pauseOn && (i > pk(end)+50)
pk = [pk;i];
pauseOn = true;
Do not mind me asking questions that may seem pretty simple to others, thank you.
Cheers

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by