3dB beamwidth from matrix

I have a matrix H(360x180) containing the energy levels in dB. I have the following 3D-beampattern plotted from H:
How can I find the 3dB beamwidth (in degrees across elevation & azimuth) of the mainlobe?

 Accepted Answer

Looks to me like there is no lobe above 3 dB. If you mean -3 dB then there is one or maybe 2 peaks. How do you define width? Do you want just the x and y widths at the -3 dB level, or do you want to extend out, or "fall down," the lobe well past the -3 dB cutting level? If it's the latter you might need some kind of region growing process. If it's the former, simply threshold and call regionprops() asking for the bounding box. Two lines of code.
binaryImage = H > -0.3;
measurements = regionprops(binaryImage, 'BoundingBox');
Here's a full blown demo:
clc; % Clear the command window.
close all; % Close all figures (except those of imtool.)
workspace; % Make sure the workspace panel is showing.
fontSize = 20;
% Create sample data.
H = peaks(90);
H = 11*mat2gray(H) - 13;
% Display it.
subplot(2, 2, 1);
surf(H);
xlabel('Azimuth [deg]', 'FontSize', fontSize);
ylabel('Elevation [deg]', 'FontSize', fontSize);
% Enlarge figure to full screen.
set(gcf, 'units','normalized','outerposition',[0 0 1 1]); % Maximize figure.
set(gcf,'name','Demo by ImageAnalyst','numbertitle','off')
% Threshold the image
binaryImage = H > -3;
% Display it.
subplot(2, 2, 2);
imshow(binaryImage);
axis on;
xlabel('Azimuth [deg]', 'FontSize', fontSize);
ylabel('Elevation [deg]', 'FontSize', fontSize);
measurements = regionprops(binaryImage, 'BoundingBox');
bb = [measurements.BoundingBox]
x1 = bb(1);
x2 = x1 + bb(3);
y1 = bb(2);
y2 = y1 + bb(4);
% Plot box over image.
hold on;
plot([x1 x2 x2 x1 x1], [y1 y1 y2 y2 y1], 'r-', 'LineWidth', 2);
message = sprintf('The Azimuth Width at -3 dB = %.1f\nThe Elevation Width at -3 dB = %.1f', ...
bb(3), bb(4));
msgbox(message);

4 Comments

@Image Analyst: thank you Sir for your patience..very helpful!
Sir,
I see in your example demo, the main-lobe peak (-2dB) is at (az,el)=(45°,69°).
On calculating the -3dB level widths from the matrix H, I see Azimuth width (at -5dB level) is 58°-33.5°=24.5° and Elevation width is 78°-61°=17°, unlike the values we get in bb(3) and bb(4).
Please clarify.
Don't calculate beam-widths _directly_ from the azimuth and zenith angles you get out. The beam-width are not the difference between min and max azimuth and zenith angles.
HTH
how can i use my image in this code? my image is http://kmu.site40.net/images/19d3c9e40467.jpg

Sign in to comment.

More Answers (1)

You could use contourc:
C = contourc(X,Y,H,[-3 -3]);
where you get the 3-dB curve from the C array that is built thisly:
C = [level1 x1 x2 x3 ... level2 x2 x2 x3 ...;
pairs1 y1 y2 y3 ... pairs2 y2 y2 y3 ...]
HTH

7 Comments

@Bjorn: Sorry Sir, but I did not understand how I can extract the 3dB curve from C array? What is level1,pairs1 and so on?
I have gone through doc contourc as well but Iam unable to get the result I intend.
Can you please elaborate with an example?
Note: I just want to calculate the value of 3dB beamwidth in degrees.
OK, the C-array contains each contour curve. The format is as above, level1 means the iso-value of that contour (-3 in your case, compare to the elevation of a topographic map if you will), pairs1 is an integer denoting the number of (x,y) pairs there is in this contour-curve. So to plot contour-curve1 you should do something like this:
plot(C(1,2:(1+C(2,1))),C(2,2:(1+C(2,1))))
after doing this for the all contour-curves you'll have your 3-dB level.
According to your plot it looked as if the 3-dB line was not all that simple, so I thought you had to do it this way. From there you have to decide how to determine the 3-dB beam-width.
HTH
Isit possible to calculate it from matrix H? the peak of mainlobe is at 0dB which can be found in H.
I think from that point, we can move -3dB along rows and columns.
Then find the corresponding angles(difference) at those points.
If yes, how can I do it in matlab?
please help.
Have you tried my suggestions?
@Bjorn: I think you got me wrong Sir. In the picture I uploaded, I do not need to find the 3dB beamwidth of all the lobes(mountains).
I just need to find the 3dB beamwidth of the highest lobe only.
please help.
Zozo, I think you got me wrong.
Even the main lobe might not be nice-n-elliptical. If you try my suggestion you will see if it is, or if it is more irregular, and if you have side-lobes with more than -3 dB gain.
THEN, you can judge if it is just to take any 2 points on opposing sides of the beam-centre or if you have to be more clever - like for example check the dot-product of the line-of-sight vectors between "all" unique combinations to find the one with largest beam-width, the average beam-width and whatnot.
HTH.
how can i use my image in this code? my image is http://kmu.site40.net/images/19d3c9e40467.jpg

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!