# Why is the radiation pattern does not show the required steering angle?

조회 수: 1(최근 30일)
ZIYI WENG 2021년 5월 7일
댓글: ZIYI WENG 2021년 5월 10일
N = 16;%number of elements
wl = 1;%wavelength
k = 2.*pi./wl;
d = wl./2;%distance
f = zeros(1,180);%empty array for field
AF = zeros(1,100);%empty array for complec weights
thi = -45;%The scan angle
phi= (2.*pi.*d .*sin(angle_radi))./wl;%equation for phase shift
for a = 1:N %for loop to repeat until the Nth phase shift
AF(a)= (a-1).*phi;%First number = (1-1)*phi
while AF(a) > 2*pi
AF(a) = AF(a) - 2.*pi;
if AF(a)<= 2*pi;break;end
end %minimize the data if it is larger than 2pi
while AF(a) < -2*pi
AF(a) =AF(a) + 2*pi;
if AF(a) >= -2*pi;break;end
end %maximize the data if it is smaller than -2pi
end%does not affect the result but mitigate the calculation
as = AF(2)+AF(3)+AF(4)+AF(5)+AF(6)+AF(7)+AF(8)+AF(9);%weights in total
for th =1:360 %angle from 1 to 360
s = 0
for i = 1:N
s = s + exp((-1j).*k.*(i-1).*d.*sin(angle_1rad(th))+as)%equation for field
end
f(th)= abs(s);
end
M = max(f);
z = f./M;%normalize the data
figure
%title('linear polar plot');

댓글을 달려면 로그인하십시오.

### 채택된 답변

David Goodmanson 2021년 5월 8일
편집: David Goodmanson 2021년 5월 8일
Hi ZW,
In the code below, the key line is
s = s + exp((-1j*k*d*(i-1).*sin(angle_1rad(th))) +1j*AF(i)); %equation for field
which is simply the sum of N phase angles due to propagation at the given angle, each multplied by the phase angle AF required to aim the beam at -45 degrees. I don't know the intent of the sum as = AF(2) + ...AF(9), but it is not necessary. I left out the while loops changing the values of angles by multiples of 2pi since it is unnecessary for accuracy (unless the number of antenna elements gets into maybe millions).
The polar plot shows a peak at -45 degrees and an equal peak at -135 degrees. With your geometry the line of emitters is the plus and minus vertical y axis, 90 degrees and 270 degrees, so there is equal emission on each side of the antenna as required.
The second code shortens things up by replacing some of the for loops with the vectorized version. (the code also uses exp(+1j*k*x)-type wave propagation rather than exp(-1j*k*x), since the former seems more intuitive).
N = 16; % number of elements
wl = 1; % wavelength
k = 2.*pi./wl;
d = wl./2; % distance
f = zeros(1,360); % empty array for field
AF = zeros(1,100); % empty array for complec weights
thi = -45; % The scan angle
phi= (k.*d .*sin(angle_radi)); % eqn for phase shift [in terms of k]
for a = 1:N %for loop to repeat until the Nth phase shift
AF(a)= (a-1).*phi; % First number = (1-1)*phi
end
%as = AF(2)+AF(3)+AF(4)+AF(5)+AF(6)+AF(7)+AF(8)+AF(9);%weights in total
for th =1:360 %angle from 1 to 360
s = 0;
for i = 1:N
s = s + exp((-1j*k*d*(i-1).*sin(angle_1rad(th)))+1j*AF(i)); %equation for field
end
f(th)= abs(s);
end
%
M = max(f);
z = f./M;%normalize the data
figure(1)
title('linear polar plot');
N = 16; % number of elements
wl = 1; % wavelength
k = 2*pi/wl;
d = wl/2; % distance
thi = -45; % The scan angle
f = zeros(1,360);
phi= (k*d*sin(thirad)); % eqn for phase shift [in terms of k]
AF = (0:N-1)*phi;
for th =1:360 % angle from 1 to 360
thvecN = k*d*(0:N-1)*sin(anglerad(th)); % phase angles due to propagation
s = sum(exp(1j*(thvecN-AF)));
f(th)= abs(s);
end
z = f/max(f); % normalize the data
figure(2)
title('linear polar plot');
##### 댓글 수: 1표시숨기기 없음
ZIYI WENG 2021년 5월 10일
Thank you very much. I found a different way to solve it later that day, but thanks anyway. I will try your code and see what will happen.

댓글을 달려면 로그인하십시오.

R2020a

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by