sa_ex7_15b.m

来自「这个是英文版<<Smart Antennas for Wireles」· M 代码 · 共 33 行

M
33
字号
sa% ESPRIT AOA estimation for a M = 4 element array with noise variance = .1M = 4;    % number of array elementsD = 2;  % number of signalssig2 = .1;    % noise varianceth1 = -10*pi/180;      % angle of arrival 1th2 = 20*pi/180;       % angle of arrival 2i = 1:M;a1 = exp(1j*(i-1)*pi*sin(th1));a2 = exp(1j*(i-1)*pi*sin(th2));A=[a1.' a2.'];          % calculate matrix of steering vectors for the D signalsRss = [1 0;0 1];  Rxx = A*Rss*A'+sig2*eye(M);[V,Dia]=eig(Rxx);           % find eigenvalues and eigenvectors of Rrr[Y,Index]=sort(diag(Dia));   % sorts the eigenvalues from least to greatestES=V(:,Index(M-D+1:M));      % calculate the signal subspace matrix of eigenvectors                              % using the sorting done in the previous line          E1=ES(1:M/2+1,:);           % construct the signal subspace form the first K rows of ES (K = M/2+1)E2=ES(M/2:M,:);             % construct the signal subspace from the last K rows of ESC=[E1';E2']*[E1 E2];[EC,tmp]=eig(C);            % Perform the eigendecomposition on the matrix CE12=EC(1:2,3:4);            % construct the E12 submatrixE22=EC(3:4,3:4);            % construct the E22 submatrixPSI=-E12*inv(E22);          % estimate PSI, the rotation operator[Vp,Ep]=eig(PSI);           % find the eigenvalues and eigenvectors of rotation operator PSIe=diag(Ep);angs=asin(angle(e)/pi)*180/pi     % find the angles associated with the roots

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?