1 %
function [s,H]=fepi2gdf(fn);
2 % FEPI2GDF Freiburger epilepsy database converted into GDF format
4 % $Id: fepi2gdf.m 2205 2009-10-27 12:18:15Z schloegl $
5 % (C) 2005,2006,2008 by Alois Schloegl <a.schloegl@ieee.org>
6 % This is part of the BIOSIG-toolbox http:
8 % This program is free software; you can redistribute it and/or
9 % modify it under the terms of the GNU General Public License
10 % as published by the Free Software Foundation; either version 3
11 % of the License, or (at your option) any later version.
15 fid=fopen(
'epilepsydatabase.csv');
16 t=char(fread(fid,[1,inf],
'uint8'));
22 x = strvcat({fn.name});
23 id = unique(x(:,10:13),
'rows');
24 for k=length(
id)+(-2:0);%1:length(
id)
26 f = [fn(1).name(1:9),id(k,:)];
28 sno = find(r==n(:,1));
31 HDR.FileName = [f,
'.gdf'];
32 HDR.Patient.Sex = strtok(sa{sno,2},
'"');
33 HDR.Patient.Age = n(sno,3);
35 HDR.Patient.Birthday = HDR.T0;
36 HDR.Patient.Birthday(1) = HDR.T0(1) - HDR.Patient.Age;
39 HDR.DigMax = (2^15-1)*ones(HDR.NS,1);
40 HDR.DigMin = (-2^15)*ones(HDR.NS,1);
41 HDR.PhysMax = HDR.DigMax;
42 HDR.PhysMin = HDR.DigMin;
43 HDR.GDFTYP = repmat(3,HDR.NS);
49 t = load([f,
'_',int2str(k1),
'.asc']);