% The situation of receiving and receiving multi-path

clear all
close all
clc
c=3e8;
f0 = 150e6;        % carrier frequency
fd = 100;          % Dopley frequency
lemda = c/f0;
d =lemda/1;        % Array element spacing
snap=10;           % Number of quick shots
P=2;               % Number of sources ( Direct and mirror reflection signals )
Ne = 11;           % Number of elements of the launch array
Nr = 11;           % Number of receiving array elements
Te = 100e-6;       % Pulse width
Tr = 1000e-6;      % 1e-3*3e8 = 3e5    Maximum range    1000us
T0 = Tr;           % 100ms

center_f = (Ne-1)/2;
delta_f = 1/Te;
B = Ne*delta_f;
Fs=2*B;              % Sampling rate
Ts=1/Fs;
R = 100e3;         % Distance of array target  
ht=4000;           % Target height
ha=100;            % Antenna height
Rd=sqrt(R^2+(ht-ha)^2);      % Direct wave path
Ri=sqrt(R^2+(ht+ha)^2);      % Reflection wave path
range = [Rd Ri];
theta1 = atan((ht-ha)/R);
theta2 = -atan((ht+ha)/R);
 theta = [theta1;theta2];      
%theta = [-1;8]/180*pi;      
% theta = [theta1;theta2]/pi*180;     % DOA
amplify = [1 .9];
%amplify = [1 1];
% amplify = [1 0.9*exp(j*pi)];
% t=0:Ts:T0-Ts;    %        
t=0:Ts:T0-Ts;               % Time coordinate
tao = 0+Te/2:Tr:T0;   % Tr
rect_me1 = pulstran(t,tao,'rectpuls',Te);

% s_num = double(int32(Tr/Ts)); 
S = zeros(Nr,length(t),Ne);
X = zeros(Nr,length(t),Ne);
%%%%%%%%%%%% launch , Both direct and reflected waves are received , Equivalent to four paths , Generate signal
for loop1 = 0:Nr-1         % receive
    for loop2 = 0:Ne-1     % launch
        for loop = 1:2     % Direct and reflective emission
           fj = f0+(loop2-center_f)*delta_f;
           at = amplify(loop)*exp(j*2*pi*loop2*d*sin(theta(loop))./lemda);   
           tao = 2*range(loop)/c;
%          tao = 0;
           temp = at*rect_me1.*exp(j*2*pi*fj*(t-tao));    %
Temporary transmit signal , Direct use fj do ML incorrect , Because it's heterofrequency
%          temp = at*exp(j*2*pi*f0*(t-tao));              % Temporary transmit signal , If used f0 sure ,
           for loop3 = 1:2                                % Receive direct and reflective
    %           ar = exp(j*2*pi*loop1*d*sin(theta(loop))./lemda);
                ar =
amplify(loop3)*exp(j*2*pi*(loop1)*d*sin(theta(loop3))./lemda);  % Receive direct and reflective
                S(loop1+1,:,loop2+1) = S(loop1+1,:,loop2+1) + ar*temp;       
       % Multiply receive guide vector
            end
        end
    end
end
%%%%%%%%%%%% processing
p=1;
% for SNR = -15:5;
    SNR = 20;
    snr = 10^(SNR/20); %% SNR
    mentcronumber = 10;
    for mentcro = 1:mentcronumber
        noise = normrnd(0,1,size(S));
        X = snr*S + noise;                             
%         X = snr*S;                             
%         Ne /---------------/|
%           /               / |
%       Nr /---------------/  /  
%         |               |  /
%       1 |_______________|/
        temp_X = zeros(1,length(t));
        temp_XXX = zeros(Nr,Ne);
%         temp_ss = zeros(11,1);
        temp0 = zeros(Nr,length(t));
        Rx_ss = zeros(Nr,Nr);
        k1=1;
        for loop = 1:Nr
               for loop3 = 0:Ne-1    % Emitter element
                        tao = 2*range(1)/c;
                        fj = f0+(loop3-center_f)*delta_f;
                        complement = exp(j*2*pi*fj*(t-tao));%
                        temp_X = X(loop,:,loop3+1);                       
                         temp_XXX((loop3)*Ne + k1) = temp_X*complement';
%                       temp_XXX(loop3+1,k1) = temp_X*complement';        
               end
               k1=k1+1;
%             %%%  
%             for loop0 = 1:Nr
%                 temp0(loop0,:) = X(loop,:,loop0);
%             end
%             temp_ss = temp0;
% %           temp_ss = X(:,:,loop);
%             Rx_ss = Rx_ss + temp_ss*temp_ss';    
        end
    %%%%%%%%%%%%%%%%%%%% SS
        for loop = 1:Nr
            temp_ss(:,1) = temp_XXX((loop-1)*Nr+1:loop*Nr);
            Rx_ss = Rx_ss + temp_ss*temp_ss';    
        end

       [V,D]=eigs(Rx_ss/Ne,Ne);       % Feature decomposition
        G=V(:,P+1:Ne)*V(:,P+1:Ne)';
        hang = [0:Nr-1];
        k=1;
            for loop = -10:0.01:10
                  a = exp(j*2*pi*d*hang.'*sin(loop/180*pi)./lemda);
                  power(k) = 1/abs(a'*G*a);
                  k=k+1;
            end
            figure(1)
            plot(-10:0.01:10,20*log10(abs(power)),'b-')
            grid on
            hold on
end
xlabel('DOA( degree )')
ylabel('MUSIC Spectral peak ')
title(' Target height 4000m')

Technology
©2019-2020 Toolsou All rights reserved,
A summary of the computer retest interview questions var a = 0, b = 0; function A(a) {A = function (b)... An interview question about scope 【 Data structure and algorithm 1】 Sparse array 2020—— Net tripod cup part writeupPTA-MOOC《Python Programming Zhejiang University 》 Puzzle A Chapter 2 programming problems python closure uniapp Dynamic routing parameter transfer ( Delivery object ) How to use it Python Batch import Excel Combined use Pandas integration Lambda Expression and functional interface 【Java Details of knowledge points 3】 Serializable and Deserialize