Radiation pattern plot of a linear array using array factor.
46 次查看(过去 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)
0 个评论
回答(2 个)
Jaswanth
2024-7-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.
0 个评论
ashika asara
2024-8-22
N element of uniform linear arry code plz
% Parameters
n = 8; % Number of elements in the array
d = 0.5; % Element spacing in terms of wavelength (lambda)
beta = 0; % Phase difference between elements (in radians)
theta = linspace(-pi, pi, 1000); % Angle variable from -pi to pi
% Array factor calculation
AF = abs(sin(n * pi * d * sin(theta)) ./ sin(pi * d * sin(theta)));
% Normalizing the array factor
AF = AF / max(AF);
% Plotting the radiation pattern in linear scale
figure;
polarplot(theta, AF);
title(['Radiation Pattern of ', num2str(n), '-Element Uniform Linear Array']);
set(gca, 'ThetaZeroLocation', 'top');
set(gca, 'ThetaDir', 'clockwise');
% Plotting the radiation pattern in dB scale
figure;
plot(rad2deg(theta), 20*log10(AF));
title(['Radiation Pattern of ', num2str(n), '-Element Uniform Linear Array (dB)']);
xlabel('Angle (degrees)');
ylabel('Array Factor (dB)');
grid on;
axis([-90 90 -60 0]);
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!