Need help trying to plot power beam patterns in dB

12 ビュー (過去 30 日間)
Brittny Freeman
Brittny Freeman 2018 年 1 月 21 日
コメント済み: Star Strider 2018 年 1 月 21 日
Hello,
I am getting extremely confused trying to plot a power beam pattern in Matlab with a dB scale for the y-axis.
Basically, I have a function, G = 10log10(norm((Y(x)/M)^2) that needs to be plotted. The x-axis should be in values of theta, between -90 and 90 degrees, and the y-axis should be in dB scale. The Y(x) function, with is contained in the G function, is then evaluated at certain values of theta (-75, 0, 30, and 60), and the results are then plotted.
As shown above, I have already converted the values of the G function to dBs, however, when I try to manually change the y-axis scale and tics to shown dB scale, my plot is gibberish.
Any advice or tips would be very much appreciated. Thanks in advanced.
  2 件のコメント
Star Strider
Star Strider 2018 年 1 月 21 日
‘when I try to manually change the y-axis scale and tics to shown dB scale, my plot is gibberish.’
Please post the relevant parts of your code.
Brittny Freeman
Brittny Freeman 2018 年 1 月 21 日
編集済み: Star Strider 2018 年 1 月 21 日
Thanks for getting back to me Star, hope this helps:
M = 4
theta = [60 -75 0 30]
A = [1 1 1 1; exp(-i*pi*sin(theta)); exp(-i*2*pi*sin(theta)); exp(-i*3*pi*sin(theta))];
A_inv = inv(A);
e_1 = [ 1 0 0 0];
w_h = e_1 * A;
y_t = w_h * A;
y_t_1 = w_h * A(:,1);
y_t_2 = w_h * A(:,2);
y_t_3 = w_h * A(:,3);
y_t_4 = w_h * A(:,4);
Power_Beam_Pattern = [(norm(y_t_1))^2; (norm(y_t_2))^2; (norm(y_t_3))^2; (norm(y_t_4))^2];
G_theta = 10*log10(Power_Beam_Pattern_1/M^2);
semilogy(theta,10*log10(G_theta))

サインインしてコメントする。

採用された回答

Star Strider
Star Strider 2018 年 1 月 21 日
My pleasure.
The reason your plot is not working out as you want it is that you are using semilogy to plot a signal you have already log-transformed into dB.
Just use plot, or perhaps polarplot.
Also, I noticed that ‘theta’ appears to be in degrees. Either convert it to radians by multiplying it by pi/180 or use the sind function instead of sin.
  2 件のコメント
Brittny Freeman
Brittny Freeman 2018 年 1 月 21 日
Appreciate your help Star, I was able to get to the bottom of it.
Cheers.
Star Strider
Star Strider 2018 年 1 月 21 日
As always, my pleasure.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by