]> Creatis software - CreaPhase.git/blob - octave_packages/tsa-4.2.4/tsademo.m
Add a useful package (from Source forge) for octave
[CreaPhase.git] / octave_packages / tsa-4.2.4 / tsademo.m
1 % TSADEMO       demonstrates INVEST1 on EEG data
2
3 %       $Id: tsademo.m 5090 2008-06-05 08:12:04Z schloegl $
4 %       Copyright (C) 1998-2002,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
20 if exist('OCTAVE_VERSION')>5;
21     load -force eeg8s.mat 
22 elseif 1
23     load eeg8s.mat 
24 else
25     [FileName, PathName]=uigetfile('eeg8s.mat','load demo data EEG8S.MAT');
26     load([PathName FileName],'eeg8s');
27 end;
28 s = eeg8s';
29 Pmax=100;
30 [AutoCov,AutoCorr,ARPMX,E,CRITERIA,MOPS]=invest1(s,Pmax,'s');
31
32 if size(ARPMX,2)==2*Pmax,
33         %invest1(eeg8s,30,'s');
34         AR=ARPMX(:,1:Pmax);
35         RC=ARPMX(:,Pmax+1:2*Pmax);
36 else
37         AR=ARPMX(:,Pmax/2*(Pmax-1)+(1:Pmax));
38         RC=ARPMX(:,(1:Pmax).*(2:Pmax+1)/2);
39 end;