Also, try different values of theta such as:

theta=0*pi/180

theta=45*pi/180

theta=90*pi/180

See how the polar plot changes. Basically you are changing the direction of the arriving wave.

]]>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% BEAMFORMING USING A

% UNIFORM LINEAR ARRRAY

% COPYRIGHT RAYMAPS (C) 2018

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear all

close all

f=1e9;

c=3e8;

l=c/f;

d=l/2;

no_elements=10;

% phi=pi/6;

phi=0:pi/360:2*pi;

% theta=0:pi/180:2*pi;

theta=pi/180;

n=1:no_elements;

n=transpose(n);

X=exp(-i*(n-1)*2*pi*d*cos(theta)/l);

w=exp( i*(n-1)*2*pi*d*cos(phi)/l);

w=transpose(w);

r=w*X;

polar(phi,abs(r),’b’)

title (‘Gain of a Uniform Linear Array’)

But now it gives the following error:

Error using polar (line 65)

THETA and RHO must be the same size.

Error in raymapcode (line 28)

polar(phi,abs(r),’b’)

polar(phi,abs(r),’b’)

Also, need to define phi and theta properly.

]]>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% BEAMFORMING USING A

% UNIFORM LINEAR ARRRAY

% COPYRIGHT RAYMAPS (C) 2018

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear all

close all

f=1e9;

c=3e8;

l=c/f;

d=l/2;

no_elements=10;

% phi=pi/6;

phi=0:pi/360:2*pi;

% theta=0:pi/180:2*pi;

theta=pi/180;

n=1:no_elements;

n=transpose(n);

X=exp(-i*(n-1)*2*pi*d*cos(theta)/l);

w=exp( i*(n-1)*2*pi*d*cos(phi)/l);

w=transpose(w);

r=w*X;

polar(theta,abs(r),’b’)

title (‘Gain of a Uniform Linear Array’)

But it gives me the following error:

Error using polar (line 65)

THETA and RHO must be the same size.

Error in raymapcode (line 28)

polar(theta,abs(r),’b’)

http://www.raymaps.com/index.php/basics-of-beam-forming-in-wireless-communications/

Instead of varying theta change phi and observe the behavior.

]]>1. Rotate the array 360 degrees and find the angle where received signal strength at broadside is maximum.

2. Measure the difference in angle between two adjacent sensor elements and this should give you the direction of incoming wave e.g. if the signals are arriving from broadside difference would be zero.

More complex systems use High Resolution Spectral Estimation techniques such as MUSIC and ESPRIT.

]]>Your code gives BER vs Receiver Array size. But if I am interested in DOAs and DODs of the multipaths of the users instead of the BER, then what should I do? If you guide me a little bit in MATLAB with comments as I am not so much expert in MATLAB, I will be obliged.

Regards, ]]>