2 % OPENXLT is an auxillary
function to SOPEN
for
3 % opening of XLTEK files
5 % Use SOPEN instead of OPENXLT
7 % See also: fopen, SOPEN,
11 % This program is free software; you can redistribute it and/or
12 % modify it under the terms of the GNU General Public License
13 % as published by the Free Software Foundation; either version 3
14 % of the License, or (at your option) any later version.
16 % $Id:
openxlt.m 2205 2009-10-27 12:18:15Z schloegl $
17 % (C) 2004,2008 by Alois Schloegl <a.schloegl@ieee.org>
18 % This is part of the BIOSIG-toolbox http:
20 % Thanks to Andrey Vankov
for his support.
23 fprintf(2,
'Warning: OPENXLT is in an experimental state and is most likely not useful to you.\n');
24 fprintf(2,
'\t Do not use it unless you are sure know what you do. At least you are warned!\n');
28 [pfad,file,FileExt] = fileparts(HDR.FileName);
31 HDR.FILE.Ext = char(FileExt(2:length(FileExt)));
35 fid = fopen(fullfile(HDR.FILE.Path,[HDR.FILE.Name,
'.etc']),
'r');
37 fid = fopen(fullfile(HDR.FILE.Path,[HDR.FILE.Name,
'.ETC']),
'r');
40 status = fseek(fid,hex2dec(164),
'bof');
41 HDR.XLT.timebase = fread(fid,1,
'int32');
46 fid = fopen(fullfile(HDR.FILE.Path,[HDR.FILE.Name,
'.ent']),
'r');
48 fid = fopen(fullfile(HDR.FILE.Path,[HDR.FILE.Name,
'.ENT']),
'r');
53 if strncmp(tline,
'Stamp',5),
54 [t,r] = strtok(tline,
' ');
55 [t,r] = strtok(r,
' ');
57 ix = strfind(tline,
'patient');
67 fid = fopen(HDR.FileName);
69 HDR.H1 = fread(fid,352,
'uchar');
70 HDR.SampleRate = fread(fid,1,
'uchar');
71 tmp = fread(fid,2,
'int32');
73 HDR.bits = tmp(2); % ???? ###
74 HDR.XLT.PhysChan = fread(fid,1024,
'int32');
75 HDR.XLT.HeadBoxType = fread(fid,4,
'int32');
76 HDR.XLT.HeadBoxSN = fread(fid,4,
'int32');
77 HDR.XLT.HeadBoxSoftwareVersion = fread(fid,[4,16],
'uint8');
78 HDR.XLT.DSP_HW_Version = fread(fid,[16],
'uint8');
79 HDR.XLT.DSP_SW_Version = fread(fid,[16],
'uint8');
80 HDR.XLT.DiscardBits = fread(fid,4,
'int32');
82 HDR.XLT.shorted = fread(fid,1024,
'int16');
83 HDR.XLT.FrequencyFactor = fread(fid,1024,
'int16');
85 HDR.HeadLen = hex2dec(
'21D0');
86 status = fseek(fid,HDR.HeadLen,
'bof');