You are on page 1of 4

3) a) The beamformer Capon and Bartlett beamformer

3) b)

Theta= 20 Thetha=32 BW(degree) SLL(dB) SINR(dB)


Capon 18.9559 6.4955 18.8082
Bartlett 17.4797 6.3987 12.0423
Theta= 0 Thetha=20 BW(degree) SLL(dB) SINR(dB)
Capon 16.9037 3.8689 18.6146
Bartlett 18.6319 6.3987 9.8336

We can conclude that Bartlett beamformer has the ability to maintain the Side lobe levels when the
angles change. It’s clear that the beamformer Capon possesses a better SINR response.
3)c)

The plot shows us that the Capon Beamformer has a more constant and better SINR response through
the different angles, This shows a confirmation from the information obtained in the numeral 3)b)

Code:
clear all;
close all;
M =8;
Rnn = 0.1*eye(M);
Np = 10000;
M=8;
theta1=[20 0];
theta2=[32 20];
figure(1)
for i=1:2
[P_cap, BW_cap, SLL_cap, SINR_cap, theta] = beamPattern(theta1(i), theta2(i), M, Rnn, Np,'Capon');
[P_bar, BW_bar, SLL_bar, SINR_bar] = beamPattern(theta1(i), theta2(i), M, Rnn,Np,'Bartlett');
subplot(2,1,i)
plot(theta,10*log10(P_cap), theta, 10*log10(P_bar));
grid on
axis([-90 90 -30 1]);
xlabel('\theta (degree)');
ylabel('P(\theta)(dB)');
title(['Beam pattern \theta_1= ' num2str(theta1(i)) ', \theta_2= ' num2str(theta2(i))]);
legend('Capon', 'Bartlett',2);

display('Capon: theta1 theta2 BW(degree) SLL(dB) SINR(dB)')


display([' ' num2str(theta1(i)) ' ' num2str(theta2(i)) ' '...
num2str(BW_cap) ' ' num2str(SLL_cap) ' ' num2str(SINR_cap)]);
display('Bartlett:' )
display([' ' num2str(theta1(i)) ' ' num2str(theta2(i)) ' '...
num2str(BW_bar) ' ' num2str(SLL_bar) ' ' num2str(SINR_bar)]);
end
NP = 1000;
figure(2)
for i=1:2
[SINR_cap,SINR_bar,theta2] = beamFormerSNIR(theta1(i), M, Rnn, Np);
subplot(2,1,i)
plot(theta2,SINR_cap, theta2, SINR_bar);
grid on
axis([1 90 -1 20]);
xlabel('\theta_2 (degree)');
ylabel('SINR(dB)');
title(['SINR, \theta_1= ' num2str(theta1(i))]);
legend('Capon', 'Bartlett',4);
end

function [P,BW,SLL,SINR,theta] = beamPattern(theta1,theta2,M,Rnn,Np,mod)


Rss = eye(2);
mu1 = pi*sind(theta1);
mu2 = pi*sind(theta2);
a1 = exp(1i*mu1*(0:M-1))';
a2 = exp(1i*mu2*(0:M-1))';
if strcmp(mod,'Capon')
g = [1;0];
A = [a1 a2];
w = inv(A*Rss*A'+Rnn)*A*inv(A'*inv(A*Rss*A'+Rnn)*A)*g;
elseif strcmp(mod,'Bartlett')
w = 1/M*a1;
end
theta = linspace(-90,90,Np);
P = zeros(Np,1);
for i=1:Np
mu = pi*sind(theta(i));
a = exp(1i*mu*(0:M-1))';
P(i) = abs(w'*a);
end
[pks,i] = findpeaks(P, 'SORTSTR', 'descend');
i_r=i(1)+1;
i_l=i(1)-1;
% find mainlobe width
while(P(i_r)>0.5*pks(1))
i_r=i_r+1;
end
while(P(i_l)>0.5*pks(1))
i_l=i_l-1;
end
BW = theta(i_r)-theta(i_l);
SLL= 10*log10(pks(1)/pks(2));
SINR = 10*log10(abs(w'*a1)^2/(abs(w'*a2)^2+abs(w'*Rnn*w)));

function [SINR_cap, SINR_bar, theta2] = beamFormerSNIR(theta1, M, Rnn, Np)


Rss = eye(2);
g=[1;0];
mu1 = pi*sind(theta1);
a1 = exp(1i*mu1*(0:M-1))';
w_bar = a1/M;
theta2 = linspace(-90,90,Np);
SINR_cap = zeros(Np,1);
SINR_bar = zeros(Np,1);
for i=1:Np
mu = pi*sind(theta2(i));
a2 = exp(1i*mu*(0:M-1))';
A = [a1 a2];
w_cap = inv(A*Rss*A'+Rnn)*A*inv(A'*inv(A*Rss*A'+Rnn)*A)*g;
SINR_cap(i) = 10*log10(abs(w_cap'*a1)^2/(abs(w_cap'*a2)^2+abs(w_cap'*Rnn*w_cap)));
SINR_bar(i) = 10*log10(abs(w_bar'*a1)^2/(abs(w_bar'*a2)^2+abs(w_bar'*Rnn*w_bar)));
end
end

You might also like