Hi Graeme,
To extract the electromagnetic field pattern in the form of a complex array response from a Uniform Linear Array (ULA) or Uniform Rectangular Array (URA) in MATLAB, you can use the array's steering vector and element patterns.
While the pattern() function provides power and other field patterns, it doesn't directly return the complex field patterns.
Please follow this example MATLAB code below to extract complex array response:
- Define the Array: Use MATLAB's Phased Array System Toolbox to define your ULA or URA.
% Parameters
fc = 1e9; % Carrier frequency (1 GHz)
c = physconst('LightSpeed'); % Speed of light
lambda = c / fc; % Wavelength
d = lambda / 2; % Element spacing (half-wavelength)
% Create ULA
numElements = 8; % Number of elements
ula = phased.ULA('NumElements', numElements, 'ElementSpacing', d);
% Define steering angles
azimuthAngles = -90:90; % Azimuth angles to evaluate
elevationAngle = 0; % Elevation angle (broadside)
- Compute Steering Vectors: Calculate the steering vectors for the desired angles using the phased.SteeringVector system object as explained by this MATLAB R2024b documentation: https://www.mathworks.com/help/phased/ref/phased.steeringvector-system-object.html
The steering vector represents the phase shifts required for the array elements to focus on a particular direction.
% Compute steering vectors
steeringVector = phased.SteeringVector('SensorArray', ula, 'PropagationSpeed', c);
sv = steeringVector(fc, [azimuthAngles; elevationAngle * ones(size(azimuthAngles))]);
- Element E-Field Patterns: If available, use the element pattern to account for individual element responses.
% Element pattern (assuming isotropic here)
elementPattern = ones(size(sv)); % Replace with actual pattern if known
- Combine Responses: Multiply the steering vector with the element pattern to get the complex array response.
% Compute complex array response
complexArrayResponse = sv .* elementPattern;
% Plot magnitude and phase
figure;
subplot(2, 1, 1);
plot(azimuthAngles, 20*log10(abs(complexArrayResponse)));
xlabel('Azimuth Angle (degrees)');
ylabel('Magnitude (dB)');
title('Complex Array Response Magnitude');
subplot(2, 1, 2);
plot(azimuthAngles, angle(complexArrayResponse));
xlabel('Azimuth Angle (degrees)');
ylabel('Phase (radians)');
title('Complex Array Response Phase');
This approach provides a framework for extracting complex electromagnetic patterns from an array.
I hope this helps!