Radiation pattern plot of a linear array using array factor.

21 次查看(过去 30 天)
I want to plot a rectangular cartesion coordinates plot of radiation pattern of a uniform linear array using its array factor formula but it does not give me the exact plot kindly help
below is my code
clc;clear all;
lambda=0.03;
An = 1;
d=0.5*lambda;
k=(2*pi)/lambda;
N=30;
j = sqrt(-1);
AF = zeros(1,360);
for theta=1:360
deg2rad(theta) = (theta*pi)/180;
for n=0:N-1
for beta=1:2*pi
AF(theta)= AF(theta)+An*exp(j*k*N*d*cos(theta)+beta);%%% ARRAY FACTOR
end
end
AF(theta)=abs(AF(theta));
y=10*log(AF(theta))%% FOR DB SCALE
end
plot(theta,AF)

回答(1 个)

Jaswanth
Jaswanth 2024-7-24,10:24
Hi,
It seems there are a few issues in your code that need to be addressed to correctly plot the radiation pattern of a uniform linear array. The main problems include the use of ‘theta’ as both an index and an angle in degrees, which might lead to errors.
Please refer to the following revised code to plot the radiation pattern of a uniform linear array:
clc;
clear all;
lambda = 0.03;
An = 1;
d = 0.5 * lambda;
k = (2 * pi) / lambda;
N = 30;
j = sqrt(-1);
AF = zeros(1, 360);
theta_deg = 1:360;
for theta = theta_deg
theta_rad = (theta * pi) / 180;
for n = 0:N-1
AF(theta) = AF(theta) + An * exp(j * k * n * d * cos(theta_rad));
end
AF(theta) = abs(AF(theta));
end
AF_dB = 10 * log10(AF);
figure;
plot(theta_deg, AF_dB);
xlabel('Angle (degrees)');
ylabel('Array Factor (dB)');
title('Radiation Pattern of Uniform Linear Array');
grid on;
The revised code ensures that the angle conversion from degrees to radians is handled properly with ‘theta_rad’. The loop over n correctly sums the exponential terms for the array factor, and the decibel conversion is accurately done using ‘10 * log10(AF)’ instead of ‘10 * log(AF(theta))’. The plot is created after the loop, using ‘theta_deg’ for the x-axis and ‘AF_dB’ for the y-axis, which gives you the correct rectangular Cartesian coordinates plot of the radiation pattern.
I hope the information provided above is helpful.

类别

Help CenterFile Exchange 中查找有关 Line Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by