n = 20;
lambda = 1;
d = 0.45*lambda;
theta_pass = 40;
theta_stop = 50;
ripple = 0.1;
m = 30*n;
omega_zero = -2*pi*d/lambda;
omega_pass = -2*pi*d/lambda*cos(theta_pass*pi/180);
omega_stop = -2*pi*d/lambda*cos(theta_stop*pi/180);
omega_pi = +2*pi*d/lambda;
omega = linspace(-pi,pi,m)';
A = exp( -j*kron( omega, [-(n-1):n-1] ) );
indp = find( omega >= omega_zero & omega <= omega_pass );
Ap = A(indp,:);
inds = find( omega >= omega_stop & omega <= omega_pi );
As = A(inds,:);
cvx_begin
variable r(2*n-1,1) complex
minimize( max( abs( As*r ) ) )
subject to
real( Ap*r ) >= (10^(-ripple/20))^2;
real( Ap*r ) <= (10^(+ripple/20))^2;
real( A*r ) >= 0;
r(n) == conj(r(n));
r(n-1:-1:1) == conj(r(n+1:end));
cvx_end
disp(['Problem is ' cvx_status])
if ~strfind(cvx_status,'Solved')
return
end
w = spectral_fact(r);
min_sidelobe_level = 10*log10( cvx_optval );
fprintf(1,'The minimum sidelobe level is %3.2f dB.\n\n',...
min_sidelobe_level);
theta = [-180:180]';
G = kron( cos(pi*theta/180), [0:n-1] );
G = exp(2*pi*i*d/lambda*G);
y = G*w;
figure(1), clf
ymin = -40; ymax = 5;
plot([-180:180], 20*log10(abs(y)), ...
[theta_stop theta_stop],[ymin ymax],'r--',...
[-theta_pass -theta_pass],[ymin ymax],'r--',...
[-theta_stop -theta_stop],[ymin ymax],'r--',...
[theta_pass theta_pass],[ymin ymax],'r--');
xlabel('look angle'), ylabel('mag y(theta) in dB');
axis([-180 180 ymin ymax]);
figure(2), clf
zerodB = 50;
dBY = 20*log10(abs(y)) + zerodB;
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')
text(-(min_sidelobe_level + zerodB),0,sprintf('%0.1f dB',min_sidelobe_level));
plot([0 60*cos(theta_pass*pi/180)], [0 60*sin(theta_pass*pi/180)], 'k:')
plot([0 60*cos(-theta_pass*pi/180)],[0 60*sin(-theta_pass*pi/180)],'k:')
plot([0 60*cos(theta_stop*pi/180)], [0 60*sin(theta_stop*pi/180)], 'k:')
plot([0 60*cos(-theta_stop*pi/180)],[0 60*sin(-theta_stop*pi/180)],'k:')
hold off
Calling sedumi: 2500 variables, 483 equality constraints
For improved efficiency, sedumi is solving the dual problem.
------------------------------------------------------------
SeDuMi 1.21 by AdvOL, 2005-2008 and Jos F. Sturm, 1998-2003.
Alg = 2: xz-corrector, Adaptive Step-Differentiation, theta = 0.250, beta = 0.500
eqs m = 483, order n = 2058, dim = 2501, blocks = 444
nnz(A) = 46998 + 0, nnz(ADA) = 37483, nnz(L) = 18983
it : b*y gap delta rate t/tP* t/tD* feas cg cg prec
0 : 1.92E+02 0.000
1 : -1.99E+00 3.67E+01 0.000 0.1911 0.9000 0.9000 3.30 1 1 1.1E+02
2 : -1.31E+00 1.25E+01 0.000 0.3397 0.9000 0.9000 2.06 1 1 2.2E+01
3 : -4.98E-01 7.58E+00 0.000 0.6076 0.9000 0.9000 3.97 1 1 5.6E+00
4 : -1.23E-01 3.70E+00 0.000 0.4887 0.9000 0.9000 3.47 1 1 1.1E+00
5 : -2.37E-02 1.27E+00 0.000 0.3426 0.9000 0.9000 2.37 1 1 2.4E-01
6 : -1.00E-02 5.18E-01 0.000 0.4082 0.9000 0.9000 1.34 1 1 8.9E-02
7 : -7.22E-03 3.56E-01 0.000 0.6878 0.9000 0.9000 1.13 1 1 6.1E-02
8 : -5.73E-03 2.61E-01 0.000 0.7340 0.9000 0.9000 1.09 1 1 4.4E-02
9 : -4.70E-03 1.83E-01 0.000 0.6985 0.9000 0.9000 1.05 1 1 3.1E-02
10 : -4.70E-03 1.25E-01 0.000 0.6861 0.9000 0.0000 1.01 1 1 2.6E-02
11 : -4.70E-03 9.26E-02 0.000 0.7388 0.9000 0.0000 1.00 1 1 2.3E-02
12 : -4.22E-03 6.98E-02 0.119 0.7545 0.9000 0.9000 1.00 1 1 1.8E-02
13 : -3.69E-03 2.07E-02 0.000 0.2969 0.9246 0.9000 0.97 1 1 7.5E-03
14 : -3.69E-03 8.02E-03 0.000 0.3866 0.9000 0.0000 1.01 1 1 4.7E-03
15 : -3.46E-03 1.45E-03 0.000 0.1814 0.9072 0.9000 1.00 1 1 1.1E-03
16 : -3.43E-03 1.77E-04 0.000 0.1214 0.9192 0.9000 1.00 1 1 2.1E-04
17 : -3.43E-03 2.89E-05 0.000 0.1637 0.9151 0.9000 1.00 1 1 4.4E-05
18 : -3.43E-03 4.31E-06 0.000 0.1490 0.9038 0.9000 1.00 1 1 7.1E-06
19 : -3.43E-03 4.33E-07 0.000 0.1004 0.9116 0.9000 1.00 1 1 8.7E-07
20 : -3.43E-03 2.09E-09 0.000 0.0048 0.9990 0.9865 1.00 1 1 5.6E-09
iter seconds digits c*x b*y
20 1.2 6.8 -3.4281462945e-03 -3.4281468795e-03
|Ax-b| = 1.2e-09, [Ay-c]_+ = 1.5E-10, |x|= 9.7e-01, |y|= 2.9e-01
Detailed timing (sec)
Pre IPM Post
5.000E-02 1.170E+00 1.000E-02
Max-norms: ||b||=1, ||c|| = 1.023293e+00,
Cholesky |add|=0, |skip| = 0, ||L.L|| = 1.76605.
------------------------------------------------------------
Status: Solved
Optimal value (cvx_optval): +0.00342815
Problem is Solved
The minimum sidelobe level is -24.65 dB.