www.pudn.com > SPICE.zip > MRA_output.m, change:2011-07-11,size:1900b


function [X CRLB_theta] = MRA_output(cita,deploy,f,c,d,snap,sigman,SNR) 
%Signal generation 
M = length(deploy); 
N = length(cita); 
A = zeros(M,N); 
D = zeros(M,N); 
j = sqrt(-1); 
for k = 1:N 
    A(:,k) = exp(-j*2*pi*(f/c)*d*sin(cita(k)*pi/180)*deploy'); 
    D(:,k) = (-j*deploy').*exp(-j*2*pi*(f/c)*d*sin(cita(k)*pi/180)*deploy'); 
end 
s = (1/sqrt(2))*(randn(N,snap)+j*randn(N,snap)); 
Xnf0 = A*s; 
% sigma2 = (sigman^2)*(10^(SNR/10))/(norm(Xnf0,'fro')^2/prod(size(Xnf0))); 
sigma2 = (sigman^2)*(10^(SNR/10)); 
X = sqrt(sigma2)*Xnf0+sigman*(1/sqrt(2))*(randn(M,snap)+j*randn(M,snap)); 
%CRLB for DOA estimation 
if N < M 
    CRLB_theta = 0; 
    CRBMat = zeros(N,N); 
    for t = 1:snap 
        Xtd = eye(N); 
        for k = 1:N 
            Xtd(k,k) = sqrt(sigma2)*s(k,t); 
        end 
        CRBMat = CRBMat+real(Xtd'*D'*(eye(M)-A*pinv(A'*A)*A')*D*Xtd); 
    end 
    CRBMat = (sigman^2/2)*pinv(CRBMat); 
    for k = 1:N 
        CRLB_theta = CRLB_theta+CRBMat(k,k); 
    end 
    CRLB_theta = sqrt(CRLB_theta/N); 
    CRLB_theta = abs((180/pi)*asin(CRLB_theta/(2*pi*f*d/c))); 
else 
    CRLB_theta = 0; 
    D = (-j*2*pi*(d*f/c)*deploy'*cos((pi/180)*cita)).*A; 
    P = sigma2*eye(N); 
    R = A*P*A'+(sigman^2)*eye(M); 
    Fishmat = zeros(N,N); 
    for k1 = 1:N 
        for k2 = 1:N 
            %%%%%%%%%%%%%%%%% 
            ak1 = zeros(M,1); 
            ak1(:) = A(:,k1); 
            ak2 = zeros(M,1); 
            ak2(:) = A(:,k2); 
            dk1 = zeros(M,1); 
            dk1(:) = D(:,k1); 
            dk2 = zeros(M,1); 
            dk2(:) = D(:,k2); 
            %%%%%%%%%%%%%%%%% 
            Fishmat(k1,k2) = snap*trace(inv(R)*sigma2*(dk1*ak1'+ak1*dk1')*inv(R)*sigma2*(dk2*ak2'+ak2*dk2')); 
        end 
    end 
    CRBmat = inv(Fishmat); 
    for k = 1:N 
        CRLB_theta = CRLB_theta+CRBmat(k,k); 
    end 
    CRLB_theta = abs((180/pi)*sqrt(CRLB_theta/N)); 
end