
function [ Omega ] = Fisher_Information( theta_1,theta_2,theta_3,gain,V,F,S,sigma_2,My,Mz,Nt,P0,rank1 )

L=rank1;

A = V.'*steering_matrix_UPA(My,Mz,theta_1);%M
B = F.'*steering_matrix_ULA(Nt,theta_2);
C = S*steering_matrix_tao(P0,theta_3)*diag(gain);

A_tilde1=V.'*1j*diag(kron(0:(My-1),ones(1,Mz)))*steering_matrix_UPA(My,Mz,theta_1);
A_tilde2=V.'*1j*diag(kron(ones(1,My),0:(Mz-1)))*steering_matrix_UPA(My,Mz,theta_1);
B_tilde=F.'*1j*diag(0:(Nt-1))*steering_matrix_ULA(Nt,theta_2);
C_tilde=S*1j*diag(0:(P0-1))*steering_matrix_tao(P0,theta_3)*diag(gain);
G=S*steering_matrix_tao(P0,theta_3);


num_matrix=1;
Omega_cell=cell.empty;
for mode_1=1:5
    for mode_2=1:5
        Omega_cell{num_matrix}=Covariance_Matrix( A,B,C,A_tilde1,A_tilde2,B_tilde,C_tilde,G,mode_1,mode_2,sigma_2);
        Omega_cell{num_matrix}=convert_covari_vector2matrix(Omega_cell{num_matrix},L);
        num_matrix=num_matrix+1;
    end
end

Omega_1=2*real([Omega_cell{1},Omega_cell{2},Omega_cell{3},Omega_cell{4};...
    Omega_cell{6},Omega_cell{7},Omega_cell{8},Omega_cell{9};...
    Omega_cell{11},Omega_cell{12},Omega_cell{13},Omega_cell{14};...
    Omega_cell{16},Omega_cell{17},Omega_cell{18},Omega_cell{19}]);
Omega_2=([Omega_cell{5};Omega_cell{10};Omega_cell{15};Omega_cell{20}]);%不求共轭吗？？
Omega_3=([Omega_cell{21},Omega_cell{22},Omega_cell{23},Omega_cell{24}]);%不求共轭吗？？
Omega_4=Omega_cell{25};
Omega=[Omega_1,Omega_2;Omega_3,Omega_4];

    
    
   

    function B=convert_covari_vector2matrix(A,L)
        % Convert the L^2*L^2 matrix A into L*L matrix B
        B=zeros(L,L);
        
        for l1=1:L
            for l2=1:L
                B(l1,l2)=A(L*(l1-1)+l1,L*(l2-1)+l2);
            end
        end
    end
end

