【心电信号】心电图峰值检测附Matlab代码
作者:互联网
1 简介
本文涉及一种心电图波形峰值检测方法,包括如下步骤:对心电图波形进行预处理;计算所述心电图波形采样点的余弦值,得到三角余弦序列;根据所述三角余弦序列检测波峰位置;对上述波峰位置进行校正确认,排除不是峰值的点.本文还涉及一种心电图波形峰值检测系统.本文能够快速准确地检测心电图波形特别是QRS波的峰值位置,有效降低医生的工作负荷.
2 部分代码
%% SOLUTION 4:
clc;
clear all;
close all;
ecg=load('12-2-2016 17.53.13.txt');
f_s=250;
N=length(ecg);
t=[0:N-1]/f_s; %time period(total sample/Fs )
figure
plot(t,ecg,'r'); title('Raw ECG Data plotting ')
xlabel('time')
ylabel('amplitude')
w=50/(250/2);
bw=w;
[num,den]=iirnotch(w,bw); % notch filter implementation
ecg_notch=filter(num,den,ecg);
[e,f]=wavedec(ecg_notch,10,'db6');% Wavelet implementation
g=wrcoef('a',e,f,'db6',8);
ecg_wave=ecg_notch-g; % subtracting 10th level aproximation signal
%from original signal
plot(rr4,rr5,'r*') %plot R-R(n)(X-Axis) vs R-R(n-1)(Y-Axis)
title('POINCARE PLOT'), xlabel('RR(n+1)') ,ylabel('RR(n)')
%% Task 4-b
ki=length(rr3) ;
ahr=mean(hr); % mean heart rate;
disp(['mean hrv = ' num2str(ahr)]);
% disp is used to display the value(s);
SDNN = std(rr3);
% SDNN, standard deviation for RR interval used in statical analysis;
disp(['SDNN = ' num2str(SDNN)]);
sq = diff(rr3).^2;
rms = sqrt(mean(sq)); % RMSSD,
disp(['RMSSD = ' num2str(rms)]);
% RMS difference for RR interval used in statical analysis;
NN50 = sum(abs(diff(rr3))>.05);
% NN50 no. of pairs of RR that is more than 50, used in statical analysis;
disp(['NN50 = ' num2str(NN50)]);
%% Try 4/3
%figure,
%comet(ecg_smooth(1:1000))
3 仿真结果
4 参考文献
[1]张高登, 董军. 心电图波形峰值检测方法及系统:, CN104939821A[P].
博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。
部分理论引用网络文献,若有侵权联系博主删除。
标签:ecg,disp,峰值检测,波形,RR,SDNN,心电图,Matlab 来源: https://blog.csdn.net/Matlab_dashi/article/details/122592279