Anttena Paterns radiation patterns

Hi, I would like to draw the same figure below from the two reference equations. However, the figure I obtained was not quite similar to what I wanted.
Here is my code for the simulation.
Plot a Figure of Spetrum power
theta = -100/180*pi:5*pi/180:100/180*pi;
%plot(theta*180/pi,sin(theta))
cell radius
Gain=[]
cell_radius = [10 5 2] %km
for i=1:length(cell_radius)
HAP_altitude = 20 %km
phi_3db = 2*atan(cell_radius(i)/HAP_altitude*pi/180)
Gain(i,:) = 0.7*(2*besselj(1,70*pi/phi_3db.*sin(theta))./sin(theta)).^2
plot(theta*180/pi,10*log(mapminmax(Gain(i,:), 0, 1)))
hold on
end
legend('10km','5km','2km')
My result is below.
atenna_fig_1.png
Thank you so much in advance.

 Accepted Answer

Hello MT,
The basic issue is setting phi_3db to degrees, but there may also be a problem with the basic definition of phi_3db (more on that shortly). The conversion is not
phi_3db = 2*atan(cell_radius(i)/HAP_altitude*pi/180)
with the conversion factor in the argument of atan, but rather
phi_3db = (180/pi)*2*atan(cell_radius(i)/HAP_altitude)
with the conversion factor outside. (Also, conversion to dB requires log10, not log).
Rather than having a bunch of factors of 180/pi floating around, the code below uses the sind and atand functions.
I don't have the mapminmax function (Deep Learning Toolbox) so I just normalized G in the usual way and didn't worry about mapping the minimum to zero.
Major functionality in toolboxes is is one thing, that's what toolboxes are for. But Mathworks has gotten good at creating simple, short 'convenience' toolbox functions that actually make things a lot less less convenient for people who want to run some vanilla piece of code and don't have all the toolboxes. Is it a ploy to force people to buy more toolboxes? Probably not. The effect is the same, though.
The plot looks a lot better after converting to degrees in eqn (2)
phi_3db = 2*atand(cell_radius(i)/HAP_altitude) (2) original
But eqn (2) does not quite reproduce the figure. Interestingly, the equation
phi_3db = atand(2*cell_radius(i)/HAP_altitude) (3) modified
does reproduce the figure. So now we have the choice, is eqn (2) correct and the figure incorrect? Or are both eqn (3) and the figure correct, and eqn (2) incorrect?
%Plot a Figure of Spectrum power
theta = (-100:.01:100);
%cell radius
Gain=[]
cell_radius = [10 5 2] %km
for i=1:length(cell_radius)
HAP_altitude = 20; %km
% phi_3db = 2*atand(cell_radius(i)/HAP_altitude) % (2) original
phi_3db = atand(2*cell_radius(i)/HAP_altitude) % (3) modified
Gain(i,:) = 0.7*(2*besselj(1,(70*pi/phi_3db)*sind(theta))./sind(theta)).^2;
figure(1)
plot(theta,10*log10((Gain(i,:)/max(Gain(i,:)))))
hold on
end
legend('10km','5km','2km')
hold off

4 Comments

Mingcheng Tsai
Mingcheng Tsai on 31 Aug 2019
Edited: Mingcheng Tsai on 31 Aug 2019
Dear David Goodmanson,
I hope you are having a nice day.
I am so glad that you not only fix my issue but also provide your correct sense of this field.
With your help, I got the correct pattern from the modified equation (3).
That match the original pattern from the paper instead of the equation (2) from the paper provided.
Thank you so much for the kind help.
In the final version, I put this equation
phi_3db = atan(2*cell_radius(i)/HAP_altitude)*180/pi with a factor 180/pi.
From the figure itself, it fit the paper provided one.
May I have your help again?
Do you think that I should put this factor or not?
Best regards,
MT
Hello MT
The paper appears to be in error, because eqn (2) and the figure do not agree. I don't know which is correct, because I don't know this subject. At this point I think you had better look at other papers on the topic and/or at textbooks to find out whether eqn (2) is correct and the figure is wrong, or eqn (3) is correct and the figure is right. You can't afford to propagate an error due to lack of knowledge.
Hi, David.
Thank you for the insightful reply and I will seek for more reliable source to be as correct as it could.
I do appreciate the comment " You can't afford to propagate an error due to lack of knowledge. ".
It is an absolutely good advice.
Thank you so much again.
MT
Hello MT,
I appreciate your comment. Once you determine the correct expression and plot, I would be interested to hear what they are.

Sign in to comment.

More Answers (0)

Categories

Products

Release

R2019a

Community Treasure Hunt

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

Start Hunting!