


getOfficialResultsShort Cuts the desired input signal and leaves the proportion requested
Input:
recordName can be absolute or relative to working directory
proportion
Outputs:
R_locs is the array of annotated beats
ecg_sig is ecg signal
Example:
[R_locs, ecg_sig] = getOfficialResultsShort('infant1ecg', 0.1);

0001 function [R_locs, ecg_sig] = getOfficialResultsShort( recordName, proportion ) 0002 %getOfficialResultsShort Cuts the desired input signal and leaves the proportion requested 0003 % Input: 0004 % recordName can be absolute or relative to working directory 0005 % proportion 0006 % Outputs: 0007 % R_locs is the array of annotated beats 0008 % ecg_sig is ecg signal 0009 % 0010 % Example: 0011 % [R_locs, ecg_sig] = getOfficialResultsShort('infant1ecg', 0.1); 0012 % 0013 0014 load(recordName + ".mat"); 0015 data = eval(recordName); 0016 0017 if(isfield(data, 'R_locs')) 0018 R_locs = data.R_locs; 0019 else 0020 R_locs =[]; 0021 end 0022 0023 sig = data.data; 0024 0025 newSize = floor(length(sig) * proportion); 0026 0027 ecg_sig = sig(1:newSize); 0028 indexLastRLoc = 1; 0029 while(indexLastRLoc < length(R_locs)) 0030 if(R_locs(indexLastRLoc+1) >= newSize) 0031 break; 0032 end 0033 indexLastRLoc = indexLastRLoc + 1; 0034 end 0035 0036 R_locs = R_locs(1:indexLastRLoc);