NCCOOS Trac Projects: Top | Web | Platforms | Processing | Viz | Sprints | Sandbox | (Wind)

root/adcp/trunk/adcp/diwasp_1_1GD/private/EMLM.m

Revision 168 (checked in by cbc, 16 years ago)

Adding diwasp customizations.

Line 
1 function [S]=EMLM(xps,trm,kx,Ss,pidirs,miter,displ)
2
3 szd=size(xps,1);
4 ffreqs=size(xps,3);
5 ddirs=size(trm,3);
6
7 ddir=8*atan(1.0)/ddirs;
8
9 if(displ<2)
10    warning off;
11 end
12
13 for ff=1:ffreqs
14    if(displ>=1)
15       disp(['calculating for frequency' blanks(1) num2str(ff) ' of' blanks(1) num2str(ffreqs)]);
16         end
17    invcps=inv(xps(:,:,ff));
18    Sftmp=zeros(ddirs,1);
19    for m=1:szd
20       for n=1:szd
21    
22         H(1:ddirs)=trm(n,ff,1:ddirs);
23       Hs(1:ddirs)=conj(trm(m,ff,1:ddirs));
24      
25       expx(1:ddirs)=exp(i*kx(m,n,ff,1:ddirs));
26       xtemp=invcps(m,n).*H.*Hs.*expx;
27       Sftmp(:)=Sftmp(:)+xtemp';
28  
29       end
30    end
31    
32    E=(1./Sftmp(:))';
33    E=E./(ddir*sum(E));
34    S(ff,:)=Ss(1,ff)*E;
35 end
36
37 warning on;
38
39
Note: See TracBrowser for help on using the browser.