heart rate detection using ecg
4 次查看(过去 30 天)
显示 更早的评论
this is my code for heart rate detection but i am getting ouput has single continuous line like -------------------------------,anyone please help me to sort out this problem
y=load('ecg.txt');
plot(y);
h=fir1(1000,1/1000*2,'high');
y_filter=filter(h,1,y);
plot(y_filter);
ds=y_filter.^2;
plot(ds);
last=0;
upflag=0;
pulse=zeros(length(ds),1);
for i=1:length(ds)
if(ds(1)>0.1)
if(upflag==0)
if(last>0)
t=i-last;
p=1000/t*60;
end
last=i;
end
upflag=100;
else
if(upflag>0)
upflag=upflag-1;
end
end
pulse(i)=p;
end
plot(pulse);
0 个评论
回答(1 个)
Amin Beshir
2021-4-2
57
1 个评论
Image Analyst
2021-4-3
How did you get that? He didn't even post any data. He forgot to attach 'ecg.txt'.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 ECG / EKG 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!