2 % ADB2EVENT loads and artifact scoring file of the
3 % artifact database (ADB) of sleep EEG [1]
4 % and converts the data into
event information
6 % [s,H] =
sload(filename.edf)
7 % H.EVENT =
adb2event([H.FILE.Name,
'.txt], H.SampleRate);
9 % see also: SOPEN, SREAD, SSEEK, STELL, SCLOSE, SWRITE, SEOF
12 % [1] Artifact database of sleep EEG. Available online http://www.dpmi.tu-graz.ac.at/ADB/
13 % [2] A. Schlögl, P. Anderer, M.-J. Barbanoj, G. Klösch,G. Gruber, J.L. Lorenzo, O. Filz, M. Koivuluoma, I. Rezek, S.J. Roberts,A. Värri, P. Rappelsberger, G. Pfurtscheller, G. Dorffner
14 % Artifact processing of the sleep EEG in the "SIESTA"-project,
15 % Proceedings EMBEC'99, Part II, pp.1644-1645, 4-7. Nov. 1999,Vienna, Austria.
16 % [3] A. Schlögl, P. Anderer, S.J. Roberts, M. Pregenzer, G.Pfurtscheller.
17 % Artefact detection in sleep EEG by the use of Kalman filtering.
18 % Proceedings EMBEC
'99, Part II, pp.1648-1649, 4-7. Nov. 1999,Vienna, Austria.
19 % [4] A. Schlögl, P. Anderer, M.-J. Barbanoj, G. Dorffner, G. Gruber, G. Klösch, J.L. Lorenzo, P. Rappelsberger, G. Pfurtscheller.
20 % Artifacts in the sleep EEG - A database for the evaluation of automated processing methods.
21 % Proceedings of the Third International Congress of the World Federation of Sleep Research Societies (WFSRS). Editors: H. Schulz. P.L. Parmeggiani, and M. Chase. Sleep Research Online 1999:2 (Supplement 1), p. 586.
22 % available online: http://www.sro.org/cftemplate/wfsrscongress/indiv.cfm?ID=19998586
25 % This program is free software; you can redistribute it and/or
26 % modify it under the terms of the GNU General Public License
27 % as published by the Free Software Foundation; either version 2
28 % of the License, or (at your option) any later version.
30 % This program is distributed in the hope that it will be useful,
31 % but WITHOUT ANY WARRANTY; without even the implied warranty of
32 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 % GNU General Public License for more details.
35 % You should have received a copy of the GNU General Public License
36 % along with this program; if not, write to the Free Software
37 % Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
40 % $Id: adb2event.m 2205 2009-10-27 12:18:15Z schloegl $
41 % (C) 1997-2004 by Alois Schloegl <a.schloegl@ieee.org>
42 % This is part of the BIOSIG-toolbox http://biosig.sf.net/
46 % code from MAK2BIN.M (C) 1998-2004 A. Schlögl
47 ERG = zeros(size(ma));
49 %%%% one artifact %%%%
51 if exist('OCTAVE_VERSION
')==5
52 ERG = ERG+(ma==k)*2^k;
58 %%%% more than one artifact %%%%
62 b=int2str(ma(i(k),j(k)));
65 if any(b==L(l)), erg=erg+2^l; end;
77 for c = 1:7;%size(ERG,2),
78 tmp = [0;~~(bitand(ERG(:,c),2^k));0];
80 cc(k+1) = cc(k+1) + sum(tmp);
81 pos = find(diff(tmp)>0);
82 pos2 = find(diff(tmp)<0);
86 TYP = [TYP; repmat(k,n,1)];
87 CHN = [CHN; repmat(c,n,1)];
88 DUR = [DUR; pos2(:)-pos(:)];
99 EVENT.POS = (POS(ix)-1)*EVENT.Fs+1;
100 EVENT.TYP = TYP(ix) + hex2dec('0100
');
102 EVENT.DUR = DUR(ix)*EVENT.Fs;