Direction of Arrival Estimation Algorithms
Direction of Arrival Estimation Algorithms
Nikhil Shetty
April 7, 2004
Contents
1 Software report 2
1.1 The Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 User’s Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.4 Design features and observed results . . . . . . . . . . . . . . 4
1.5 Further Work . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.6 Code Listing . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1
Chapter 1
Software report
2
later. The sample program is simulating a sine wave input that is
arriving at the array in the form of planar wavefronts ( the source
is assumed sufficiently far away ). The array itself is assumed to be
an m ( N OOF ELEM EN T ) element linear array with no directional
properties ( could be an array of dipoles ) in the given plane. The
number of elements can be varied. Further the frequency of the input
can be changed. df actor is the division factor of the wavelength that
represents the distance between the elements.(for eg: if df actor = 2
,distance between elements = λ2 ). Thus we have a handle on both
the frequency and the distance between elements in terms of the given
frequency.
The samples variable represents the number of samples that we wish
to take for the given input and f s represents the sampling frequency.
These two variables can be adjusted to simulate the processor available
, the amount of accuracy and the system refresh rate. For example ,
if we chose a high value of samples , amount of memory utilisation
increases and the refresh rate ( rate between consequent measurements
) decreases however the accuracy of calculations increases ( assuming
input signal lasts for that long a time ).
x is the matrix in which the signal recieved at the aray elements is
stored.
x1 (t1 ) x1 (t2 ) · · · x1 (tsamples )
x2 (t1 ) x2 (t2 ) · · · x2 (tsamples )
.. .. .. ..
. . . .
xm (t1 ) xm (t2 ) · · · xm (tsamples )
is the format in which the array is stored where xi (tj ) represents the
value of the input function detected at the ith element at the jth time
instant(including noise). Thus f 1 is the required input function and
r is the noise matrix. The noise is zero mean with variable variance
that can be changed by changing the multiplier.
Once the array manifold function is defined in a different file (refer
PART II) all the user has to do is call the music1d function to get the
estimate of the number of signals and a plot of P M U (θ) versun θ.
PART II: The array manifold is defined as the gain and phase change pro-
vided by the array elements to a given signal direction. The array
manifold is a function of θ and is saved in the file manifold file. Note
that the variables N OOF ELEM EN T S and df actor are global and
hence can be accessed by the manifold too.
3
PART III: This part consists of the actual implementation of MUSIC al-
gorithm.The function returns an estimate of the dir3ection of arrival.
It takes as input the x matrix. From the x matrix , the number of
elements and the samples is obvious. The first step is the calculation
of the covariance matrix. The next step involves calculation of the
eigenvalues and eigenvectors of S.
On knowing the minimum eigenvalue, the multiplicity of this eigen-
value is obtained. The multiplicity is presently being obtained using a
naive comparison (refer to the code listing). However , the final aim is
to use the MDL criterion to find the number of incident signals. The
next step is to obtain the noise eigenvector matrix of these minimum
eigenvalues and form the matrix nev. Using this nev , we can plot
to get direction of arrival in either a single dimension or multiple di-
mensions. The program presented works only for a planar angle. The
final aim is to get direction of arrival in terms of azimuthal angle and
elevation angle.
1.3 Testing
Ensure that all the files ( main, manifold,music1d are in same directory.
Run the main program in matlab and enter the number of signals and the
angle in degrees for each of the signals. The program will give the number
of signals as output along with the plot. Now we just have to obtain the
values of the highest d peaks to get the direction of arrivals.
Test Input 1: Enter value for number of signals as 1. Now , change the
angle from 10 to 80 and observe the output. We observe sharp peaks for
single signal.
Test Input 2: Enter an arbitrary value for number of signals ( less than
about 3/4th of the number of elements for good results ). Enter the values
of the angles and observe the output.
4
2. Noise With lower noise , the peaks become sharper. The presence of
added noise causes a spreading effect on the peaks.
5. Kind of input wave The kind of input wave can be varied . Resluts
were verified for sine waves and FM-modulated waves ( refer PART IV
). The plots obtained match those in theory. However the algorithm
could not detect sin2 waves even on removing the DC offset of the
waves.
1. Using the MDL criterion to find the number of incident signals to get
a better estimate.
2. Delve into why the algorithm does not work satisfactorily for inputs
like sin2 waves.
5
1.6 Code Listing
PART I:
clear
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%% PART I - THE CALLING PROGRAM %%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
nos=input(’enter no of signals’)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%% SIMULATION OF A POSSIBLE INPUT TO THE %%%%%%%%%%%
%%%%%%%% MUSIC ALGO %%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6
for ctr=1:nos
f1(i,k)=f1(i,k)+sin(2*pi*w*(k/fs+(1-i)/dfactor*sin(theta(ctr))/w))
% sine wave sampled - this function can be changed
end
end
end
x=f1+r; % ADDING NOISE TO THE INPUT SIGNAL ARRAY TO GET THE POSSIBLE OUTPUT
PART II:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% PART II - ARRAY MANIFOLD %%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function a=manifold(angle)
global NOOFELEMENTS dfactor
no=NOOFELEMENTS;
for k=1:no
a(k,1)=cos((1-k)*2*pi*sin(angle)/dfactor)+sin((1-k)*2*pi*sin(angle)/dfactor)*j
end
PART III:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%% PART III - MUSIC Algorithm %%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function estimate=music1d(x)
7
s(m,m)=0;
for i=1:m
for k=1:m
for n=1:samples
s(i,k)=s(i,k)+x(i,n)*x(k,n);
end
s(i,k)=s(i,k)/samples;
end
end
% eigenvalues of s
[evec eval]=eig(s); % evec is the set of eigenvectors and eval is the
% set of eigenvalues
8
% forming the eigenvector matrix corresponding to the minimum eigenvalues
nev(m,n)=0; % noise eigenvector matrix
for i=1:n
for l=1:m
nev(l,i)=evec(l,i);
end
end
PART IV:
clear
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%% PART IV - THE CALLING PROGRAM %%%%%%%%%%%%%%%%
%%%%%%%%%%% FOR FM-MODULATED INPUT %%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9
w=1000000000 ; %frequency (not angular)
nos=input(’enter no of signals’)
angl(nos)=0;
for i=1:nos
angl(i)=input(’enter angle in degrees’)
theta(i)=angl(i)*pi/180;
end
samples=100
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%SIMULATION OF A FM MODULATED INPUT TO THE %%%%%%%%%
%%%%%%%% MUSIC ALGO %%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end
end
end
10
x=f1+r;
noofsignals=music1d(x)
PART V:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%% PART V - MUSIC ALGORITHM %%%%%%%%%%%%%%%%
%%%%%%%%%%%% FOR 2-D DOA %%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function estimate=music1d(x)
%finding covariance
s(m,m)=0;
for i=1:m
for k=1:m
for n=1:samples
s(i,k)=s(i,k)+x(i,n)*x(k,n);
end
s(i,k)=s(i,k)/samples;
end
end
% eigenvalues of s
[evec eval]=eig(s); % evec is the set of eigenvectors and eval is the
% set of eigenvalues
n=0; %multiplicity
for i=1:m
11
if(evalues(i)<(1+minevalue)) % have to get a better approximator of
% multiplicity
n=n+1;
end
end
’Multiplicity of min root’
n
12
ctr1=ctr1+1;
end
’columns of I represent the elevation angles’
[Y,I]=max(pmu)
mesh(indep1,indep2,pmu)
PART VI:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% PART VI - ARRAY MANIFOLD %%%%%
%%%%% FOR 2-D DOA %%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function a=manifold(angle1,angle2)
global NOOFELEMENTS dfactor
no=NOOFELEMENTS;
for k=1:no
a(k,1)=cos((1-k)*2*pi*sin(angle1)/dfactor*cos(angle2))
+sin((1-k)*2*pi*sin(angle1)/dfactor*cos(angle2))*j;
end
13