% code by Estelle Yuan
clear all;
close all;
clc;
derad = pi/180;
radeg = 180/pi;
twpi = 2 * pi;
M = 3; % ULA阵元数
lamda = 1;
dd = lamda / 2; %阵元间距
d = 0 : dd : (M - 1) * dd;
theta = [10 30 50 70];
phi = [20 40 60 80];
% theta = [-0.5 0.5];
K = length(theta); % 信元数
A = exp(1j * d.' * twpi * sin(theta * pi / 180) ); % 阵列流型
%%
Nsub = 300; % 快拍数
s1 = randn(1, Nsub);
s1 = s1 - mean(s1).* ones(1, Nsub);
s2 = randn(1, Nsub);
s2 = s2 - mean(s2).* ones(1, Nsub);
s3 = randn(1, Nsub);
s3 = s3 - mean(s3).* ones(1, Nsub);
s4 = randn(1, Nsub);
s4 = s4 - mean(s4).* ones(1, Nsub);
ns1 = s1 .* exp(1j * deg2rad(phi(1)));
ns2 = s2 .* exp(1j * deg2rad(phi(2)));
ns3 = s3 .* exp(1j * deg2rad(phi(3)));
ns4 = s4 .* exp(1j * deg2rad(phi(4)));
ns = [ns1;ns2;ns3;ns4];
x = A * ns;
snr = 5;
x = awgn(x, snr);
y = [x;conj(x)];
Ry = y * y' / Nsub;
[EVx, Dx] = eig(Ry); % 特征值分解 MUSIC-LIKE
EVAx = diag(Dx)';
[EVAx, I1x] = sort(EVAx); % 特征值从小到大排列
EVAx = fliplr(EVAx); % 左右翻转,从大到小排列
EVx = fliplr(EVx(:, I1x)); % 对应特征矢量排序
En1 = EVx(1 : M, K + 1 : 2 * M);
En2 = EVx(M + 1 : 2 * M, K + 1 : 2 * M);
abs(conj(En2)*En2.'-En1*En1')
searching_doa = -90 : 0.1 : 90;%线阵的搜索范围为-90~90度
for ii = 1:length(searching_doa)
a_theta = exp(1j * (0 : M - 1)' * 2 * pi * dd * sin(pi * searching_doa(ii) / 180));
f1 = a_theta' * En1 * En1' * a_theta;
f2 = a_theta.' * En2 * En2' * a_theta;
f3 = a_theta' * En1 * En2' * conj(a_theta);
f4 = a_theta' * En2 * En2' * a_theta;
Pmusic1(ii, 1) = f1 + f2 - 2 * abs(f3);
Pmusic2(ii, 1) = f1 - abs(f3);
Pmusic3(ii, 1) = f1 * f1' - f2 * f4;
end
% figure(2);
% plot(searching_doa, abs(Pmusic2),'r','linewidth',2);
figure(21);
P_MUSIC_dB2 = 10 * log(abs(Pmusic2));
plot(searching_doa, P_MUSIC_dB2,'r','linewidth',2);
[val, ind] = findpeaks(-P_MUSIC_dB2(:, 1));
[~, id] = sort(val, 'descend');
idd = ind(id);
doa = sort(searching_doa(idd(1 : K)))
doa =
10.1000 32.0000 49.7000 67.2000
图1 NC-MUSIC谱峰搜索图
emmm,虽然NC-MUSIC能提高可探测信源数,但是抗噪性能赶脚没有MUSIC好。SNR=0dB的时候,明显估不准,但是MUSIC在SNR=0dB的时候最少不会偏的很远。这就是很离谱,我没想到解释估不准的原因。有哪位小伙伴知道原因可以告知我哈。。。。
顺便说一声,copy code的时候点个赞呗