ARRAY_GEOMETRY = '2D_RANDOM';
HAS_NULLS = 0;
lambda = 1;
theta_tar = 60;
half_beamwidth = 10;
if HAS_NULLS
theta_nulls = [95 110 120 140 225];
end
if strcmp( ARRAY_GEOMETRY, '2D_RANDOM' )
rand('state',0);
n = 40;
L = 5;
loc = L*rand(n,2);
angleRange = 360;
elseif strcmp( ARRAY_GEOMETRY, '1D_UNIFORM_LINE' )
n = 30;
d = 0.45*lambda;
loc = [d*[0:n-1]' zeros(n,1)];
angleRange = 180;
elseif strcmp( ARRAY_GEOMETRY, '2D_UNIFORM_LATTICE' )
m = 6; n = m^2;
d = 0.45*lambda;
loc = zeros(n,2);
for x = 0:m-1
for y = 0:m-1
loc(m*y+x+1,:) = [x y];
end
end
loc = loc*d;
angleRange = 360;
else
error('Undefined array geometry')
end
theta = [1:angleRange]';
A = kron(cos(pi*theta/180), loc(:,1)') + kron(sin(pi*theta/180), loc(:,2)');
A = exp(2*pi*i/lambda*A);
[diff_closest, ind_closest] = min( abs(theta - theta_tar) );
Atar = A(ind_closest,:);
if HAS_NULLS
Anull = []; ind_nulls = [];
for k = 1:length(theta_nulls)
[diff_closest, ind_closest] = min( abs(theta - theta_nulls(k)) );
Anull = [Anull; A(ind_closest,:)];
ind_nulls = [ind_nulls ind_closest];
end
end
ind = find(theta <= (theta_tar-half_beamwidth) | ...
theta >= (theta_tar+half_beamwidth) );
if HAS_NULLS, ind = setdiff(ind,ind_nulls); end;
As = A(ind,:);
cvx_begin
variable w(n) complex
minimize( max( abs(As*w) ) )
subject to
Atar*w == 1;
if HAS_NULLS
Anull*w == 0;
end
cvx_end
disp(['Problem is ' cvx_status])
if ~strfind(cvx_status,'Solved')
return
end
min_sidelobe_level = 20*log10( max(abs(As*w)) );
fprintf(1,'The minimum sidelobe level is %3.2f dB.\n\n',...
min_sidelobe_level );
figure(1), clf
plot(loc(:,1),loc(:,2),'o')
title('Antenna locations')
if angleRange == 180,
theta = [1:360]';
A = [ A; -A ];
end
y = A*w;
figure(2), clf
ymin = floor(0.1*min_sidelobe_level)*10-10; ymax = 0;
plot([1:360], 20*log10(abs(y)), ...
[theta_tar theta_tar],[ymin ymax],'r--',...
[theta_tar+half_beamwidth theta_tar+half_beamwidth],[ymin ymax],'g--',...
[theta_tar-half_beamwidth theta_tar-half_beamwidth],[ymin ymax],'g--');
if HAS_NULLS
hold on;
for k = 1:length(theta_nulls)
plot([theta_nulls(k) theta_nulls(k)],[ymin ymax],'m--');
end
hold off;
end
xlabel('look angle'), ylabel('mag y(theta) in dB');
axis([0 360 ymin ymax]);
figure(3), clf
zerodB = -ymin;
dBY = 20*log10(abs(y)) + zerodB;
ind = find( dBY <= 0 ); dBY(ind) = 0;
plot(dBY.*cos(pi*theta/180), dBY.*sin(pi*theta/180), '-');
axis([-zerodB zerodB -zerodB zerodB]), axis('off'), axis('square')
hold on
plot(zerodB*cos(pi*theta/180),zerodB*sin(pi*theta/180),'k:')
plot( (min_sidelobe_level + zerodB)*cos(pi*theta/180), ...
(min_sidelobe_level + zerodB)*sin(pi*theta/180),'k:')
text(-zerodB,0,'0 dB')
tt = text(-(min_sidelobe_level + zerodB),0,sprintf('%0.1f dB',min_sidelobe_level));
set(tt,'HorizontalAlignment','right');
theta_1 = theta_tar+half_beamwidth;
theta_2 = theta_tar-half_beamwidth;
plot([0 55*cos(theta_tar*pi/180)], [0 55*sin(theta_tar*pi/180)], 'k:')
plot([0 55*cos(theta_1*pi/180)], [0 55*sin(theta_1*pi/180)], 'k:')
plot([0 55*cos(theta_2*pi/180)], [0 55*sin(theta_2*pi/180)], 'k:')
if HAS_NULLS
for k = 1:length(theta_nulls)
plot([0 55*cos(theta_nulls(k)*pi/180)], ...
[0 55*sin(theta_nulls(k)*pi/180)], 'k:')
end
end
hold off
Calling Mosek 9.1.9: 1366 variables, 422 equality constraints
For improved efficiency, Mosek is solving the dual problem.
------------------------------------------------------------
MOSEK Version 9.1.9 (Build date: 2019-11-21 11:32:15)
Copyright (c) MOSEK ApS, Denmark. WWW: mosek.com
Platform: MACOSX/64-X86
Problem
Name :
Objective sense : min
Type : CONIC (conic optimization problem)
Constraints : 422
Cones : 341
Scalar variables : 1366
Matrix variables : 0
Integer variables : 0
Optimizer started.
Presolve started.
Linear dependency checker started.
Linear dependency checker terminated.
Eliminator started.
Freed constraints in eliminator : 0
Eliminator terminated.
Eliminator - tries : 1 time : 0.00
Lin. dep. - tries : 1 time : 0.00
Lin. dep. - number : 0
Presolve terminated. Time: 0.01
Problem
Name :
Objective sense : min
Type : CONIC (conic optimization problem)
Constraints : 422
Cones : 341
Scalar variables : 1366
Matrix variables : 0
Integer variables : 0
Optimizer - threads : 8
Optimizer - solved problem : the primal
Optimizer - Constraints : 81
Optimizer - Cones : 342
Optimizer - Scalar variables : 1026 conic : 1026
Optimizer - Semi-definite variables: 0 scalarized : 0
Factor - setup time : 0.00 dense det. time : 0.00
Factor - ML order time : 0.00 GP order time : 0.00
Factor - nonzeros before factor : 3321 after factor : 3321
Factor - dense dim. : 0 flops : 6.89e+06
ITE PFEAS DFEAS GFEAS PRSTATUS POBJ DOBJ MU TIME
0 3.4e+02 1.0e+00 1.0e+00 0.00e+00 0.000000000e+00 0.000000000e+00 1.0e+00 0.02
1 9.8e+01 2.9e-01 2.8e-02 2.52e+00 -8.590871054e-02 -1.318838913e-01 2.9e-01 0.03
2 2.0e+01 5.9e-02 3.9e-03 3.45e+00 -8.069498732e-02 -8.185728925e-02 5.9e-02 0.03
3 1.3e+01 3.7e-02 1.8e-03 1.32e+00 -7.700437407e-02 -7.788164242e-02 3.7e-02 0.03
4 2.0e+00 5.9e-03 4.5e-05 1.21e+00 -7.194808655e-02 -7.235294175e-02 5.9e-03 0.04
5 1.4e+00 4.1e-03 2.6e-05 1.06e+00 -7.125511919e-02 -7.153752769e-02 4.1e-03 0.04
6 5.9e-01 1.7e-03 6.5e-06 1.05e+00 -7.056788870e-02 -7.068638056e-02 1.7e-03 0.04
7 4.3e-02 1.3e-04 1.0e-07 1.02e+00 -7.030107264e-02 -7.031009430e-02 1.3e-04 0.05
8 1.9e-02 5.6e-05 3.1e-08 1.00e+00 -7.030410140e-02 -7.030807760e-02 5.6e-05 0.05
9 5.2e-04 1.5e-06 1.3e-10 1.00e+00 -7.030216638e-02 -7.030227439e-02 1.5e-06 0.05
10 6.5e-05 1.9e-07 6.3e-12 9.96e-01 -7.030209110e-02 -7.030210461e-02 1.9e-07 0.05
11 9.2e-06 2.7e-08 3.4e-13 9.99e-01 -7.030208990e-02 -7.030209179e-02 2.7e-08 0.06
12 2.3e-07 6.6e-10 1.3e-15 1.00e+00 -7.030209005e-02 -7.030209009e-02 6.6e-10 0.06
Optimizer terminated. Time: 0.06
Interior-point solution summary
Problem status : PRIMAL_AND_DUAL_FEASIBLE
Solution status : OPTIMAL
Primal. obj: -7.0302090046e-02 nrm: 1e+00 Viol. con: 2e-08 var: 0e+00 cones: 0e+00
Dual. obj: -7.0302090092e-02 nrm: 7e+01 Viol. con: 0e+00 var: 6e-13 cones: 0e+00
Optimizer summary
Optimizer - time: 0.06
Interior-point - iterations : 12 time: 0.06
Basis identification - time: 0.00
Primal - iterations : 0 time: 0.00
Dual - iterations : 0 time: 0.00
Clean primal - iterations : 0 time: 0.00
Clean dual - iterations : 0 time: 0.00
Simplex - time: 0.00
Primal simplex - iterations : 0 time: 0.00
Dual simplex - iterations : 0 time: 0.00
Mixed integer - relaxations: 0 time: 0.00
------------------------------------------------------------
Status: Solved
Optimal value (cvx_optval): +0.0703021
Problem is Solved
The minimum sidelobe level is -23.06 dB.