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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
| %----------- near-field to far-field transformation --------------------
A = zeros(t,t); % spatial spectrum computation
for m=1:t
for n=1:t
for h=1:Ny
for i=1:Nx
A(n,m) = A(n,m) + E(i,h)*exp(j*k*(x(i)*kx(n,m)+y(h)*ky(n,m)));
end
end
end
t-m
end
A = A/(Nx*Ny);
% ------ far-field computation (theoretical values for comparison) -----------
Evzdal = zeros(t,t);
for m=1:t
for n=2:(t-1)
Evzdal(m,n) = ((cos(k*l*cos(phi(n)))-cos(k*l)) / sin(phi(n)))*(sin(Nd/2*k*dd*cos(theta(m)+pi/2)))/(sin(1/2*k*dd*cos(theta(m)+pi/2)));
end
end
Evzdalmax = max(Evzdal);
maxEvzdal = max(Evzdalmax);
Evzdal = abs(Evzdal/maxEvzdal);
Evzdaldb = 20*log(Evzdal);
figure(3);
surf(phi/(2*pi)*360,theta/(2*pi)*360,Evzdaldb);
title('Vyzarovaci diagram ziskany vypoctem');
xlabel('phi[°]');
ylabel('theta[°]');
zlabel('abs(Efar)');
% -------- multiplying the angular spectrum by a wavenumber ------------------
for i=1:t
A(i,:) = kz.*A(i,:);
A(:,i) = rot90(kz).*A(:,i);
end
Amax = max(A);
maxA = max(Amax);
A = A/maxA;
F = abs(A);
Fdb = 20*log(F);
figure(4); % depiction of spatial spectrum for two orthogonal cuts
subplot(2,1,1);
stem(ky(:,45),abs(A(:,45)));
title('Rez prostorovym spektrem v rovine kx=0');
xlabel('ky');
ylabel('abs(A)');
subplot(2,1,2);
stem(kx(45,:),abs(A(45,:)));
title('Rez prostorovym spektrem v rovine ky=0');
xlabel('kx');
ylabel('abs(A)');
figure(6); % theoretical and transformed values comparison
subplot(2,1,1);
plot(theta(2:(t-1))/(2*pi)*360,Evzdaldb(2:(t-1),45),'b',theta(2:(t-1))/(2*pi)*360,Fdb(2:(t-1),45),'r');
xlabel('theta[°]');
ylabel('abs(Evzdal/Emax)');
subplot(2,1,2);
plot(theta(2:(t-1))/(2*pi)*360,Evzdaldb(45,2:(t-1)),'b',theta(2:(t-1))/(2*pi)*360,Fdb(45,2:(t-1)),'r');
xlabel('phi[°]');
ylabel('abs(Evzdal/Emax)'); |