]> Creatis software - CreaPhase.git/blob - octave_packages/tsa-4.2.4/bisdemo.m
Add a useful package (from Source forge) for octave
[CreaPhase.git] / octave_packages / tsa-4.2.4 / bisdemo.m
1 % BISDEMO (script) Shows BISPECTRUM of eeg8s.mat
2
3 %       $Id: bisdemo.m 5090 2008-06-05 08:12:04Z schloegl $
4 %       Copyright (C) 1997, 1998,2008 by Alois Schloegl <a.schloegl@ieee.org>
5 %
6 %    This program is free software: you can redistribute it and/or modify
7 %    it under the terms of the GNU General Public License as published by
8 %    the Free Software Foundation, either version 3 of the License, or
9 %    (at your option) any later version.
10 %
11 %    This program is distributed in the hope that it will be useful,
12 %    but WITHOUT ANY WARRANTY; without even the implied warranty of
13 %    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 %    GNU General Public License for more details.
15 %
16 %    You should have received a copy of the GNU General Public License
17 %    along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
19 load eeg8s.mat;
20 [BISPEC,BICOV,ACF]=bispec(eeg8s,30);
21 [s1,s2]=size(BISPEC);
22 t1=(1:s1)/max(s1);
23 t2=(1:s2)/max(s2);
24 subplot(211);
25 mesh(t1,t2,abs(BISPEC));
26 title('Bispectrum - mesh plot');
27
28 subplot(212);
29 if exist('OCTAVE_VERSION')>5
30         contour(abs(BISPEC),10,t1,t2);
31 else
32         contour(t1,t2,abs(BISPEC),10);
33 end;        
34 title('Bispectrum - contour plot');