MATLAB: How to use replicated subarrays and still set individual taper and phases

phasedPhased Array System Toolboxreplicatedsubarrays

Hi, I am trying to create a URA from sub arrays and steer the entire array by setting the wieghts and phases of each individaul element in each subarray. When I try to use 'SubarraySteering set to custom it yeilds an error asking for a differnet size input for ws. When I give it the size it wants it asks for another size. Is this a bug or am I appling the weighting wrong?
fc = 10e9;
c = physconst('lightspeed');
lambda = c/fc;
ele = phased.CosineAntennaElement;
antenna_spacing = lambda/2;
element_per_sub = [2 2];
sub_array = phased.URA('Element', ele, 'ElementSpacing', lambda/2, 'Size', element_per_sub);
num_sub_arrays = [2 4];
array = phased.ReplicatedSubarray('Subarray', sub_array, 'Layout', 'Custom', 'SubarraySteering', 'custom');
sub_pos =[];
sub_norm = [];
for ii = 1:num_sub_arrays(1)
for jj = 1:num_sub_arrays(2)
sub_pos(:,end+1) = [mod((ii-1),4)*antenna_spacing*2; mod((jj-1), 80)*2*antenna_spacing; 0];
sub_norm(:,end+1) = [0;-90];
end
end
array.SubarrayPosition=sub_pos;
array.SubarrayNormal = sub_norm;
taper = taylorwin(sub_array.Size(1)*num_sub_arrays(1)).*taylorwin(sub_array.Size(2)*num_sub_arrays(2))';
sub_array.Taper=taper;
ws = [];
for ii =1:num_sub_arrays(1)
for jj =1:num_sub_arrays(2)
temp_val = taper(element_per_sub(1)*(ii-1)+1:element_per_sub(1)*(ii), element_per_sub(2)*(jj-1)+1:element_per_sub(2)*(jj));
ws(:,end+1) = temp_val(:);
end
end
sv = phased.SteeringVector('SensorArray', array, 'IncludeElementResponse', true);
step(array, fc, c, [30;30], ws)
pattern(array, fc, 'Weights', ws(:))

Best Answer

If you set SubarraySteering to Custom, it means you want to control each element individually, thus you need to provide a weights that matches the number of elements. This is different than the SteeringVector since for a subarray, the steering vector is only computed at subarray level. You can specify the weights for each element using ElementWeights option when calling pattern(), like
fc = 10e9;
c = physconst('lightspeed');
lambda = c/fc;
ele = phased.CosineAntennaElement;
antenna_spacing = lambda/2;
element_per_sub = [2 2];
sub_array = phased.URA('Element', ele, 'ElementSpacing', lambda/2, 'Size', element_per_sub);
num_sub_arrays = [2 4];
array = phased.ReplicatedSubarray('Subarray', sub_array, 'Layout', 'Custom', 'SubarraySteering', 'custom');
sub_pos =[];
sub_norm = [];
for ii = 1:num_sub_arrays(1)
for jj = 1:num_sub_arrays(2)
sub_pos(:,end+1) = [mod((ii-1),4)*antenna_spacing*2; mod((jj-1), 80)*2*antenna_spacing; 0];
sub_norm(:,end+1) = [0;-90];
end
end
array.SubarrayPosition=sub_pos;
array.SubarrayNormal = sub_norm;
taper = taylorwin(sub_array.Size(1)*num_sub_arrays(1)).*taylorwin(sub_array.Size(2)*num_sub_arrays(2))';
% sub_array.Taper=taper;
ws = [];
for ii =1:num_sub_arrays(1)
for jj =1:num_sub_arrays(2)
temp_val = taper(element_per_sub(1)*(ii-1)+1:element_per_sub(1)*(ii), element_per_sub(2)*(jj-1)+1:element_per_sub(2)*(jj));
ws(:,end+1) = temp_val(:);
end
end
sv = phased.SteeringVector('SensorArray', array, 'IncludeElementResponse', true);
step(array, fc, [30;30], c, ws)
pattern(array, fc, 'ElementWeights', ws)
HTH