Revision 168
(checked in by cbc, 16 years ago)
|
Adding diwasp customizations.
|
Line | |
---|
1 |
function [S]=DFTM(xps,trm,kx,Ss,W,miter,displ) |
---|
2 |
|
---|
3 |
szd=size(xps,1); |
---|
4 |
ffreqs=size(xps,3); |
---|
5 |
ddirs=size(trm,3); |
---|
6 |
ddir=8*atan(1.0)/ddirs; |
---|
7 |
|
---|
8 |
if(displ<2) |
---|
9 |
warning off; |
---|
10 |
end |
---|
11 |
|
---|
12 |
for ff=1:ffreqs |
---|
13 |
if(displ>=1) |
---|
14 |
disp(['calculating for frequency' blanks(1) num2str(ff) ' of' blanks(1) num2str(ffreqs)]); |
---|
15 |
end |
---|
16 |
nxps=xps(:,:,ff); |
---|
17 |
Sftmp=zeros(ddirs,1)+i*zeros(ddirs,1); |
---|
18 |
for m=1:szd |
---|
19 |
for n=1:szd |
---|
20 |
|
---|
21 |
H(1:ddirs)=trm(n,ff,1:ddirs); |
---|
22 |
Hs(1:ddirs)=conj(trm(m,ff,1:ddirs)); |
---|
23 |
|
---|
24 |
expx(1:ddirs)=exp(i*kx(m,n,ff,1:ddirs)); |
---|
25 |
xtemp=nxps(m,n).*H.*Hs.*expx; |
---|
26 |
Sftmp(:)=Sftmp(:)+xtemp'; |
---|
27 |
|
---|
28 |
|
---|
29 |
end |
---|
30 |
end |
---|
31 |
E=Sftmp(:)'; |
---|
32 |
E=E./(ddir*sum(E)); |
---|
33 |
S(ff,:)=Ss(1,ff)*E; |
---|
34 |
end |
---|
35 |
|
---|
36 |
warning on; |
---|