% Example of header and annotation files reading for MIT record clear dirhea='/net/tsccd/cd/stdb/edb/'; dirsig='/net/tsccd/cd/stdb/edb/'; dirann='/net/tsccd/cd/stdb/edb/'; ecgnr='e0104'; anot='atr'; %t=[1 40000]; t=[]; heasig=readheader([dirsig ecgnr '.hea']); if isempty(t) t=[1 heasig.nsamp-0.1*heasig.freq]; end nlat=30; % number of beats to be processed each processing segment annot=readannot([dirann ecgnr '.' anot],heasig,t); % OPEN FILES FOR SIGNAL %fid=opensig(dirsig,heasig); % remove of non-QRS annotations and first beat annot=isqrs(annot,heasig,t); if isempty(annot.time), disp('no events detected'), return, end no_beats=size(annot.time,1); rr=diff(annot.time); time=t(1); ilat=1;nlat=min(nlat,size(annot.time,1)); while ilatlength(annot.time) step=annot.time(nlat)+heasig.freq; else step=annot.time(ilat+nlat-1); end SIGNAL=getvec(1,heasig,time,step,dirsig); [ns no_leads]=size(SIGNAL); % # of samples and leads % BASELINE WANDERING WITH HIGH PASS FILTERING %SIGNALb=baseline(SIGNAL,heasig.freq,1); %SIGNAL=round(SIGNAL); plot(SIGNAL); pause; ilat=ilat+nlat; nlat=min(nlat,no_beats-ilat+1); % # beats for next loop time=annot.time(ilat-1)-heasig.freq; end % FILES CLOSING fclose('all');