www.pudn.com > fangzhen.rar > xishudankuaipai.m, change:2011-06-22,size:647b


clear all 
close all 
clc 
theta1 =[0*pi/180 10*pi/180]; 
the = 180*theta1./pi; 
snr =20; 
L1 = 8; 
d = 0.5; 
N =1; 
 
M =2; 
 
n = 1:N; 
for p = 1:M 
    s(p, : )= sqrt(10.^(snr/10))*exp(j*2*pi*rand(1,1)*n); 
     for k = 1:L1 
        a(k,p) = exp(-j*(k-1)*2*pi*d*sin(theta1(p))); 
    end 
end 
xx = a*s; 
xx = awgn(xx,snr); 
AA=[]; 
theta=-90:1:90;  
for i = 1:length(theta)  
    g=exp(-j*2*pi*[0:L1-1]'*d*sin(theta(i)/180*pi));  
    AA=[AA,g];  
end  
cvx_begin 
    variable v(181); 
    minimize(norm(xx-AA*v,2)+norm(v,1)); 
cvx_end 
 
searching_doa=-90:90; 
plot(searching_doa,20*log10(v),'r'); 
xlabel('DOA/degree'); 
ylabel('PowerdB');