+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 20 of 27
  1. #1
    Full Member level 4
    Points: 2,910, Level: 12

    Join Date
    Feb 2005
    Posts
    195
    Helped
    1 / 1
    Points
    2,910
    Level
    12

    music algorithm tutorial

    Hi, everyone. I have a simple question about the direction finding by using MUSIC Algorithm.

    since the antenna array output is:

    X=A*F+N

    where A is the steering vectors matrix, F is the excitations (complex number???) and N is the noise.

    and the covariance matrix of the output X vector is:

    S=E(XX*)=AE(FF*)A*+E(NN*)

    For given number of incident wave, for example, D incident wave, the F is a fixed vector, and E(FF*) = FF*, therefore its rank is 1. Is it correct?

    If possible, would you give me some hints about the numerical code for the MUSIC algorithm?

    I am confused how can I construct the E(FF*). Should I use the time average? if so , what is the sampling frequency I should use? Is it larger than the carrier frequency?

    Thanks in advance.

    •   Alt10th November 2006, 18:13

      advertising

        
       

  2. #2
    Junior Member level 2
    Points: 1,584, Level: 9
    Achievements:
    7 years registered

    Join Date
    Nov 2006
    Posts
    20
    Helped
    1 / 1
    Points
    1,584
    Level
    9

    music direction finding

    Refer Array signal processing by Neilson

    To construct E(FF*) do u have the signal without noise i mean(F),go for E(XX*). music and espirit of DOA estimation methods coming under subspace methods.
    Try understanding subspace methods and orthogonality concepts.
    I will try to help with the matlab code for music


    1 members found this post helpful.

  3. #3
    Full Member level 4
    Points: 2,910, Level: 12

    Join Date
    Feb 2005
    Posts
    195
    Helped
    1 / 1
    Points
    2,910
    Level
    12

    music algorithm

    Hi, deepabhargavi. Thanks for your reply.

    I built the MATLAB code and do the test a few days ago. I found that the MUSIC algorithm can detect multiple non-coherent signals only, which although FF* at each sample is rank 1, but the time average SUM(FF*)/Number of Sampling is rank M=Number of Waveform.

    When the input waveforms are coherent, for example, several single-frequency sinusoidal plane-wave, the MUSIC algorithm will not be able to distinguish it, since the rank of E(FF*) is always 1.

    I am thinking whether there are other "High-Resolution" Algorithms can be used for Direction Finding of multiple coherent signals?

    Thanks.



  4. #4
    Newbie level 2
    Points: 198, Level: 2

    Join Date
    Nov 2011
    Posts
    2
    Helped
    0 / 0
    Points
    198
    Level
    2

    Re: MUSIC Algorithm for Direction Finding

    Hello,

    I want to implement the MUSIC algorithm in MATLAB.

    I have found a function for MUSIC [S,w] = pmusic(x,p).

    Can any one tell me how i can find the Direction of Arrival


    Bilal



  5. #5
    Full Member level 3
    Points: 1,231, Level: 7
    Achievements:
    Created Blog entry

    Join Date
    Oct 2013
    Posts
    165
    Helped
    54 / 54
    Points
    1,231
    Level
    7
    Blog Entries
    5

    Re: MUSIC Algorithm for Direction Finding

    Quote Originally Posted by CaseBiall View Post
    I want to implement the MUSIC algorithm in MATLAB.
    I would strongly advise against using the built-in Matlab functions, as I think it's far easier to write your own functions so you can be sure about what is going on.

    I have written some very simple Matlab code for a basic 1D (azimuth only) MUSIC direction of arrival estimation, as many people seem to have trouble getting started with this:

    Code:
    close all; clear all; clc;
    
    
    % ======= (1) TRANSMITTED SIGNALS ======= %
    
    % Signal source directions
    az = [35;39;127]; % Azimuths
    el = zeros(size(az)); % Simple example: assume elevations zero
    M = length(az); % Number of sources
    
    % Transmitted signals
    L = 200; % Number of data snapshots recorded by receiver
    m = randn(M,L); % Example: normally distributed 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;
    You can see that the nulls in the spectrum correctly align with the true azimuth directions. Of course, this example is very simple and I am happy to discuss many, many ways that it can be improved. For now, I have put plenty of comments in the code to get people started.


    1 members found this post helpful.

  6. #6
    Newbie level 6
    Points: 115, Level: 1

    Join Date
    Nov 2013
    Posts
    14
    Helped
    0 / 0
    Points
    115
    Level
    1

    Re: MUSIC Algorithm for Direction Finding

    hi..
    will u help me for implementation of music algorithm? plz..



  7. #7
    Full Member level 3
    Points: 1,231, Level: 7
    Achievements:
    Created Blog entry

    Join Date
    Oct 2013
    Posts
    165
    Helped
    54 / 54
    Points
    1,231
    Level
    7
    Blog Entries
    5

    Re: MUSIC Algorithm for Direction Finding

    My previous post provides a basic implementation of the MUSIC algorithm. What do you need to know more specifically?

    If you want my help, please write whole words; "u" and "plz" are not words.



    •   Alt16th January 2014, 20:41

      advertising

        
       

  8. #8
    Newbie level 6
    Points: 115, Level: 1

    Join Date
    Nov 2013
    Posts
    14
    Helped
    0 / 0
    Points
    115
    Level
    1

    Re: MUSIC Algorithm for Direction Finding

    Quote Originally Posted by weetabixharry View Post
    My previous post provides a basic implementation of the MUSIC algorithm. What do you need to know more specifically?

    If you want my help, please write whole words; "u" and "plz" are not words.
    ok..
    my work is based on spectrum sensing in cognitive radio.. and i want to implement music algorithm in matlab.. but i am not getting proper work flow. i am confused..
    make my way clear for spectrum estimation by music algorithm,,

    thank you ..



  9. #9
    Newbie level 6
    Points: 115, Level: 1

    Join Date
    Nov 2013
    Posts
    14
    Helped
    0 / 0
    Points
    115
    Level
    1

    Re: music direction finding

    Quote Originally Posted by deepabhargavi View Post
    Refer Array signal processing by Neilson

    To construct E(FF*) do u have the signal without noise i mean(F),go for E(XX*). music and espirit of DOA estimation methods coming under subspace methods.
    Try understanding subspace methods and orthogonality concepts.
    I will try to help with the matlab code for music
    hi..
    how to implement music algorithm for spectrum sensing in cognitive radio..
    can you give me some idea?



    •   Alt24th January 2014, 11:26

      advertising

        
       

  10. #10
    Newbie level 6
    Points: 115, Level: 1

    Join Date
    Nov 2013
    Posts
    14
    Helped
    0 / 0
    Points
    115
    Level
    1

    Re: MUSIC Algorithm for Direction Finding

    hello sir.. i have doubt

    in received signal you have defined..k ..
    how you select k?

    means i am not getting that you have taken cos and sin term randomly ya thers is some reason behind that?

    thank you sir.



  11. #11
    Full Member level 3
    Points: 1,231, Level: 7
    Achievements:
    Created Blog entry

    Join Date
    Oct 2013
    Posts
    165
    Helped
    54 / 54
    Points
    1,231
    Level
    7
    Blog Entries
    5

    Re: MUSIC Algorithm for Direction Finding

    As stated in my Matlab code, k is the wavenumber vector.

    You can find an excellent, concise explanation of the wavenumber vector on pages 5 - 6 of this pdf: link.

    Please note:
    (1) I hate being called "sir". This is simply not appropriate. You can call me weetabixharry or idiot or pig... but please not "sir".
    (2) Please do not copy your posts to me in private messages. I will only respond here in the forum.


    1 members found this post helpful.

  12. #12
    Newbie level 2
    Points: 14, Level: 1

    Join Date
    Jan 2015
    Posts
    2
    Helped
    0 / 0
    Points
    14
    Level
    1

    Re: MUSIC Algorithm for Direction Finding

    Weetabixharry i need your help in implementating MUSIC direction finding algorithm in matlab.



  13. #13
    Full Member level 3
    Points: 1,231, Level: 7
    Achievements:
    Created Blog entry

    Join Date
    Oct 2013
    Posts
    165
    Helped
    54 / 54
    Points
    1,231
    Level
    7
    Blog Entries
    5

    Re: MUSIC Algorithm for Direction Finding

    Quote Originally Posted by Nailash View Post
    Weetabixharry i need your help in implementating MUSIC direction finding algorithm in matlab.
    Please look at my Matlab code above and then let me know if you have any specific questions.



  14. #14
    Newbie level 2
    Points: 14, Level: 1

    Join Date
    Jan 2015
    Posts
    2
    Helped
    0 / 0
    Points
    14
    Level
    1

    Re: MUSIC Algorithm for Direction Finding

    Quote Originally Posted by weetabixharry View Post
    Please look at my Matlab code above and then let me know if you have any specific questions.
    "Weetabixharry as this is the basic 1D code, i need your help for implementing the standard MUSIC code
    Regards"



  15. #15
    Full Member level 3
    Points: 1,231, Level: 7
    Achievements:
    Created Blog entry

    Join Date
    Oct 2013
    Posts
    165
    Helped
    54 / 54
    Points
    1,231
    Level
    7
    Blog Entries
    5

    Re: MUSIC Algorithm for Direction Finding

    Quote Originally Posted by Nailash View Post
    "Weetabixharry as this is the basic 1D code, i need your help for implementing the standard MUSIC code
    Regards"
    What do you mean "standard" MUSIC? In my opinion, standard MUSIC is 1D. (It was originally designed for estimating sinewave frequency, not for direction finding).

    What parameters do you want to estimate? Azimuth and elevation? If so, I can easily modify the code for you.


    1 members found this post helpful.

  16. #16
    Newbie level 4
    Points: 45, Level: 1

    Join Date
    Feb 2015
    Posts
    5
    Helped
    0 / 0
    Points
    45
    Level
    1

    Re: MUSIC Algorithm for Direction Finding

    weetabixharry:
    I have worked many years with LabVIEW for DOA.
    Now, I need to apply MUSIC, for Azimuth and Elevation.
    Can you help me with Matlab code?

    Enildo
    Last edited by FvM; 8th February 2015 at 18:42. Reason: Private email deleted



  17. #17
    Advanced Member level 2
    Points: 2,992, Level: 12

    Join Date
    Feb 2012
    Posts
    552
    Helped
    43 / 43
    Points
    2,992
    Level
    12

    Re: MUSIC Algorithm for Direction Finding

    Thank for sharing this piece of code. What if M is not known or set to wrong number? For example, we have 3 real signals, but search for M=10.



  18. #18
    Full Member level 3
    Points: 1,231, Level: 7
    Achievements:
    Created Blog entry

    Join Date
    Oct 2013
    Posts
    165
    Helped
    54 / 54
    Points
    1,231
    Level
    7
    Blog Entries
    5

    Re: MUSIC Algorithm for Direction Finding

    Quote Originally Posted by Terminator3 View Post
    Thank for sharing this piece of code. What if M is not known or set to wrong number? For example, we have 3 real signals, but search for M=10.
    Good question. The MUSIC algorithm requires that M is estimated in advance. However, it has been shown that (using conventional signal models) the problem of estimating M (i.e. the "detection" problem) is fundamentally easier than obtaining distinct direction-of-arrival estimates for those M signals (i.e. the "resolution" problem).

    In other words, if the environment parameters (e.g. SNRs, DOAs, number of snapshots, array geometry) could theoretically allow the M signals to be resolved, then it is generally theoretically possible to correctly estimate M. However, the converse is not always true: even if we can estimate M correctly, it does not mean we will be able to resolve the M signals.

    Many algorithms exist for estimating M. By far the most popular in the academic literature are the MDL (Minimum Description Length) and AIC (Akaike Information Criterion) algorithms.

    - - - Updated - - -

    Quote Originally Posted by ecosierra51 View Post
    I have worked many years with LabVIEW
    I cannot describe how much I hate LabVIEW. It is an absolutely woeful heap of crap. Throw it away and learn to program. You can pick up a programming language in a few months and achieve far more than you ever did in all those years with LabVIEW.

    Quote Originally Posted by ecosierra51 View Post
    Can you help me with Matlab code?
    Sure, no problem.


    2 members found this post helpful.

  19. #19
    Newbie level 4
    Points: 45, Level: 1

    Join Date
    Feb 2015
    Posts
    5
    Helped
    0 / 0
    Points
    45
    Level
    1

    Re: MUSIC Algorithm for Direction Finding

    Weetabixharry:
    I want to estimate Azimuth and elevation.
    Please, modify the code for me.
    Thanks in advance.

    ecosierra51



  20. #20
    Full Member level 3
    Points: 1,231, Level: 7
    Achievements:
    Created Blog entry

    Join Date
    Oct 2013
    Posts
    165
    Helped
    54 / 54
    Points
    1,231
    Level
    7
    Blog Entries
    5

    Re: MUSIC Algorithm for Direction Finding

    Quote Originally Posted by ecosierra51 View Post
    I want to estimate Azimuth and elevation. Please, modify the code for me.
    So, we don't need to change the code much. The most important thing is that we cannot use a linear array to estimate elevation; we must have a 2D or 3D array (this is obvious if you think about the rotational symmetry of a linear array). Therefore, I changed the array to a uniform circular array.

    Then, we just have to calculate a separate 1D azimuth spectrum for each elevation. Here is the modified code:

    Code Matlab M - [expand]
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    
    close all; clear all; clc;
     
     
    % ======= (1) TRANSMITTED SIGNALS ======= %
     
    % Signal source directions
    az = [35;39;127]; % Azimuths
    el = [63;14;57]; % Elevations
    M = length(az); % Number of sources
     
    % Transmitted signals
    L = 200; % Number of data snapshots recorded by receiver
    m = randn(M,L); % Example: normally distributed random signals
     
    % ========= (2) RECEIVED SIGNAL ========= %
     
    % Wavenumber vectors (in units of wavelength/2)
    k = pi*[cosd(az).*cosd(el), sind(az).*cosd(el), sind(el)].';
     
    % Number of antennas
    N = 10; 
     
    % Array geometry [rx,ry,rz] (example: uniform circular array)
    radius = 0.5/sind(180/N);
    rx = radius*cosd(360*(0:N-1).'/N);
    ry = radius*sind(360*(0:N-1).'/N);
    r = [rx, ry, zeros(N,1)];
     
    % 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 = (0:1:90); % Elevation values to search
     
    % 2D MUSIC spectrum
    Z = zeros(length(AzSearch),length(ElSearch));
    for i = 1:length(ElSearch)
        % Elevation search value
        el = ElSearch(i);
        
        % Points on azimuth array manifold curve to search (for this el)
        kSearch = pi*[cosd(AzSearch)*cosd(el), ...
                  sind(AzSearch)*cosd(el), ...
                  ones(size(AzSearch))*sind(el)].';
        ASearch = exp(-1j*r*kSearch);
        
        % Compute azimuth spectrum for this elevation
        Z(:,i) = sum(abs(ASearch'*En).^2,2);
    end
     
    % Plot
    figure();
    surf(AzSearch, ElSearch, -10*log10(Z.'/N));
    shading interp;
    title('2D MUSIC Example');
    xlabel('Azimuth (degrees)');
    ylabel('Elevation (degrees)');
    zlabel('MUSIC spectrum (dB)');
    grid on; axis tight;

    This produces a 2D spectrum like this:

    music2d.png

    Note that, for convenient viewing, I plot the negated spectrum. This means that we get peaks at the target directions (instead of nulls), which I find easier to view for the 2D case.

    Of course, we don't have to stop at 2D. We can extend, for example, to 3D and 4D to estimate Doppler and time of arrival. This is interesting to experiment with in theory, but in practice a 3D or 4D exhaustive search is far too slow to compute. Instead, we normally find clever ways of reducing the problem (e.g. a 1D search for time of arrival, followed by a 2D azimuth-elevation search is much faster than an exhaustive 3D search).
    Last edited by weetabixharry; 14th February 2015 at 10:00.


    2 members found this post helpful.

+ Post New Thread
Please login
Page 1 of 2 12 LastLast