File: cspect.cat

package info (click to toggle)
scilab 2.4-1
  • links: PTS
  • area: non-free
  • in suites: potato, slink
  • size: 55,196 kB
  • ctags: 38,019
  • sloc: ansic: 231,970; fortran: 148,976; tcl: 7,099; makefile: 4,585; sh: 2,978; csh: 154; cpp: 101; asm: 39; sed: 5
file content (50 lines) | stat: -rw-r--r-- 1,497 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

cspect(1)                      Scilab Function                      cspect(1)
NAME
  cspect - spectral estimation (periodogram method)

CALLING SEQUENCE
  [sm,cwp]=cspect(nlags,ntp,wtype,x,y,wpar)

PARAMETERS

  x         : data if vector, amount of input data if scalar

  y         : data if vector, amount of input data if scalar

  nlags     : number of correlation lags (positive integer)

  ntp       : number of transform points (positive integer)

  wtype     : string : 're','tr','hm','hn','kr','ch' (window type)

  wpar      : optional window parameters for wtype='kr', wpar>0 and for
            wtype='ch', 0 < wpar(1) < .5, wpar(2) > 0

  sm        : power spectral estimate in the interval [0,1]

  cwp       : calculated value of unspecified Chebyshev window parameter

DESCRIPTION
  Spectral estimation using the modified periodogram method.  Cross-spectral
  estimate of x and y is calculated when both x and y are given. Auto-
  spectral estimate of x is calculated if y is not given.

EXAMPLE
  rand('normal');rand('seed',0);
  x=rand(1:1024-33+1);
  //make low-pass filter with eqfir
  nf=33;bedge=[0 .1;.125 .5];des=[1 0];wate=[1 1];
  h=eqfir(nf,bedge,des,wate);
  //filter white data to obtain colored data
  h1=[h 0*ones(1:maxi(size(x))-1)];
  x1=[x 0*ones(1:maxi(size(h))-1)];
  hf=fft(h1,-1);   xf=fft(x1,-1);yf=hf.*xf;y=real(fft(yf,1));
  sm=cspect(100,200,'tr',y);
  smsize=maxi(size(sm));fr=(1:smsize)/smsize;
  plot(fr,log(sm))

SEE ALSO
  pspect
AUTHOR
  C. Bunks