-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathisnormal.m
42 lines (38 loc) · 1022 Bytes
/
isnormal.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
function [annot,rr]=isnormal(annot,heasig,t,rr)
% Extraction of beats labeled as NORMAL with NORMAL adjacents in the annotation file
% function [annot,rr]=isnormal(annot,heasig,t,rr)
%
% Copyright (c), Jose Garcia Moros, Zaragoza University, Spain
% email: [email protected]
% last revision: 28 Apr 1997
aux=find(annot.anntyp~='N');
auxm=unique([aux-1;aux;aux+1]);
excl=[-1,0,length(annot.time),length(annot.time)+1];
auxm=setdiff(auxm,excl);
if (~isempty(auxm))
annot.anntyp(auxm)=[];
annot.time(auxm)=[];
annot.num(auxm)=[];
annot.subtyp(auxm)=[];
annot.chan(auxm)=[];
if isfield(annot,'aux')
if ~isempty(annot.aux)
annot.aux(auxm,:)=[];
end
end
rr(auxm)=[];
end
auxm=find(annot.time<t(1) | annot.time>(t(2)+heasig.freq) );
if (~isempty(auxm))
annot.anntyp(auxm)=[];
annot.time(auxm)=[];
annot.num(auxm)=[];
annot.subtyp(auxm)=[];
annot.chan(auxm)=[];
if isfield(annot,'aux')
if ~isempty(annot.aux)
annot.aux(auxm,:)=[];
end
end
rr(auxm)=[];
end