ensembleNonCorrelatedDetector

PURPOSE ^

ensembleNonCorrelatedDetector - Analyses an ECG signal and estimated

SYNOPSIS ^

function nonCorrelated = ensembleNonCorrelatedDetector( detrended_sig, R_locs, minCorrelation, windowSize )

DESCRIPTION ^

ensembleNonCorrelatedDetector - Analyses an ECG signal and estimated
 R-peak locations to determine which might be noisy.

 Process:
   1. construct an average beat over all the beats
   2. each beat is compared to the average beat
   3. If the static correlation is < minCorrelation, the beat is marked as
       noisy

 Inputs:
    detrended_sig detrended ecg signal
    R_locs the detected peaks
    minCorrelation between 0 and 1
    windowSize in samples

 Outputs:
    nonCorrelated boolean array (1 for errors)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function nonCorrelated = ensembleNonCorrelatedDetector( detrended_sig, R_locs, minCorrelation, windowSize )
0002 %ensembleNonCorrelatedDetector - Analyses an ECG signal and estimated
0003 % R-peak locations to determine which might be noisy.
0004 %
0005 % Process:
0006 %   1. construct an average beat over all the beats
0007 %   2. each beat is compared to the average beat
0008 %   3. If the static correlation is < minCorrelation, the beat is marked as
0009 %       noisy
0010 %
0011 % Inputs:
0012 %    detrended_sig detrended ecg signal
0013 %    R_locs the detected peaks
0014 %    minCorrelation between 0 and 1
0015 %    windowSize in samples
0016 %
0017 % Outputs:
0018 %    nonCorrelated boolean array (1 for errors)
0019 
0020 
0021 nonCorrelated = zeros(1,length(R_locs));
0022 
0023 avg = zeros(1,(2*windowSize+1));
0024 
0025 left = R_locs-windowSize;
0026 right = R_locs+windowSize;
0027 
0028 parfor i=1:length(R_locs)
0029     leftIndex = left(i);
0030     rightIndex = right(i);
0031     if(leftIndex < 0 || rightIndex > length(R_locs))
0032         continue;
0033     end
0034     complex = detrended_sig(leftIndex:rightIndex);
0035     avg = avg + complex;
0036 end
0037 
0038 avg = avg./length(R_locs);
0039 
0040 parfor i=1:length(R_locs)
0041     leftIndex = left(i);
0042     rightIndex = right(i);
0043     if(leftIndex < 0 || rightIndex > length(detrended_sig))
0044         continue;
0045     end
0046     complex2 = detrended_sig(leftIndex:rightIndex);
0047     corrCoeff = corrcoef(complex2, avg);
0048     if(corrCoeff(1,2) > minCorrelation)
0049         continue
0050     else
0051         nonCorrelated(i) = 1;
0052     end
0053 end
0054 
0055 
0056 
0057 
0058 end
0059

Generated on Thu 15-Mar-2018 13:51:08 by m2html © 2005