资源简介
Pan_Tompkins_ECG_v5.zip
代码片段和文件信息
function [qrs_amp_rawqrs_i_rawdelay]=pan_tompkin(ecgfsgr)
%% function [qrs_amp_rawqrs_i_rawdelay]=pan_tompkin(ecgfs)
% Complete implementation of Pan-Tompkins algorithm
%% Inputs
% ecg : raw ecg vector signal 1d signal
% fs : sampling frequency e.g. 200Hz 400Hz and etc
% gr : flag to plot or not plot (set it 1 to have a plot or set it zero not
% to see any plots
%% Outputs
% qrs_amp_raw : amplitude of R waves amplitudes
% qrs_i_raw : index of R waves
% delay : number of samples which the signal is delayed due to the
% filtering
%% Method :
%% PreProcessing
% 1) Signal is preprocessed if the sampling frequency is higher then it is downsampled
% and if it is lower upsampled to make the sampling frequency 200 Hz
% with the same filtering setups introduced in Pan
% tompkins paper (a combination of low pass and high pass filter 5-15 Hz)
% to get rid of the baseline wander and muscle noise.
% 2) The filtered signal
% is derivated using a derivating filter to high light the QRS complex.
% 3) Signal is squared.4)Signal is averaged with a moving window to get rid
% of noise (0.150 seconds length).
% 5) depending on the sampling frequency of your signal the filtering
% options are changed to best match the characteristics of your ecg signal
% 6) Unlike the other implementations in this implementation the desicion
% rule of the Pan tompkins is implemented completely.
%% Decision Rule
% At this point in the algorithm the preceding stages have produced a roughly pulse-shaped
% waveform at the output of the MWI . The determination as to whether this pulse
% corresponds to a QRS complex (as opposed to a high-sloped T-wave or a noise artefact) is
% performed with an adaptive thresholding operation and other decision
% rules outlined below;
% a) FIDUCIAL MARK - The waveform is first processed to produce a set of weighted unit
% samples at the location of the MWI maxima. This is done in order to localize the QRS
% complex to a single instant of time. The w[k] weighting is the maxima value.
% b) THRESHOLDING - When analyzing the amplitude of the MWI output the algorithm uses
% two threshold values (THR_SIG and THR_NOISE appropriately initialized during a brief
% 2 second training phase) that continuously adapt to changing ECG signal quality. The
% first pass through y[n] uses these thresholds to classify the each non-zero sample
% (CURRENTPEAK) as either signal or noise:
% If CURRENTPEAK > THR_SIG that location is identified as a 換RS complex
% candidate?and the signal level (SIG_LEV) is updated:
% SIG _ LEV = 0.125 證URRENTPEAK + 0.875?SIG _ LEV
% If THR_NOISE < CURRENTPEAK < THR_SIG then that location is identified as a
% 搉oise peak?and the noise level (NOISE_LEV) is updated:
% NOISE _ LEV = 0.125證URRENTPEAK + 0.875?NOISE _ LEV
% based on new estimates of the signal and noise levels (SIG_LEV and NOISE_LEV
% respectively) at that point in the ECG the thresholds are adjusted as
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 18399 2014-11-12 18:07 pan_tompkin.m
文件 57226 2014-11-12 18:07 ECG_sample_noisy.mat
文件 1527 2014-11-12 18:07 license.txt
- 上一篇:altium designer 电容库
- 下一篇:广工计算机网络课设
评论
共有 条评论