www.pudn.com > sparse_wsf.rar > sparse_wsf.m, change:2009-09-07,size:3059b


clear; 
index=1; 
rmse_fi=0; 
mse_fi=zeros(1,51); 
m=17; % 阵元数 
p=2; % 信号数 
%俯仰角为入射方向与圆阵轴线之间的夹角,方位角为x轴到入射线在圆阵上投影的夹角 
st1=80; % 俯仰角 
dt1=40; % 方位角 
st2=80; 
dt2=80; 
 
% st=[st1;st2]; 
% dt=[dt1;dt2]; 
st=80*ones(1,360); 
dt=0:359; 
 
 
% nn=256;  
degrad=pi/180; 
lamda=0.3; 
k0=2*pi/lamda; 
radius=1.5*lamda; 
M=8; 
phase_mode=10; 
% 圆半径为半波长 
A=zeros(m,360); 
D=zeros(m,360); 
k=(0:m-1)'; 
for t=1:360 
A(:,t)=exp(i*2*pi*(radius/lamda)*(sin(st(t)*degrad)*cos(dt(t)*degrad)*cos(2*pi*k/m)+sin(st(t)*degrad)*sin(dt(t)*degrad)*sin(2*pi*k/m))); 
end 
for t=1:360 
    D(:,t)=exp(i*degrad*(-M:M)'*dt(t)); 
end 
T=D*A'*inv(A*A'); 
% error=T*A-D; 
% plot(abs(error(1,:))); 
figure; 
M1=8; 
g=zeros(m,360); 
for t=1:m 
g(t,:)=ifftshift(ifft(A(t,:),360)); 
end 
G=g(:,181-M1:181+M1); 
error1=A-G*D; 
plot(abs(error1(1,:))); 
 
% load sig3 
% % for snap=1:15 
% % for snr=0:50 
% snr=10; 
% sn=[snr;snr]; 
% nn=256; 
% tt=1:nn; 
% S=[s1(tt),s2(tt)]'; 
%  
% Ps=S*S'/nn; 
% ps=diag(Ps); 
% refp=2*10.^(sn/10); 
% tmp=sqrt(refp./ps); 
% SS=diag(tmp)*S; 
% % for num=1:200 
% noise=randn(m,nn)+i*randn(m,nn);  
% X=A*SS+noise; 
v=i.^ (-M:-1); 
vv=[v,1,(fliplr(v))]; 
Cv=diag(vv); 
garma=2*pi*(0:m-1)/m; 
V=sqrt(m)*(exp(i*(-M:M)'*garma)/m)'; 
Fe=V; 
MM=2*M+1; 
% W=exp(i*(-phase_mode:phase_mode)'*(-M:M)*2*pi/MM)/sqrt(1/MM); 
% Fr=(W'*Fe')'; 
% Y=Fe'*X; 
% Ryy=(Y*Y')/nn; 
% [U,S,V]=svd(Ryy); 
% Us=U(:,1:p); 
% Un=U(:,p+1:MM); 
% J1=(i.^(1:phase_mode)).*besselj(1:phase_mode,k0*radius*sin(st1*degrad)); 
% B1=sqrt(m)*diag([fliplr(J1),besselj(0,k0*radius*sin(st1*degrad)),J1]); 
% ii=eye(2*M+1); 
%  H=[ii(:,3*M-phase_mode+2:2*M+1),ii,ii(:,1:phase_mode-M)]; 
%  
% GG=B1'*H'*Un*Un'*H*B1; 
% abs(A(:,1)'*Fe*G*G'*Fe'*A(:,1)) 
% AA=exp(i*dt1*degrad*(-M:M)'); 
% (:,1); 
% AA1'*GG*AA1 
% spectum=zeros(1,361); 
% fi1=40; 
% fi2=80; 
% fi=[fi1 fi2]; 
% Fi=fi1+fi2; 
% for fi2=0:360 
% fi=[fi1 fi2]; 
% MM=2*M+1; 
% delta=sum(diag(S(p+1:MM,p+1:MM)))/(MM-p); 
% W=(S(1:p,1:p)-delta*eye(p,p))^2*inv(S(1:p,1:p)); 
% AA1=exp(i*degrad*(-phase_mode:phase_mode)'*fi); 
% % AA=H*B1*AA1; 
% AA=H*B1*AA1; 
% % AA=Fe'*A; 
% pa=eye(MM,MM)-AA*inv(AA'*AA)*AA'; 
% f=pa*U(:,1:p)*W*U(:,1:p)'; 
% spectum(fi2+1)=sum(diag(f)); 
% end 
% [Y,I]=min(spectum) 
% H*B1*AA1-Fe'*A 
% MM=2*phase_mode+1; 
% M=2*M+1; 
% b0=exp(i*(p*pi-Fi*degrad)/2); 
% b1=-b0*(exp(i*fi1*degrad)+exp(i*fi2*degrad)); 
% b2=b0*((-1)^p*exp(i*(fi1+fi2)*degrad)); 
% b=[b2 b1 b0]; 
% B=zeros(MM-p,MM); 
% for n=1:(MM-p) 
%     B(n,:)=[zeros(1,n-1) b zeros(1,MM-n-p)]; 
% end 
% B=B'; 
% delta=sum(diag(S(p+1:M,p+1:M)))/(M-p); 
% W=(S(1:p,1:p)-delta*eye(p,p))^2*inv(S(1:p,1:p)); 
% G=H*B1; 
% G_i=pinv(G); 
% AA1=exp(i*degrad*(-phase_mode:phase_mode)'*fi); 
% B'*G_i*G*AA1 
% f=G_i'*B*inv(B'*G_i*G_i'*B)*B'*G_i*Us*W*Us; 
% sum(diag(f)) 
 
 
 
 
% rmse_fi=rmse_fi+abs(fi-dt1)^2; 
% end 
% sqrt(rmse_fi/199); 
% mse_fi(index)=sqrt(rmse_fi/199); 
% rmse_fi=0; 
% index=index+1; 
% end 
% snapshot=0:50; 
% semilogy(snapshot,mse_fi,'--r*'); 
% axis([0 50 0.001 10]); 
% grid on;