File: phc.cat

package info (click to toggle)
scilab 2.6-4
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 54,632 kB
  • ctags: 40,267
  • sloc: ansic: 267,851; fortran: 166,549; sh: 10,005; makefile: 4,119; tcl: 1,070; cpp: 233; csh: 143; asm: 135; perl: 130; java: 39
file content (70 lines) | stat: -rw-r--r-- 2,053 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
phc              Scilab Group              Scilab Function              phc
NAME
   phc - Markovian representation
  
CALLING SEQUENCE
 [H,F,G]=phc(hk,d,r)
PARAMETERS
 hk             : hankel matrix
                
 d              : dimension of the observation
                
 r              : desired dimension of the state vector for the
                approximated model
                
 H, F, G        : relevant matrices of the Markovian model 
                
DESCRIPTION
   Function which computes the matrices H, F, G of a Markovian 
  representation by the principal hankel component approximation method,
  from the hankel matrix built from the covariance sequence of a stochastic
  process.
  
EXAMPLE
 //
 //This example may usefully be compared with the results from 
 //the 'levin' macro (see the corresponding help and example)
 //
 //We consider the process defined by two sinusoids (1Hz and 2 Hz) 
 //in additive Gaussian noise (this is the observation); 
 //the simulated process is sampled at 10 Hz.
 //
 t=0:.1:100;rand('normal');
 y=sin(2*%pi*t)+sin(2*%pi*2*t);y=y+rand(y);plot(t,y)
 //
 //covariance of y
 //
 nlag=128;
 c=corr(y,nlag);
 //
 //hankel matrix from the covariance sequence
 //(we can choose to take more information from covariance
 //by taking greater n and m; try it to compare the results !
 //
 n=20;m=20;
 h=hank(n,m,c);
 //
 //compute the Markov representation (mh,mf,mg)
 //We just take here a state dimension equal to 4 :
 //this is the rather difficult problem of estimating the order !
 //Try varying ns ! 
 //(the observation dimension is here equal to one)
 ns=4;
 [mh,mf,mg]=phc(h,1,ns);
 //
 //verify that the spectrum of mf contains the 
 //frequency spectrum of the observed process y
 //(remember that y is sampled -in our example 
 //at 10Hz (T=0.1s) so that we need 
 //to retrieve the original frequencies through the log 
 //and correct scaling by the frequency sampling)
 //
 s=spec(mf);s=log(s);
 s=s/2/%pi/.1;
 //
 //now we get the estimated spectrum
 imag(s),
 //
SEE ALSO
   levin