1% DEMO8: overflow detection based on [1]
2%
3% REFERENCES:
4% [1] A. Schlögl, B. Kemp, T. Penzel, D. Kunz, S.-L. Himanen,A. Värri, G. Dorffner, G. Pfurtscheller.
5%   Quality Control of polysomnographic Sleep Data by Histogram and EntropyAnalysis.
6%   Clin. Neurophysiol. 1999, Dec; 110(12): 2165 - 2170.
7%   http://dx.doi.org/10.1016/S1388-2457(99)00172-8
8
9%	$Id: demo8.m,v 1.3 2008-10-13 13:06:41 schloegl Exp $
10%	Copyright (C) 2008 by Alois Schloegl <alois.schloegl@gmail.com>
11%    	This is part of the BIOSIG-toolbox http://biosig.sf.net/
12
13% This program is free software; you can redistribute it and/or
14% modify it under the terms of the GNU General Public License
15% as published by the Free Software Foundation; either version 3
16% of the  License, or (at your option) any later version.
17%
18% This program is distributed in the hope that it will be useful,
19% but WITHOUT ANY WARRANTY; without even the implied warranty of
20% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21% GNU General Public License for more details.
22%
23% You should have received a copy of the GNU General Public License
24% along with this program; if not, write to the Free Software
25% Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
26
27[filename, pathname, filterindex] = uigetfile('*.*', 'Pick an EEG/ECG-file');
28
29figure(1);
30fprintf(1,'Compute histograms and select Thresholds based on the work :\n');
31fprintf(1,'  [1] A. Schlögl, B. Kemp, T. Penzel, D. Kunz, S.-L. Himanen,A. Värri, G. Dorffner, G. Pfurtscheller.\n');
32fprintf(1,'   Quality Control of polysomnographic Sleep Data by Histogram and EntropyAnalysis. \n');
33fprintf(1,'   Clin. Neurophysiol. 1999, Dec; 110(12): 2165 - 2170.\n');
34fprintf(1,'   http://dx.doi.org/10.1016/S1388-2457(99)00172-8  or http://www.dpmi.tugraz.at/schloegl/publications/schloegl1999.pdf\n\n');
35fprintf(1,'   EEG2HIST computes the histograms and allows \n');
36fprintf(1,'   you to set the Threshold values using the mouse. \n');
37fprintf(1,'   The "side lobes" caused by the saturation should \n');
38fprintf(1,'   appear red. If no saturation (side lobes) occur, \n');
39fprintf(1,'   select thresholds above and below the dynamic range. \n');
40fprintf(1,'   If you want to change the thresholds for some channels \n');
41fprintf(1,'   you can go back to these channels. When you have finished \n');
42fprintf(1,'   defining thresholds, press any key on the keyboard. \n');
43
44HDR=eeg2hist(fullfile(pathname,filename));
45
46display('Show results of QC analysis');
47plota(HDR);
48
49[s,HDR]=sload(HDR);
50
51figure(2);
52sview(s,HDR);
53
54
55
56
57
58
59