微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 微波和射频技术 > 天线设计和射频技术 > implementation of smart antenna+matlab

implementation of smart antenna+matlab

时间:04-08 整理:3721RD 点击:
hello,

I need some help in matlab coding, i have to design the adaptive beamforming algorithms (LMS and NLMS) in smart antennas, and compare them in radation pattern and convergence analysis.

i got some codes from www.mathwork.com site....but not able to find enough information for analysing errors..

can anyone please help me out...!
thank you....

hi.
i am studing smart antenna too. i use LMS and RLS algorithm. i am searching the application of adaptive array in wireless communication but i have some problem . now what you need really? u need matlab code for LMS algorithm?

Hello

Sorry for a late reply... i have finished my dissertation now... had done the coding for LMS...

hello,
could you provide me some matlab links where i can simulate using music algorithms and other stuffs. I tred mathworks , but they're difficult to understand
I've just started in this topic and now I'm kind of lost

hello saleh
I have the same project as you did. could you pleas to help me about matlab codes of LMS and RLS ?

hope this would help you

%% LMS Algorithm %%%%
%%%%%%%%%%%%%%%%%%%

%----- Givens-----%
clear all;
clc;
clf;


d = .5; % element spacing in terms of wavelength d = lambda/2
%N = input(' How many element do you want in uniform linear array? '); % number of elements in array
N= 16;
thetaS = input(' What is the desired users AOA (in degrees)? ');
thetaI1 = input(' What is the interferers AOA(in degrees)? ');
thetaI2 = input(' What is the interferers AOA(in degrees)? ');
%----- Desired Signal & Interferer -----%
T=1E-3;
t=(1:100)*T/100;
it=1:100;
S=cos(2*pi*t/T);
thetaS = thetaS*pi/180; % desired user AOA
I = randn(1,100);
thetaI1 = thetaI1*pi/180; % interferer AOA
thetaI2 = thetaI2*pi/180; % interferer AOA
%----- Create Array Factors for each user's signal for linear array -----%

vS = []; vI = [];
i=1:N;
vS=exp(1j*(i-1)*2*pi*d*sin(thetaS)).';
vI1=exp(1j*(i-1)*2*pi*d*sin(thetaI1)).';
vI2=exp(1j*(i-1)*2*pi*d*sin(thetaI2)).';
vI = vI1+vI2;

%----- Solve for Weights using LMS -----%

w = zeros(N,1); snr = 20; % signal to noise ratio
X=(vS+vI);
Rx=X*X';
mu=1/(real(trace(Rx)))
%mu = input('What is step size?')


wi=zeros(N,max(it));
oldmu = mu;
for n = 1:100;
mu(n) = oldmu/(1-(oldmu^(n+1)));

oldmu = mu(n);


end

for n = 1:length(S)



x = S(n)*vS + I(n)*vI;
%y = w*x.';
y=w'*x;

e = conj(S(n)) - y; esave(n) = abs(e)^2;
% w = w +mu*e*conj(x);
w=w+mu(n)*conj(e)*x;
wi(:,n)=w;
yy(n)=y;


mu(n);
x1 = S(n)*vS + I(n)*vI;
%y = w*x.';
y1=w'*x;

e1 = conj(S(n)) - y1; esave(n) = abs(e1)^2;
% w = w +mu*e*conj(x);
w1=w+mu(n)*conj(e1)*x1;
wi(:,n)=w1;
yy1(n)=y1;


end
w = (w./w(1));% normalize results to first weight
w1 = (w1./w1(1))
%----- Plot Results -----%

theta = -pi/2:.01:pi/2;
AF = zeros(1,length(theta));

% Determine the array factor for linear array

for i = 1:N
AF = AF + w(i)'.*exp(1j*(i-1)*2*pi*d*sin(theta));
end
AF1 = zeros(1,length(theta));

for i = 1:N
AF1 = AF1 + w1(i)'.*exp(1j*(i-1)*2*pi*d*sin(theta));
end


figure;
plot(theta*180/pi,abs(AF)/max(abs(AF)),'k')


xlabel('AOA (deg)')
ylabel('|AF_n|')
axis([-90 90 0 1.1])
set(gca,'xtick',[-90 -60 -30 0 30 60 90])

grid on
hold on
plot(theta*180/pi,abs(AF1)/max(abs(AF1)),'g')
hold off

figure;
plot(it,S,'k',it,yy,'k--',it,yy1,'r*')
xlabel('No. of Iterations')
ylabel('Signals')
legend('Desired signal','Array output')

disp('%------------------------------------------------------------------------%')
disp(' ')
disp([' The weights for the N = ',num2str(N),' ULA are:'])
disp(' ')
for m = 1:length(w)
disp([' w',num2str(m),' = ',num2str(w(m))])
end
disp(' ')

figure;
plot(it,abs(wi(1,:)),'bx',it,abs(wi(2,:)),'go',it, abs(wi(3,:)),'ms',it,abs(wi(4,:)),'r+','markersize ',2)
xlabel('Iteration no.')
ylabel('|weights|')
legend('w1','w2','w3','w4')
title('adaptation of weights')


figure;plot(it,esave,'k')
xlabel('Iteration no.')
ylabel('Mean square error')

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top