Home > wafo > multidim > private > getcrossspectra.m

# getcrossspectra

## PURPOSE

Compute the cross spectra by integration

## SYNOPSIS

Sxy = getCrossSpectra(thetai,Gwt,DS)

## DESCRIPTION

``` GETCROSSSPECTRA Compute the cross spectra by integration

CALL: Sxy = getCrossSpectra(thetai,Gwt,DS);

thetai = angle vector
Gwt    = matrix of transfer functions
DS     = directional spectrum```

## CROSS-REFERENCE INFORMATION

This function calls:
 simpson Numerical integration with the Simpson method squeeze Remove singleton dimensions.
This function is called by:
 dat2dspec Estimates the directional wave spectrum from timeseries

## SOURCE CODE

```01 function Sxy = getCrossSpectra(thetai,Gwt,DS)
02 %GETCROSSSPECTRA Compute the cross spectra by integration
03 %
04 %  CALL: Sxy = getCrossSpectra(thetai,Gwt,DS);
05 %
06 %  thetai = angle vector
07 %  Gwt    = matrix of transfer functions
08 %  DS     = directional spectrum
09
10   [m,nt,nf] = size(Gwt);
11   Sxy = zeros(m,m,nf);
12   for ix=1:m
13     Sxy(ix,ix,:) = simpson(thetai,squeeze(Gwt(ix,:,:).*conj(Gwt(ix,:,:))).*DS);
14     for iy=(ix+1):m,
15       Sxy(ix,iy,:) = simpson(thetai,squeeze(Gwt(ix,:,:).*conj(Gwt(iy,:,:))).*DS);
16       Sxy(iy,ix,:) = conj(Sxy(ix,iy,:));
17     end
18   end
19   return```

Mathematical Statistics
Centre for Mathematical Sciences
Lund University with Lund Institute of Technology

Comments or corrections to the WAFO group

Generated on Thu 06-Oct-2005 02:21:16 for WAFO by m2html © 2003