GETCROSSSPECTRA Compute the cross spectra by integration CALL: Sxy = getCrossSpectra(thetai,Gwt,DS); thetai = angle vector Gwt = matrix of transfer functions DS = directional spectrum
Estimates the directional wave spectrum from timeseries |
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
Comments or corrections to the WAFO group