hi.im looking for some help in my code foe 3d cubic antenna array beamforming for smart anyenna system that i would use lest mean square (lms)algorithm,the problem is the directivety of beem patteren has a random shift !!! is the error is phi or what

1 次查看(过去 30 天)
clc;
clear;
fo=900*10^6;
co=3*10^8;
lm=co/fo;
M = 12;
DOAu1 = 20;
a=lm/4;
b=lm/2;
c=3*lm/4;
d=lm;
e=1.5*lm;
f=2*lm;
g=3*lm;
dis=b;
DOAu11=DOAu1*pi/180;
u1 =sign(randn(1,500));
n=length(u1);
nn=(randn(n,M)+j*randn(n,M))*0.1;
mu=0.008;
Tu1=20*10^(-6);
ru=zeros(3,M);
xu=zeros(3,M);
XU=zeros(1,M);
yu=zeros(3,M);
eu=zeros(3,n);
Bu=zeros(3,n);
wu=zeros(3,M);
Gainu1=0.5*(exp(j*pi/2));
for k=1:n
U1=Gainu1*repmat(u1(k),1,M);
for m=1:M
Au1=exp(-j*2*pi*f*Tu1);
ph = 0; % E-plane, phi = 90 for H-plane
phi = ph*pi/180;
Bu11(m)=exp(-j*2*pi*(m-1)*dis*sin(DOAu11)*cos(phi)/lm);
Bu12(m)=exp(-j*2*pi*(m-1)*dis*sin(DOAu11)*sin(phi)/lm);
Bu13(m)=exp(-j*2*pi*(m-1)*dis*cos(DOAu11)/lm);
Bu1(m)=Bu11(m).*Bu12(m).*Bu13(m);
ru(1,m)=U1(m)*Au1*Bu1(m);
xu(1,m)=ru(1,m)+nn(k,m);
end;
%Calculat error
yu(1,k)=xu(1,:)*wu(1,:)';
eu(1,k)=u1(k)-yu(1,k);
wu(1,:)=wu(1,:)+mu*xu(1,:)*conj(eu(1,k));
Bu(1,k)=eu(1,k)*eu(1,k)';
end;
q=0;
wu(1,:)=conj(wu(1,:));
for angle1=-90*pi/180:1*pi/180:90*pi/180;
q=q+1;
angle2(q)=2*pi*dis*sin(angle1)/lm;
for t=1:M
G(t)=exp(j*angle2(q)*(t-1));
end;
beamu1(q)=abs(wu(1,:)*G');
end;
beamu1=beamu1/max(beamu1);
figure(1);clf;
polar(-90*pi/180:1*pi/180:90*pi/180,beamu1,'r');
hold on;
view(90,-90);
grid on;
zoom on;
figure(3);clf;
th=-90:1:90;
plot(th,beamu1,'r','LineWidth',2);
grid on;
title('Linear Plot Pattern of First Signal-1st DOA');

回答(0 个)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by