www.pudn.com > Untitled71.rar > Untitled71.m, change:2010-11-13,size:3514b


clear all; 
clc; 
k=1; 
A=[]; 
B=[]; 
C=[]; 
E=[]; 
B2=[]; 
C2=[]; 
A2=[]; 
A3=[]; 
B3=[]; 
C3=[]; 
 
bt=input('enter the value of beta(.5,1 or 2)') 
 
y=input('enter the value of yamma') 
N=input('enter the no of receiver') 
M=input('enter the no of transmitter') 
L=input('enter the no of baseband signal') 
for tht=-90:1:90 
    tht1=(pi/180).*tht; 
    Fsi=.5*sin(tht1); 
    fd=bt*Fsi; 
    j=sqrt(-1); 
     
    for k=1:1:N 
    a(k)= exp(j*2*(k-1)*pi*Fsi); 
    end 
    b=transpose(a); 
    B=[B b]; 
  
    for k=1:1:M 
    c(k)= exp(j*2*(k-1)*pi*y*Fsi); 
    end 
     
   d=transpose(c);  
   C=[C d]; 
  
    for k=1:1:L 
    e(k)= exp(j*2*(k-1)*pi*fd); 
    end 
    
   f=transpose(e); 
   E=[E f]; 
 
   s1=kron(d,b); 
   s=kron(f,s1); 
   A=[A,s]; 
end 
 
 %mesh(real(B)) 
 
%title('spatial steering vector') 
 
%xlabel('angle from -pi/2 to pi/2') 
 
%ylabel('no of element=16') 
 
%axis normal 
 
%mesh(real(C)) 
 
%title('temporal steering vector') 
 
%xlabel('doppler variation fd') 
 
%ylabel('no of taps=16') 
 
%axis normal 
 
%mesh(real(A)) 
 
%title('combined steering clutter vector') 
 
%xlabel('180 clutter steering vector') 
 
%ylabel('length of clutter steering vector 256') 
%axis normal  
% Xc=A(:,1); 
%for k=2:1:181 
%Xc=Xc+A(:,k); 
%end 
i=1; 
for tht2=-90:1:90 
 th2=(pi/180).*tht2; 
if(th2~=0) 
    gain(i)=((sin(16*pi*.5*sin(th2)))/(sin(pi*.5*sin(th2)))); 
    i=i+1; 
else 
    gain(i)=16; 
    i=i+1; 
end 
end 
Rc=zeros(size(A(:,1)*A(:,1)')); 
 for i=1:1:181 
  
Rc=Rc+(1/16).*gain(i).*(A(:,i)*A(:,i)'); 
 
 
end 
 
 
 %mesh(log10(abs(Rc))) 
 %title('clutter only covariance matrix') 
 %xlabel('matrix row index') 
 %ylabel('matrix column index') 
 %zlabel('absolute value in log10 scale') 
 %axis normal 
Rj=[]; 
J1=40; 
j1=pi/4; 
j1=.5*sin(j1); 
sigsqj=10000; 
for i=1:1:N 
    p(i)= exp(j*2*(i-1)*pi*j1); 
    end 
for i=1:1:M 
    q(i)= exp(j*2*(i-1)*pi*y*j1); 
    end 
     
 
s1=kron(q,p); 
s1=transpose(s1); 
Rj1=sigsqj*s1*s1'; 
for i=1:1:L 
Rj=blkdiag(Rj, Rj1); 
end 
% mesh(((abs(Rj)))) 
% title('Jammer covariance matrix') 
% xlabel('matrix row index') 
% ylabel('matrix column index') 
% zlabel('absolute value ') 
% axis normal 
sigsq=1; 
f=Rc(1,1)/sigsq; 
x=1000/f; 
Rc1=x*Rc; 
Rcni=Rc1+sigsq*eye(size(Rc1))+Rj; 
 
 
%mesh(log10(abs(Rcni))) 
% title('Total interference covariance matrix') 
% xlabel('matrix row index') 
% ylabel('matrix column index') 
% zlabel('absolute value in log10 scale') 
%psdt=A'*(Rcni)*A; 
%tht=-89:1:90; 
%    tht1=(pi/180).*tht; 
 %   th=.5*sin(tht1); 
  %  fd=bt*th; 
 
%mesh(th,fd,10*log10(abs(psdt))) 
%axis([- .5 .5 - .5 .5 ]) 
%title('psd of clutter+noise+interference') 
%xlabel('normalized angle') 
%ylabel('normalized doppler') 
%zlabel('dB') 
 Fs=0; 
 An=[]; 
 Bn=[]; 
 Cn=[]; 
 En=[]; 
for thtn=-90:1:90 
    tht1n=(pi/180).*thtn; 
    
    Fsin=.5*sin(tht1n); 
    fdn=bt*Fsin; 
     
    for i=1:1:N 
    an(i)= exp(j*2*(i-1)*pi*Fs); 
    end 
     
    bn=transpose(an); 
    Bn=[Bn bn]; 
     
    for i=1:1:M 
    cn(i)= exp(j*2*(i-1)*pi*y*Fs); 
    end 
    
   dn=transpose(cn);  
   Cn=[Cn dn]; 
    for i=1:1:L 
    en(i)= exp(j*2*(i-1)*pi*fdn); 
    end 
    
    
   fn=transpose(en); 
   En=[En fn]; 
   sn=kron(dn,bn); 
   sn1=kron(fn,sn); 
   An=[An,sn1]; 
end 
signal=An*An'; 
 
Rcnit=Rcni+signal; 
for i=1:1:181 
w=(inv(Rcnit)*An(:,i))/((An(:,i)')*inv(Rcnit)*An(:,i)); 
sinr(i) =((w')*An(:,i))^2/((w')*Rcnit*w); 
 
i=i+1; 
end 
 
 
 
fd2=-.5:1/180:.5 
hold on 
plot(fd2,10*log10(abs(sinr)))