Charity Kasubi
New Member
- Aug 15, 2011
- 1
- 1
I am doing a project titled decoupling technique for antennas and high isolation my code is in matlab software i cant get correct graphs for isolation and return loss of antenna(below -10dB before and after decoupling technique) .This is an IEEE conference paper.Below is the coding i have done:
%%%%%%%%%%%%%%%%%%%%% A Decoupling Technique for Increasing the Port Isolation Between Two Strongly Coupled Antennas %%
%%------------------- Define Variables:----------------------%%
% N - # of elements in array %
% d - element spacing in wavelengths %
% ang - theta in deg %
% thetaS - desired user AOA (deg) %
% thetaI - interferer AOA (deg) %
% T - period of desired signal %
% t - time axis for desired signal %
% S - desired signal %
% I - interfering signal %
% vS,vI - steering vectors of desired user and interferers %
% X - total array factor %
% Rxx - total received signal correlation matrix %
% mu - convergence parameter %
% w - weights of ULA determined using LMS algorithm %
% x - total received signal %
% y - array output %
% e - error between array output and desired signal %
% theta - range of AOA's (rad) %
% AF - weighted array output
% S11,S12,S21 and S22 - scattering matrix parameters %
% ZG and ZL - load impedances
% Gin and Gout - input & output reflection coefficients
%%-----------------------------------------------------------%%
%----- -----%
clc;clear
all, close all;
d = .5;
% element spacing in terms of wavelength d = lambda/2
gamma = 0.5;
%S11 = 0.61<165* , S21 = 3.72<59* , S12 = 0.05<42* , S22 = 0.45<-48*;
Sm = smat([0.61 165 3.72 59 0.05 42 0.45 -48]);
% -- Scattering matrix
Z0 = 50;
ZG = 10+20j; gG = z2g(ZG,Z0);
ZL = 30-40j; gL = z2g(ZL,Z0);
M = 2;
%input(' How many element do you want in uniform linear array? '); % number of elements in array
thetaS = 0;
%input(' Enter the desired users angle (in degrees)? ');
thetaI= 30;
%input ('Enter The Angle of Incidence of the Undesired Interference Source Signal : ') ; %30
%----- Assuming the Desired Signal & Interference signal -----%
it=1:200;
% number of iteration
T=3*10^8;
%T - period of desired signal
t=(it)*T/200;
S=sin(2*pi*t/T);
thetaS = thetaS*pi/180;
% desired user AOA
I = randn(1,200);
thetaI = thetaI*pi/180;
% interferer AOA
%----- Create Array Factors for each user's signal for linear array -----%
vS = []; vI = [];
i=1:M;
vS=exp(1j*(i-1)*2*pi*d*sin(thetaS)).';
% desired signal recieved STEERING VECTOR
vI=exp(1j*(i-1)*2*pi*d*cos(thetaI)).';
%intereference signal recieved
Gin = gin(Sm,gL);
Gout = gout(Sm,gG);
Gmag = sgain(Sm);
% GMAG = 41.50, or, 16.18 dB
figure(7)
plot([Gin,Gout],
'r--'),
xlabel(
'input reflection coeff')
ylabel(
'output reflection coeff')
title(
'Input & output reflection coefficient'),
%----- Solve for Weights -----%
w = zeros(M,1);
for
snr = 10; % signal to noise ratio
X=(vS+vI);
Rx=(X*X');
% correlation matrix..
end
mu=1/(2*real(trace(Rx)))
%mu = input('What is step size?')
% trace(Rx) is the maximum eigen value of correlation matrix of i/p signal
wi=zeros(M,max(it));
for
n = 1:length(S) % selecting the training inputs
x = S(n)*vS + I(n)*vI;
y=w'*x;
%y = w*x. calulating the "------- OUTPUT BEAMFORMER-----.. where w is weight and x is the input signal'
e = conj(S(n)) - y ;
% calulating the --- ERROR ---- i.e " e = reference signal(desired) - output signal
esave(n) = abs(e).^2;
% learning curve
w=w+mu*conj(e)*x;
% w = w +mu*e*conj(x) calculating the ------WEIGHT----
wi,n)=w;
% store weight for matrix to plot
yy(n)=y;
end
w = (w./w(1));
% normalize results to first weight % Array operations "." Element-by-element multiplicative operations are obtainedFor example,
% C = A ./ B is the matrix with elements c(i,j) = a(i,j)/b(i,j).
%----- Plot Results -----%
theta = -pi/2:.02i/2;
AF = zeros(1,length(theta));
% Determine the array factor for linear array
for
i = 1:M
AF = AF + w(i)'.*exp(1j*(i-1)*2*pi*d*sin(theta));
end
% two closely spaced printed monopole antennas %
figure(1)
AF = abs(AF);
polar(theta,AF,
'-r'), title('Measured radiation patterns of the two closely spaced printed monopole antennas'),
grid
on;
xlabel(
'Angle(Degree)')
ylabel(
' Normalized gain(ratio) ')
%**************************************************************************
figure(2);
plot(it,S,
'k',it,yy,'r--')
xlabel(
'No. of Iterations')
ylabel(
'Signals')
legend(
'Desired signal','Array output')
%*********MY ESTIMATE*************************************************************
figure(3);semilogy(it,esave,
'k')
xlabel(
'Iteration no.')
ylabel(
'error')
figure(4);plot(it,wi)
xlabel(
'Iteration no.')
ylabel(
'|weights|')
w=0i/20i;
q=1:1:7;
figure(5),
for
i=0i/20i
brf_rect((i)*(20/pi)+1)=0.318+2*(0.022*cos(i)+0.265*cos(2*i)+0.045*cos(3*i));
end
plot(w,brf_rect,
'r-');hold on % rectangular window
plot(w,1.2*brf_rect,
'k--');
xlabel(
'Frequency (Hz)')
ylabel(
'Return Loss(dB)')
title(
'The Return Loss of the monopole')
figure(6),
for
i=0i/20i
brf_hanning((i)*(20/pi)+1)=0.318+2*(0.0165*cos(i)+0.066*cos(2*i));
end
plot(w,brf_hanning,
'g-') ;hold on % Hanning window
plot(w,1.2*brf_hanning,
'k--') ;
xlabel(
'Frequency (Hz)')
ylabel(
'Isolation(dB)')
title(
'The Isolation of the monopole')
%%%%%%%%%%%%%%%%%%%%% A Decoupling Technique for Increasing the Port Isolation Between Two Strongly Coupled Antennas %%
%%------------------- Define Variables:----------------------%%
% N - # of elements in array %
% d - element spacing in wavelengths %
% ang - theta in deg %
% thetaS - desired user AOA (deg) %
% thetaI - interferer AOA (deg) %
% T - period of desired signal %
% t - time axis for desired signal %
% S - desired signal %
% I - interfering signal %
% vS,vI - steering vectors of desired user and interferers %
% X - total array factor %
% Rxx - total received signal correlation matrix %
% mu - convergence parameter %
% w - weights of ULA determined using LMS algorithm %
% x - total received signal %
% y - array output %
% e - error between array output and desired signal %
% theta - range of AOA's (rad) %
% AF - weighted array output
% S11,S12,S21 and S22 - scattering matrix parameters %
% ZG and ZL - load impedances
% Gin and Gout - input & output reflection coefficients
%%-----------------------------------------------------------%%
%----- -----%
clc;clear
all, close all;
d = .5;
% element spacing in terms of wavelength d = lambda/2
gamma = 0.5;
%S11 = 0.61<165* , S21 = 3.72<59* , S12 = 0.05<42* , S22 = 0.45<-48*;
Sm = smat([0.61 165 3.72 59 0.05 42 0.45 -48]);
% -- Scattering matrix
Z0 = 50;
ZG = 10+20j; gG = z2g(ZG,Z0);
ZL = 30-40j; gL = z2g(ZL,Z0);
M = 2;
%input(' How many element do you want in uniform linear array? '); % number of elements in array
thetaS = 0;
%input(' Enter the desired users angle (in degrees)? ');
thetaI= 30;
%input ('Enter The Angle of Incidence of the Undesired Interference Source Signal : ') ; %30
%----- Assuming the Desired Signal & Interference signal -----%
it=1:200;
% number of iteration
T=3*10^8;
%T - period of desired signal
t=(it)*T/200;
S=sin(2*pi*t/T);
thetaS = thetaS*pi/180;
% desired user AOA
I = randn(1,200);
thetaI = thetaI*pi/180;
% interferer AOA
%----- Create Array Factors for each user's signal for linear array -----%
vS = []; vI = [];
i=1:M;
vS=exp(1j*(i-1)*2*pi*d*sin(thetaS)).';
% desired signal recieved STEERING VECTOR
vI=exp(1j*(i-1)*2*pi*d*cos(thetaI)).';
%intereference signal recieved
Gin = gin(Sm,gL);
Gout = gout(Sm,gG);
Gmag = sgain(Sm);
% GMAG = 41.50, or, 16.18 dB
figure(7)
plot([Gin,Gout],
'r--'),
xlabel(
'input reflection coeff')
ylabel(
'output reflection coeff')
title(
'Input & output reflection coefficient'),
%----- Solve for Weights -----%
w = zeros(M,1);
for
snr = 10; % signal to noise ratio
X=(vS+vI);
Rx=(X*X');
% correlation matrix..
end
mu=1/(2*real(trace(Rx)))
%mu = input('What is step size?')
% trace(Rx) is the maximum eigen value of correlation matrix of i/p signal
wi=zeros(M,max(it));
for
n = 1:length(S) % selecting the training inputs
x = S(n)*vS + I(n)*vI;
y=w'*x;
%y = w*x. calulating the "------- OUTPUT BEAMFORMER-----.. where w is weight and x is the input signal'
e = conj(S(n)) - y ;
% calulating the --- ERROR ---- i.e " e = reference signal(desired) - output signal
esave(n) = abs(e).^2;
% learning curve
w=w+mu*conj(e)*x;
% w = w +mu*e*conj(x) calculating the ------WEIGHT----
wi,n)=w;
% store weight for matrix to plot
yy(n)=y;
end
w = (w./w(1));
% normalize results to first weight % Array operations "." Element-by-element multiplicative operations are obtainedFor example,
% C = A ./ B is the matrix with elements c(i,j) = a(i,j)/b(i,j).
%----- Plot Results -----%
theta = -pi/2:.02i/2;
AF = zeros(1,length(theta));
% Determine the array factor for linear array
for
i = 1:M
AF = AF + w(i)'.*exp(1j*(i-1)*2*pi*d*sin(theta));
end
% two closely spaced printed monopole antennas %
figure(1)
AF = abs(AF);
polar(theta,AF,
'-r'), title('Measured radiation patterns of the two closely spaced printed monopole antennas'),
grid
on;
xlabel(
'Angle(Degree)')
ylabel(
' Normalized gain(ratio) ')
%**************************************************************************
figure(2);
plot(it,S,
'k',it,yy,'r--')
xlabel(
'No. of Iterations')
ylabel(
'Signals')
legend(
'Desired signal','Array output')
%*********MY ESTIMATE*************************************************************
figure(3);semilogy(it,esave,
'k')
xlabel(
'Iteration no.')
ylabel(
'error')
figure(4);plot(it,wi)
xlabel(
'Iteration no.')
ylabel(
'|weights|')
w=0i/20i;
q=1:1:7;
figure(5),
for
i=0i/20i
brf_rect((i)*(20/pi)+1)=0.318+2*(0.022*cos(i)+0.265*cos(2*i)+0.045*cos(3*i));
end
plot(w,brf_rect,
'r-');hold on % rectangular window
plot(w,1.2*brf_rect,
'k--');
xlabel(
'Frequency (Hz)')
ylabel(
'Return Loss(dB)')
title(
'The Return Loss of the monopole')
figure(6),
for
i=0i/20i
brf_hanning((i)*(20/pi)+1)=0.318+2*(0.0165*cos(i)+0.066*cos(2*i));
end
plot(w,brf_hanning,
'g-') ;hold on % Hanning window
plot(w,1.2*brf_hanning,
'k--') ;
xlabel(
'Frequency (Hz)')
ylabel(
'Isolation(dB)')
title(
'The Isolation of the monopole')