资源简介
应用于心电信号的提取,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实现经典功率谱估计
- KCF (Kernelized Correlation Filters)Matlab源
- matlab实现基本的二值形态学运算
- 熵权法求各个指标的权重
- MATLAB 数据格式转换函数汇总
- matlab在光纤中的应用
- matlab提取语音信号基频检测
- 惯导工具箱Matlab程序含详细说明文档
- 基于MATLAB的外弹道系统仿真
- 利用MATLAB实现AMI、HDB3码-画图
- 循环码matlab程序
- 宽带信号DOA估计
- MATLAB机器人圆弧轨迹插补算法
- matlab_人眼疲劳监测.rar
- Kruskal算法 matlab实现
- labview与matlab接口
- DSSS matlab仿真程序
- matlab绘制线阵方向图
- MATLAB曲线拟合代码
- matlab在通信中的应用代码
- 最小功率路由matlab仿真
- 数字图像处理图像分割matlab算法代码
- 系统仿真实验matlab_中国石油大学
- Butterworth滤波器Matlab代码
- 阵列信号处理的理论和应用原书的m
- 基于Matlab的有限元程序
- 基于matlab,gui的人脸识别(PCA)
- MATLAB在时间序列建模预测及程序代码
- matlab实现BP预测数据
- 滑模变结构控制MATLAB仿真第3版:基本
评论
共有 条评论