Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Music algorithm for doa estimation

Status
Not open for further replies.

km99

Newbie level 1
Newbie level 1
Joined
Mar 2, 2016
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
7
Can someone please explain me this matlab code here for angle of arrival estimation in DETAIL.


Code:
%CODE FOR MUSIC ALGO FOR DOA
clear all;
close all;
 clc;
% TRANSMITTED SIGNALS %

% Signal source directions
az =[50;70;90] % angles
el = zeros(size(az)); %  
M = length(az); % Number of sources

% Transmitted signals
L = 100; % Number of data snapshos recorded by receiver
rng('default'); %for same random generaor
m = randn(M,L); % normally disributed random signals

    
% ========= (2) RECEIVED SIGNAL ========= %

% Wavenumber vectors (in units of wavelength/2)
k = pi*[cosd(az).*cosd(el), sind(az).*cosd(el), sind(el)].';

% Array geometry [rx,ry,rz]
N = 10; % Number of antennas
r = [(-(N-1)/2:(N-1)/2).',zeros(N,2)]; % Assume uniform linear array

% Matrix of array response vectors
A = exp(-1j*r*k);

% Additive noise
sigma2 = 0.01; % Noise variance
n = sqrt(sigma2)*(randn(N,L) + 1j*randn(N,L))/sqrt(2);

% Received signal
x = A*m + n;

% ========= (3) MUSIC ALGORITHM ========= %

% Sample covariance matrix
Rxx = x*x'/L;

% Eigendecompose
[E,D] = eig(Rxx);
[lambda,idx] = sort(diag(D)); % Vector of sorted eigenvalues
E = E(:,idx); % Sort eigenvalues accordingly
En = E(:,1:end-M); % Noise eigenvectors (ASSUMPTION: M IS KNOWN)

% MUSIC search directions
AzSearch = (0:1:180).'; % Azimuth values to search
ElSearch = zeros(size(AzSearch)); % Simple 1D example

% Corresponding points on array manifold to search
kSearch = pi*[cosd(AzSearch).*cosd(ElSearch), sind(AzSearch).*cosd(ElSearch), sind(ElSearch)].';
ASearch = exp(-1j*r*kSearch);

% MUSIC spectrum
Z = sum(abs(ASearch'*En).^2,2);

% Plot
figure();
plot(AzSearch,10*log10(Z));
title('Simple 1D MUSIC Example');
xlabel('Azimuth (degrees)');
ylabel('MUSIC spectrum (dB)');
grid on; axis tight;

%END OF CODE
Please explain to me all the steps of the code as I am not able to understand it. It will be very helpful for me.
Thank You.
 
Last edited by a moderator:

This is my code (except you have messed up the formatting at the top). I put a lot of comments in the code, so it should be relatively easy to follow if you are familiar with the MUSIC algorithm. If you are not familiar with the MUSIC algorithm, then these notes will tell you everything you need to know: **broken link removed**.
 

    promach

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top