联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp

您当前位置:首页 >> Matlab编程Matlab编程

日期:2018-07-28 08:02

clear all

close all

load necg

%% load data

ecg=s103_c;

%parameter

%例子中采样率360Hz,我们用的是100Hz

fs=360;

%time vector

len=length(ecg);

t=1/fs:1/fs:len/fs;

%%

plot(t,ecg)

xlabel('time/s')

ylabel('ECG')

%pick 3~5s of the data and do self-correlation

%in this case we choose 3s, which is 1080 samples

sl=3*fs;

t=t(1:sl);

ecg=ecg(1:sl);

for i=1:sl/2

   sc(i)=ecg(1:sl/2)*ecg(i:sl/2+i-1)';

end

figure

plot(t(1:sl/2),sc)

xlabel('time/s')

ylabel('sc')

%the peak of the sc exists at 0.86s

%which means the average heart rate during(1s~3s)is 1/0.86s (~70b/min)

%寻找最大值可以在一定范围内寻找,具体范围根据生活中正常心率范围定


版权所有:留学生编程辅导网 2020 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp