How to loop through a steering angle range given some array geometry and plot each 3D pattern?
I was watching one of the MATLAB Tech Talk videos about Beamforming, and in it, the speaker showed a clip of the result of a script he created that looped through the azimuth steering angles and smoothly plotted each 3D pattern for that steering angle. I would like to reproduce this but am having trouble in determining how to do this. I’ve linked the video in question, and I have linked my current code that simply defines my array geometry and plots the array’s 3D pattern. I’m relatively sure I can figure out how to loop through the 2D patterns after I figure out how to loop through the 3D pattern. Any help would be greatly appreciated.
Video: What are Phased Arrays? (Go to 15:48)
Code:
% MATLAB Code from Sensor Array Analyzer App
% Generated by MATLAB 23.2 and Phased Array System Toolbox 23.2
% Generated on 03-May-2024 12:59:05
% Create a uniform rectangular array
Array = phased.URA(‘Size’,[4 4],…
‘Lattice’,’Rectangular’,’ArrayNormal’,’x’);
Array.ElementSpacing = [0.08 0.08];
% Calculate Row taper
rwind = ones(1,4).’;
% Calculate Column taper
cwind = ones(1,4).’;
% Calculate taper
taper = rwind*cwind.’;
Array.Taper = taper.’;
% Create an omnidirectional microphone element
Elem = phased.OmnidirectionalMicrophoneElement;
Elem.FrequencyRange = [0 2000];
Array.Element = Elem;
% Assign Frequencies and Propagation Speed
Frequency = 2000;
PropagationSpeed = 343;
steering_azimuth = linspace(-90, 90, 1000);
steering_elevation = linspace(-90, 90, 1000);
% Assign Steering Angles
SteeringAngles = [0;0];
% Assign Phase shift quantization bits
PhaseShiftBits = 0;
% Calculate Steering Weights
Freq3D = 2000;
% Find the weights
w = zeros(getNumElements(Array), length(Frequency));
SteerVector = phased.SteeringVector(‘SensorArray’, Array,…
‘PropagationSpeed’, PropagationSpeed);
for idx = 1:length(Frequency)
w(:, idx) = step(SteerVector, Frequency(idx), SteeringAngles(:, idx));
end
% Plot 3d graph
format = ‘polar’;
plotType = ‘Directivity’;
figure;
pattern(Array, Freq3D , ‘PropagationSpeed’, PropagationSpeed,…
‘CoordinateSystem’, format,’weights’, w(:,1),…
‘ShowArray’,false,’ShowLocalCoordinates’,true,…
‘ShowColorbar’,true,’Orientation’,[0;0;0],…
‘Type’, plotType);I was watching one of the MATLAB Tech Talk videos about Beamforming, and in it, the speaker showed a clip of the result of a script he created that looped through the azimuth steering angles and smoothly plotted each 3D pattern for that steering angle. I would like to reproduce this but am having trouble in determining how to do this. I’ve linked the video in question, and I have linked my current code that simply defines my array geometry and plots the array’s 3D pattern. I’m relatively sure I can figure out how to loop through the 2D patterns after I figure out how to loop through the 3D pattern. Any help would be greatly appreciated.
Video: What are Phased Arrays? (Go to 15:48)
Code:
% MATLAB Code from Sensor Array Analyzer App
% Generated by MATLAB 23.2 and Phased Array System Toolbox 23.2
% Generated on 03-May-2024 12:59:05
% Create a uniform rectangular array
Array = phased.URA(‘Size’,[4 4],…
‘Lattice’,’Rectangular’,’ArrayNormal’,’x’);
Array.ElementSpacing = [0.08 0.08];
% Calculate Row taper
rwind = ones(1,4).’;
% Calculate Column taper
cwind = ones(1,4).’;
% Calculate taper
taper = rwind*cwind.’;
Array.Taper = taper.’;
% Create an omnidirectional microphone element
Elem = phased.OmnidirectionalMicrophoneElement;
Elem.FrequencyRange = [0 2000];
Array.Element = Elem;
% Assign Frequencies and Propagation Speed
Frequency = 2000;
PropagationSpeed = 343;
steering_azimuth = linspace(-90, 90, 1000);
steering_elevation = linspace(-90, 90, 1000);
% Assign Steering Angles
SteeringAngles = [0;0];
% Assign Phase shift quantization bits
PhaseShiftBits = 0;
% Calculate Steering Weights
Freq3D = 2000;
% Find the weights
w = zeros(getNumElements(Array), length(Frequency));
SteerVector = phased.SteeringVector(‘SensorArray’, Array,…
‘PropagationSpeed’, PropagationSpeed);
for idx = 1:length(Frequency)
w(:, idx) = step(SteerVector, Frequency(idx), SteeringAngles(:, idx));
end
% Plot 3d graph
format = ‘polar’;
plotType = ‘Directivity’;
figure;
pattern(Array, Freq3D , ‘PropagationSpeed’, PropagationSpeed,…
‘CoordinateSystem’, format,’weights’, w(:,1),…
‘ShowArray’,false,’ShowLocalCoordinates’,true,…
‘ShowColorbar’,true,’Orientation’,[0;0;0],…
‘Type’, plotType); I was watching one of the MATLAB Tech Talk videos about Beamforming, and in it, the speaker showed a clip of the result of a script he created that looped through the azimuth steering angles and smoothly plotted each 3D pattern for that steering angle. I would like to reproduce this but am having trouble in determining how to do this. I’ve linked the video in question, and I have linked my current code that simply defines my array geometry and plots the array’s 3D pattern. I’m relatively sure I can figure out how to loop through the 2D patterns after I figure out how to loop through the 3D pattern. Any help would be greatly appreciated.
Video: What are Phased Arrays? (Go to 15:48)
Code:
% MATLAB Code from Sensor Array Analyzer App
% Generated by MATLAB 23.2 and Phased Array System Toolbox 23.2
% Generated on 03-May-2024 12:59:05
% Create a uniform rectangular array
Array = phased.URA(‘Size’,[4 4],…
‘Lattice’,’Rectangular’,’ArrayNormal’,’x’);
Array.ElementSpacing = [0.08 0.08];
% Calculate Row taper
rwind = ones(1,4).’;
% Calculate Column taper
cwind = ones(1,4).’;
% Calculate taper
taper = rwind*cwind.’;
Array.Taper = taper.’;
% Create an omnidirectional microphone element
Elem = phased.OmnidirectionalMicrophoneElement;
Elem.FrequencyRange = [0 2000];
Array.Element = Elem;
% Assign Frequencies and Propagation Speed
Frequency = 2000;
PropagationSpeed = 343;
steering_azimuth = linspace(-90, 90, 1000);
steering_elevation = linspace(-90, 90, 1000);
% Assign Steering Angles
SteeringAngles = [0;0];
% Assign Phase shift quantization bits
PhaseShiftBits = 0;
% Calculate Steering Weights
Freq3D = 2000;
% Find the weights
w = zeros(getNumElements(Array), length(Frequency));
SteerVector = phased.SteeringVector(‘SensorArray’, Array,…
‘PropagationSpeed’, PropagationSpeed);
for idx = 1:length(Frequency)
w(:, idx) = step(SteerVector, Frequency(idx), SteeringAngles(:, idx));
end
% Plot 3d graph
format = ‘polar’;
plotType = ‘Directivity’;
figure;
pattern(Array, Freq3D , ‘PropagationSpeed’, PropagationSpeed,…
‘CoordinateSystem’, format,’weights’, w(:,1),…
‘ShowArray’,false,’ShowLocalCoordinates’,true,…
‘ShowColorbar’,true,’Orientation’,[0;0;0],…
‘Type’, plotType); toolbox, plotting, phased arrays, 3d plots, graphics MATLAB Answers — New Questions