资源简介
应用于心电信号的提取,R波检测,不过要自己好好研究
代码片段和文件信息
%可自动检测RSRR间期;如果你仔细研究代码还会发现它能自动检测QRS
%[hrv R_t R_amp R_index S_t S_amp] = ECGpeak(一维心电数据A/D转换率);
%代码:
data=load(‘Ecgdata.txt‘);
samp_freq=0;
[hrv R_t R_amp R_index S_t S_amp] = ECGpeak(datasamp_freq)
% [hrv R_t R_amp R_index S_t S_amp] = ECGpeak(data samp_freq);
% R_t == RR points in time;
% R_amp == amplitude of R peak in bpf data;
% S_amp == amplitude of following minmum;
thresh = 0.2;
testmode = 1;
nargin=1
%%%%%%%%%%% make sample frequency default 256 Hz
if nargin < 2
samp_freq = 256;
if(testmode==1)
fprintf(‘Assuming sampling frequency of %iHz\n‘samp_freq);
end
end
%%%%%%%%%%% check format of data %%%%%%%%%%
[a b] = size(data);
if(a>b)
len =a;
end
if(b>a)
len =b;
end
%%%%%%%%%% if there‘s no time axis - make one
if (a | b == 1);
% make time axis
tt = 1/samp_freq:1/samp_freq:ceil(len/samp_freq);
t = tt(1:len);
x = data;
end
%%%%%%%%%% check if data is in columns or rows
if (a == 2)
x=data(:1);
t=data(:2);
end
if (b == 2)
t=data(:1);
x=data(:2);
end
%%%%%%%%% bandpass filter data - assume 256hz data %%%%% y
% remove mean
x = x-mean(x);
% FIR filtering stage
bpf=x; %Initialise
if( (samp_freq==128) & (exist(‘filterECG128Hz‘)~=0) )
bpf = filterECG128Hz(x);
end
if( (samp_freq==256) & (exist(‘filterECG256Hz‘)~=0) )
bpf = filterECG256Hz(x);
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%% differentiate data %%%%%%%%%%%%%%%%%%%%%%%%%%% F
dff = diff(bpf); % now it‘s one datum shorter than before
%%%%%%%%%square data %%%%%%%%%%%%%%%%%%%%%%%%%%%
sqr = dff.*dff;
len = len-1; % how long is the new vector now?
%%%%%%%%% integrate data over window ‘d‘ %%%%%%%%%%%%%%%%%%%%%%%%%
d=[1 1 1 1 1 1 1]; % window size - intialise
if (samp_freq>=256) % adapt for higher sampling rates
d = [ones(1round(7*samp_freq/256))];
end
% integrate
mdfint = medfilt1(filter(d1sqr)10);
% remove filter delay for scanning back through ECG Z“ ~.Y@]@T
delay = ceil(length(d)/2);
mdfint = mdfint(delay:length(mdfint));
%%%%%%%%% segment search area %%%%%%%%%%%%%%%%%%%%%%%
- 上一篇:一种pid控制跟踪SIN函数的
- 下一篇:matlab实现经典功率谱估计
相关资源
- matlab_OFDM调制解调(来自剑桥大学)
- Matlab路面裂缝识别69319
- 高灵敏度GPS接收机MATLAB仿真,附捕获
- 基于MATLAB的质点弹道计算与外弹道优
- 阵列天线的matlab仿真
- MATLAB 经典程序源代码大全
- MATLAB小波软阈值去噪代码33473
- 天线阵的波束形成在MATLAB仿真程序及
- 非线性SVM算法-matlab实现
- 《MATLAB 智能算法超级学习手册》-程序
- 组合导航matlab程序
- 读取txt文件内容matlab代码实现
- Matlab实现基于相关的模板匹配程序
- matlab优化工具箱讲解
- 基于MATLAB的快速傅里叶变换
- 光纤传输中的分布傅立叶算法matlab实
- 基于matlab的图像处理源程序
- matlab 椭圆拟合程序
- 算术编码解码matlab源代码
- optical_flow 光流法 matlab 实现程序
- 引导图像滤波器 Matlab实现
- 分形几何中一些经典图形的Matlab画法
- OFDM系统MATLAB仿真代码
- SVM工具箱(matlab中运行)
- 图像小波变换MatLab源代码
- LU分解的MATLAB实现
- 冈萨雷斯数字图像处理matlab版(第三
- 替代数据法的matlab程序
- 用matlab实现的多站定位系统性能仿真
- 通过不同方法进行粗糙集属性约简m
评论
共有 条评论